- Compile times
- Restarting the game (i.e. you're not in the middle of that battle anymore)
I want to try and mitigate these slow downs so I can make my prototyping more rapid, and that's what my question is all about. I've come up with the following list of things (some inspired by Hodgman's awesome post) that can help with rapid prototyping:
- Dynamic configuration variable values
- XML file has various values (i.e. update rate, gravity vector, etc.). This XML file can be watched for changes, and reloaded if necessary.
- XML file has various values (i.e. update rate, gravity vector, etc.). This XML file can be watched for changes, and reloaded if necessary.
- In my hasty programming, I hardcoded things I normally wouldn't hardcode, like the Kraken's tentacle length or base tentacle size. These content files are kind of like the one file talked about above, but more specific and less global. They can also be things like a map file, or a texture image. Just things that aren't hardcoded. I can watch for changes in these files and reload if necessary.
Now my two big questions are:
- How can I reduce compile times?
- I know there isn't a silver bullet for this, but there are some things that need to be tweaked (like behavior or steering algorithms, where a small change in the algorithm (not just a change in a variable) can have a noticeable effect) until they're just right. It sucks recompiling (mostly because or relinking) for tiny algorithmic changes. I've thought of using scripting languages, but that leads into my next question:
- I know there isn't a silver bullet for this, but there are some things that need to be tweaked (like behavior or steering algorithms, where a small change in the algorithm (not just a change in a variable) can have a noticeable effect) until they're just right. It sucks recompiling (mostly because or relinking) for tiny algorithmic changes. I've thought of using scripting languages, but that leads into my next question:
- Nobody likes replaying the first 10 seconds (or more) of the game every time the recompile. Whether I'm using scripting languages or reloading a map or character file, how can I save state the best? The only thing I've really come up with is making every object serializable, and then saving the game as a whole in a file (kind of like saving a game like you normally would, but more verbose so things like menus and stuff can be reloaded if you're working on the menus, for example). Is that overkill?
- I'm not sure how to preserve the state of things that change. Oxymoron, I know; let me explain. Basically, I might make a change to some object that affects a portion of it, but not all of it. Is it worthwhile trying to preserve the part that didn't change (assuming that doing so wouldn't put the object in an invalid/corrupt state), or is that just too much of a pain the butt?
I know, I basically just described Lisp, Lua, Python, Ruby, etc with some of the things above. And I'm seriously going to start looking at integrating a dynamic scripting language in my future C++ games (one reason I haven't gotten around to doing so yet is because I love my Visual Studio C++ debugger, and mixing C++ with a scripting language just doesn't sound fun to debug; but I'm going to get over that, don't worry).
But in addition to that, are there any advices you have for rapid prototyping when developing a game (particularly when the primary language is C, C++, or any other non-dynamic language)? Any advices on clean/beautiful ways to integrate scripting languages (it's one thing to integrate a scripting language; it's another thing to do it well). Because I'd love to hear them.