have the engine in the .exe or .dll file?
what are the difference in the different aproaches?
1) game in exe file
Game.exe - all game specefic stuf and initialize of engine
Engine.dll - the engine specefic stuff
2) engine in exe file
Engine.exe - all engine specefic stuff goes here
Game.dll - all game code would be written here and loaded by the engine at startup
3) both game and engine in dll file
Main.exe - just winmain(..) with startup code to initialize the engine.dll
Engine.dll - the engine core stuff
Game.dll - the game specefic code
what are the pros/cons with the different solutions? personally I would choose number 1 or 3 becouse then I can use the same engine in the editor and engine
In my opinion, it is more natural tu consider
the game in the exe file and the engine in the dll because the game is an application that use the engine feature
Davide
the game in the exe file and the engine in the dll because the game is an application that use the engine feature
Davide
Yeah, game.exe + engine.dll is the most logic approach. If you improve the engine code without changing the API, you can get a new version of the .dll without recompiling the .exe. Most of Windows' dlls should (*should*) work this way.
The lines between 1 and 3 mostly dissolve when you use scripted content. At any rate, don't use 2, for the reason you already mentioned.
Quote:Original post by Nemesis2k2
The lines between 1 and 3 mostly dissolve when you use scripted content. At any rate, don't use 2, for the reason you already mentioned.
i have to disagree
in my opinion 2 is the best choice of all
1. moving the engine into the exe and the gamecode into the dll allows you to give the game code to the modding community
2. you can update the engine without having to worry about the gamedlls to become uncompatible
3. you can avoid a lot of cheats by moving the engine into the exe
e.g. you can overload function pointers of the engine dll and set a dll between the exe and the engine dll which for example allows you to implement a wallhack
or aimbots .... doing this with the engine in the exe is a lot more difficult
That depends.
If you are doing this game for exercise, then put both inside. However if you'd like to make true engine, you should put it in dll with set of neat interfaces.
This way you can :
- optimize engine without touching the game
- split relationship between game object (actor) and engine object (model)
- quickly test some engine stuff (because you already have framework)
- make working on editor and game very easy
The cons are:
- upgrading engine interfaces means rebuilding game code base
If you are doing this game for exercise, then put both inside. However if you'd like to make true engine, you should put it in dll with set of neat interfaces.
This way you can :
- optimize engine without touching the game
- split relationship between game object (actor) and engine object (model)
- quickly test some engine stuff (because you already have framework)
- make working on editor and game very easy
The cons are:
- upgrading engine interfaces means rebuilding game code base
I was working on an engine for a bit as a side project, and one bonus you get from splitting things into dll's ( or even static libs for that matter ), is that the game compiles faster. I had my engine as one huge project, and it would take minutes to compile and link, but once I turned it into manageable chunks it compiled much faster. So, just a thought.
Professional games seem to either have the engine in an executable and the game in a dynamic library (Quake 1/2/3, Half-Life, Doom 3, etc), or have the engine in separate libraries and the game as a set of scripts (Unreal, Unreal Tournament, Serious Sam).
The approach Id Software took with their product is actually the simplest. The engine acts as a sort of "game operating system", and the game code does not have to worry with initialization of anything, it just runs on top of the engine.
The approach Id Software took with their product is actually the simplest. The engine acts as a sort of "game operating system", and the game code does not have to worry with initialization of anything, it just runs on top of the engine.
Quote:Original post by INVERSED
I was working on an engine for a bit as a side project, and one bonus you get from splitting things into dll's ( or even static libs for that matter ), is that the game compiles faster. I had my engine as one huge project, and it would take minutes to compile and link, but once I turned it into manageable chunks it compiled much faster. So, just a thought.
That's because you stopped recompiling the same code over and over, even though some of it hadn't changed. The same can be accomplished by saving your object files and only calling the linker when you build your project.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement