Star Apocalypse is the reinvention of the 4X genre. The game is a real time game of intergalactic civilization, using the computation power of modern computers to run advanced simulations on cultural, technological and societal interaction and development.
The first phase of gameplay code is well underway! First thing to tackle was unit movement. Read along here to check out how I've done it.
Posted by dirtbag007 on Jun 12th, 2010
Welcome to this update.
I've been working on unit movement now. This is a major problem to tackle, but there's a very easy solution for it.
Unit movement is important for any RTS game (with the odd exception of some tower defense games). Any mobile unit is required to move. If you do it right, you will have excellent unit movement, but if you do it wrong, you can seriously make a game unbearable for many hardware setups.
The first thing to do is to look up some literature or tutorials about the subject. I've used Riemer's Angle to Direction and Direction to Angle tutorials to provide a basic guide to get it working. I used several parts of the code he supplied, like the transformation matrix.
The code is supplied here:
That isn't much code, but it's critical. The trick to performance is keeping your code compact and efficiënt, and this code does that. You can check out the video how smoothly the game runs.
So far, I've spent about 8-9 hours programming on this entire engine, spread over 2 months. As you can see, I'm a very casual programmer. Including studying, this would be 23 hours. Casual programming works the best for me, so I'll continue down this line.
I will also add a download of the entire code plus installer (I prefer that you'll use the code instead of the installer in the publish folder).
Here's a video of the unit movement prototype:
Unit Movement Demonstration video - Star Apocalypse Game - Mod DB
Next steps will be to add mouse support, so you can really give orders to units!
Till the next time,