What I did
First off was setting some limits on the team size. Now you can’t have a team smaller than 1, or larger than 8. I might change that later, but that’ll happen later when I have the combat fleshed out enough to start fine-tuning the balance. You can also change the sprite of your team members. I was going to let you select an image from your computer and use that, but it turned out that Unity doesn’t supply an in-built way to let you browse your computer for files. So I ended up throwing together a quick gallery of faces to choose from. I’ll have to come back to this later and figure out how to allow people to use their own images without much work. That’s a “would be nice” feature though.
Team and team member data is now saved to and loaded from disk when changes are made to it. It saves each team to a separate file and is fairly easy to cheat by editing the files manually. Granted there’s not much advantage in doing that right now as you can do the same things by using the in-game team manager. Another thing I’ll take a look at fixing up much further down the line.
On the world map front I’ve made a few changes. You can now only attack territories which border your own, which means you have to select one of your own territories to attack from too. I’ve hard-coded which territories you can attack from for now, which I’m not entirely happy with. I’m not sure what solution would work better though, other than storing it all in an XML file. I could do something based on the distance between hexes, but I don’t want to have the art start affecting the gameplay. I’ll put this on the backburner to look at again later. Also, I’ve made sure that when a battle’s over the losing team’s territory will be passed to the winner.
Each battle now ends with a battle results screen, which lists the characters in each team and the damage they took, damage inflicted, and have many killed. There’s plenty of room for improvement here but most of this can wait until I’ve fleshed out character progression, which will clarify what sort of data is important to show off.
I managed to fix both the annoying bugs that cropped up a couple of sprints back. The first one is the health bars disappearing, I spent a couple of afternoons trying to figure out what was wrong with this, reaching some sort of success by changing the renderer sorting layer’s during runtime (didn’t work if I set it in the editor). Eventually I decided to upgrade Unity and the issue went away. Turns out it was a Unity bug that must’ve crept in when I upgraded in the past… The other bug was a bit more devious. It was happening seemingly at random and thought there there was no-one in the first team even though the check didn’t happen until after they’d been generated. Looking at the logs the people had definitely been spawned but it still thought they were dead. A little more digging and it looks like my IsAlive check was to blame, as it always returned false until the CurrentHealth was set partway through the internal setup work for each character. A simple enough race condition issue to fix, but a bit of a devious one to track down.
With everything completed this sprint, I decided to go ahead and release a new tech demo, but at this point it’s starting to turn into a very rough Alpha. I’ll try to release them a bit more often from this point. You can find the current version here.
What I didn’t do
Somehow I managed to get everything done this sprint, so nothing for this section.
What I will do next time
Right now the game is mostly complete, although many areas are still in a slipshod “it’ll do for now” way. But you can start a new game, and attack enemy territories one by one until you’ve taken over the map, so long as you don’t mind seeing the same demo combat area over and over again. There’s also one noticeably outstanding issue, which is the game still needs you to manually control each team. Originally I planned this to be a multiplayer game but it really needs decent AI for the single player mode. Unfortunately I don’t know much about developing AI right now, so this sprint is going to be a bit vague and involve a lot of research and prototyping
First thing to do is find some articles on basic AI theory and practice. I’ll try not to spend too much time on this, but if I don’t understand the basics beforehand then I’ll be making my job that much harder.
Afterwards I’ll start putting together some prototypes. The first one will be getting the AI to move someone to the closest of 3 specific points. Next I’ll do the same, but have them prioritise the slightly further away one which provides cover. Then I’ll do the same, but make them check to make sure the cover will be effective against an existing target. I’m realising that I could make job significantly easier if I replaced my click to move system with a simple grid system. It wouldn’t be what I originally envisioned but it would make this a damn sight easier to get off the ground.
I’ll also try to create another set of prototypes for combat. It won’t be as in depth, but I’ll first make one to target people based on the highest chance to hit. The next can do the same, but will take into account how much damage a target has suffered. Finally, if I have time, I’d like to make another where it looks at which weapon each enemy has and decide who’s the biggest threat. More often than not it’ll be the one closing in with the shotgun.
That should do for this sprint. I’m not certain I’ll get it all done, but it’ll give me plenty of practice either way. Ultimately I’ll combine these ideas into a single opponent who can assess the enemy ahead of time and move into appropriate cover to take out the most dangerous target. That should be fun.
As always you can see the status of my current sprint on my Trello board.
You can also find the current tech demo here.