Categories
Uncategorized

Modular component programming

The more I work on the engine at work the more this reinforces my idea that modular component programming is the way to go. The problem I’m having is that every time I want to compile it takes 5 minutes. Every time I want to load the game it’s another 2 minutes. A morning update from source control might take 15 minutes in total to resolve all the files and everything else you need to do. Worse, these interruptions are just long enough to break my attention causing me to go check email or something else, which is another 5 minutes lost.

If I do 500 iterations per month and lose an average of 5 minutes each time over what it would have otherwise cost me, that’s 41 hours or an entire week lost.

I think the problem is actually worse than that though simply based on experience. When I first wrote my distributed object system, I didn’t write a very comprehensive test bed. Instead, I wanted to try it out in the game in a live enviroment. Big mistake. Over two weeks I barely got anything done. So, fed up with how much time I was wasting, I spent a few hours to write a full test bed and fixed every problem in the system in one day.

I think the mistake with most game engine development is that people put too much in the game engine and not enough in the components (graphics, sound engine, network engine). As a result, when others have to work on the game they are practically paralzyed by the load and build times. It’s understandable because it’s very hard to program in general and easy to program in specifics. So the more you put in your module the harder it is to account for all the possible permutations. For example, my distributed object system only replicates object creation, destruction, and memory synchronization. Yet it’s a huge amount of code relative to what it does that is by far the hardest component to use in my engine. Still, in my opinion it was worthwhile to do this because now I have a module that can be used by any game, can be debugged outside the game, and doesn’t increase load or build times.

I would someday like to see what a game engine would look like if all the components were very powerful, modular, and totally game independent such as RakNet.

Leave a Reply

Your email address will not be published. Required fields are marked *