It’s been a busy week. According to Perforce, I’ve
- finished converting server code from TorqueScript to C++
- finished converting building marker (client) code to C++
- got C++ RPC commands working
- allowed for a variable # of AI players
- made buildings solid (units can no longer walk thru them)
- made units pathfind around buildings
- made buildings destroyable
- made workers handle when their base gets destroyed
- made workers move out of the way when told to build on their current tile
- fixed a number of issues involving building in crowded areas
- allowed a player to order soldiers to attack specific targets (including the player’s own units and buildings - handy for testing)
- did some LAN client/server testing
- made the join-game screen scan for LAN servers on startup
- fixed a crash on player/client disconnect
- made the disconnected player’s team convert to an AI team on the fly
- started experimenting with putting fire on damaged buildings
I feel like I’ve made a lot of progress. As far as I know, there is now only one crash left in the game. That is when a unit or building dies while it is still in a player’s selection set (i.e., the selection rings). In that case the selection set can contain a stale pointer and cause a crash. It is a little work to fix this because the selection set is contained on both the client and the server, so there is some networking involved. But other than that, I think all other object references get cleaned up properly when objects die.Which is good, because stale pointers were one of my concerns about converting to C++. As it turned out, in most cases a “dying” object knows who is keeping a pointer to itself. So cleaning up stale pointers is just a matter of making the object’s destructor notify the interested parties about its death. In the other cases, a SimObject ID can be used instead of an object pointer. When you have a SimObject ID, you can ask Torque whether or not an object is alive, before using the object. SimObject IDs do not go stale in the same way pointers do.
I feel like things are shaping up reasonably well for this game. My project strategy is to first
- implement the basic mechanics of an RTS, and get a feel for those
- get a feel for the Torque game engine
Then, once I have a reasonable idea about what’s easy to implement and what’s not, I’ll take a step back and decide the creative direction of this game. I have a lot of ideas for what could go into this game, but they all have to be filtered against development effort.The creative design stage is where the real fun begins. That’s when the game will take on its unique personality, as something that other human beings will hopefully enjoy. I think all game designers like that stage, because we all like creativity. At that point, you can probably expect all the artwork in the game to get swapped out for new artwork, and it will look and feel quite different.
I think am getting fairly near that milestone. I would still like better understanding of Torque’s animations, finer control over unit movement, finer control over Torque’s collision model, knowledge of what’s involved in programmatically generating Torque’s terrains, and a better understanding of RTS network optimizations.