Day Two Summary
Day 2: Morning
Taking stock of things the next morning: what I’d made so far didn’t do much of anything. I had about 18 hours left to change that. Day two of LD is when you feel the pressure, and where you realise you need to cut corners!
Day two began by writing the combat system, and making sure I kept it super simple: Projectiles, Attack Cooldown, Hitpoints, Damage, Death. Units could now attack, and follow their attack orders. This felt like a monumental bit of progress!
I decided against drawing projectiles. Having to make those projectile sprites, and render them, including rotating the rangers’ arrows to fly in the right direction — it just felt like it would be unnecessary work, when projectiles could be represented by particles instead. I was planning to add a particle system anyway, to represent units’ bloody deaths, smoke from the cannons, and the sorceress’ fireballs. All projectiles could be done with the particle system to keep things simpler. But that was a task for later in the day…
Day 2: Afternoon
Before doing particles I wanted to get something more urgent out of the way: to make the buildings functional. I needed to be being able to purchase units and upgrades.
Normally in RTS games, it takes time to “train” units. But if I did it this way, it would have meant attaching timers to buildings; keeping track of cost and food usage during training; being able to cancel training and recoup costs; having a progress bar in the HUD; and what happens if a building is destroyed while something is being trained? and how will units in the process of being trained be seen by the CPU AI? etc etc… Too much to implement! So to simplify things I decided that all purchases would be instant. Another corner cut.
The particle system came after this, adding blood and smoke and fire effects. Then adding sound effects to the combat.
Throughout the day I had been expanding the stats of the different character classes too. Giving them each unique values for hitpoints, damage, attack cooldown, movement speed, etc.
Day 2: Evening
Writing the CPU AI was a big task that both excited me and terrified me! For if I failed at this, then the game would not be a challenge. Having thought about RTS AIs previously, I had a fair idea how I was going to do this.
I was actually surprised how quick the AI was to code, and how effective it was! The computer played me at my own game, and it won!
Day 2: Night
As it came into the last few hours, my game was coming together nicely. It had a lot of rough corners, a few bits that didn’t work right, and there were features that I knew I wouldn’t have time to add, but the basic game was there, and it had an AI that beat me once!
I knew there was no time left to add any more big features. No time to add base construction, sadly. I spent much of the remaining time making the game presentable, and fixing some annoying bugs:
- There were random units that wouldn’t die. — Wrong limits in clean-up function.
- There were idle units that suddenly decided to go for a walk to the top of the screen — An Auto-attack sometimes failed to expire, despite the targeted unit having died.
- Getting command buttons when selecting enemy units — Required an ownership check.
- The command buttons sometimes going wrong if a selected unit died — Need to rebuild the command buttons when a selected unit dies.
- Other stuff like this
I did have time to add a handful of small things however, including:
- HP bars, toggled with the caps-lock key.
- Casting orders for the sorceress and cleric, although only two of the six spells were added.
- Began adding keyboard shortcuts for orders, although only time to do the main attack/move orders.
- Made a little title screen using the (otherwise unused) harvesting animation for the worker pigs.
- Tweaked the costs+stats of the character classes, to make the game better balanced, and rearranged the buildings more logically.
And that was my Ludum Dare 29 weekend!