Module Based Game?
So I'm gearing myself up for my latest project which plans to be bigger and better then that last. (Space Wizard, as seen in the current OMG contest) Although in my pondering I have come to a question that I have yet been able to answer.
Consider this, I would like to make my game module based. What i mean is that the engine that handles network code, the 3d engine, and file loading would be separate from the actual game code. I want to do it in such a way that I could easily re-use my engine, and if I wanted to offer after installation modules for the game, I could. Although without the use of scripting languages, which I assume would be slow for writing the game code in, I'm not sure how I would accomplish this.
Has anyone built a game like this, or have any idea where I could start?
Consider this, I would like to make my game module based. What i mean is that the engine that handles network code, the 3d engine, and file loading would be separate from the actual game code. I want to do it in such a way that I could easily re-use my engine, and if I wanted to offer after installation modules for the game, I could. Although without the use of scripting languages, which I assume would be slow for writing the game code in, I'm not sure how I would accomplish this.
Has anyone built a game like this, or have any idea where I could start?
First idea that popped into my head (haven't tested but might work) is write a portion of your engine to check locally for these modules. For instance your engine could always look in the directory it's in for a folder called "Modules". Your engine would then loop through all the files, loading any with a .mod extension (or whatever extension you want to use). You'd have to make an amazing engine to handle this I'd assume, but there's at least a starting point for getting all the modules.
Rule #1 of "engine" programming -- don't do it.
An "engine" is the code that's shared between two or more games. That is all.
Plug-ins are a different matter entirely, but that's not a case where you can give unlimited flexibility to expansion, and even if it were, I don't see the point...
An "engine" is the code that's shared between two or more games. That is all.
Plug-ins are a different matter entirely, but that's not a case where you can give unlimited flexibility to expansion, and even if it were, I don't see the point...
I'm with Keith here - it's just not worth it. The time it takes to setup an engine to work with your game idea is less than 1‰ compared to the rest of the game development. While it is a nifty idea, there's a reason nobody does it: it's tricky, error prone and it will only limit you in the end.
Ok, so what I'm hearing is that it is not a good idea to make the engine and game separate. Which honestly is fine since I've nver had to program like that. Although if I still want to add plug-ins, lets say for different weapons, new game play modes, more levels, I could just write a parser for that. Although is there someway that I could just drop in pre-compiled code in a standard format? Say a gameplay c++ object?
Yes, you can compile your code snippet as a shared library, and load it dynamically with CFBundle/NSBundle/CFM. CFBundle or CFM will let you retrieve a pointer to each function defined in the shlib/bundle, and NSBundle will give you Objective-C classes.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Game Module Structure Question | Lunatic | 7 | 3,223 |
Sep 6, 2005 04:27 AM Last Post: TomorrowPlusX |
|
| Create a simple 2d sprite based game | Justin Brimm | 8 | 5,117 |
Jan 29, 2003 03:38 PM Last Post: Justin Brimm |
|
| Cocoa Hex Based Game question | akinnie | 5 | 5,038 |
Jun 12, 2002 06:40 AM Last Post: akinnie |
|

