This last couple of weeks has been yet another solid reminder of what difficulty AI, animation and physics is. I noticed people saying this about sports games when I started the project, but really now understand it. As they said back then, if I just made game X, Y or Z, there would be so much less AI, so much less crazy animation combinations, etc, etc. Yes, I once again had a really tough time of it getting through various crazy bugs and conditions. Since I had many repeated issues, I'll mention the high repeat ones:
- Attaching AI script files to avatars. My AI is built script by script, so rather than a mega AI script, I have one for contesting the ball, one for getting to a contest, one for leading, etc, etc. One of the biggest problems I keep running into is I just haven't added a script to the player avatar. It starts off with watching the AI do something really silly, and thinking I have to fix that. Then I try to work through the script logic, seems like it should be doing the right thing. Perhaps the entry logic is incorrect and the logic never gets run? No that looks OK. Finally, when I can't give a single reason the logic isn't firing, I realise the script isn't attached, therefore not even running! It's the easiest thing in the world to fix, yet has alluded me probably a dozen times and caused a lot of wasted dev hours.
- Floating targets. Leaving physics to Unity does some weird things that aren't game friendly, so early on I decided to tackle it myself, but doing it yourself is a major pain too. One of the issues I constantly stumble on is players floating away or falling through the earth. There is nothing that takes you out of the game quicker than seeing someone runs towards a spot 2m above the ground, or sinking through the earth, or someone rotating on a 45 degree angle to the earth (eg they should fall over doing this). I have little of this happening right now, though I've had to temporarily disable bumping, which I really want back in, so more work to happen, eg what do I do when someone is bumped mid jump, they need to still land again (currently they idle in mid air)
- Timing a target. I knew this would be painful. The ball is flying in using gravity etc, and we need to jump to meet it. At first I programmed it to just mark if the radius is close and we are closest, but lately I got a real trigger working on the players hands, where they only marked it if their hand got to it first. This works pretty well now, but was a huge effort and is still not 100% yet. When it works, it is very impressive however.
So, with the deadline done, was I just a few bugs short? Not really. Every day has feel like 1 step forward 2 steps back recently, and it's worn me down too. As an example, in October, I could mark a ball, go back to kick at goal, and go to the next play after kicking a goal, with the score ending up on the scoreboard. It was rough and buggy, but all that worked. In the last few weeks, I have struggled getting a mark. I have broken and just recently fixed the ability to get back to kick a goal. I have broken and just fixed the ability to have another play after the first. I have broken, and is still broken, the ability to even kick a goal, though to be fair, this is a new game mechanic I've been working on. And then there were bugs! Finally by the deadline, I had patched most pieces together, and to be honest, most stuff is coded pretty well, so I should be in a good position to use this code as a base, not retrofit 90% of code after beta release. I have a few fluffy things to finish off with, like celebrations, crowd, umpires, but even some of this I've been working on.
I could probably get the beta "finished" by the weekend, but I'm giving myself another half a week to add a few features I really wanted from day one. The game itself won't have any content outside of playing, so I want the beta to feel a little more than I just got something working, I want it to feel like my game. A couple of the features I've really looked forward to adding is AI around celebrations or crowd, where the players react more real depending on the situation. It's annoying to play a sport game and see someone do a massive celebration 10 goals behind in the last quarter, or the commentator get excited, eg. in that exact situation commentator AI should be choosing between things like "a small ray of sunlight on an otherwise gloomy afternoon" or "that's not going to affect the result today." But instead they say things like "he's just really firing today," completely out of context for the game. Or even better (and with unlimited time to code a commentator AI), it would take into account things like the season. "That won't change the result... but percentages are very important late in the season and being in the mix for finals" or "that won't change the result, but they'll want to get a bit closer to make sure this result doesn't ruin the start of their season."
My point is, I don't want to be putting out a product that just barely gets the job done, I need to build some strengths where I can, and hopefully add something positive to the playing experience.
So now that I've breached my November deadline, I'll add roughly a week on until I reach the objective of be able to play a basic game with minimal bugs, and perhaps a few nice extras in the game play that aren't yet. I'm still going to push hard to have that done by Wednesday 7th December.