MAN. OH. MAN.
I think I figured out why I'm having such a hard time staying up at night to work on this game - Because coding is so boring! There's been a few instances where I've wanted to take a break from the AI work and just work on more animations and backgrounds, but I've had to keep reminding myself that animating and illustrating is what put me in such a rut the last time I tried making this game. Sooner or later I have to tackle the code, so there's no use worrying about the art side of it. The good news is that once the code is done, I can add as many background and illustrations and characters as I want, they'll all run on the same logic.
In my last post I talked about how I needed to tweak my Defense AI, and tweak it I have. I think I'm at a good place for an easy difficulty, so for now I'm moving on to the offense, and luckily I've made some progress.
The defense logic was pretty simple, all I had to do was run a list of responses for the CPU to randomly choose from every time my player made an attack. Offense on the other hand is a little trickier. It's a function that is continuously looping throughout the match, and computers can run through code very quickly, so I had to create timers to space out the computer's attacks. For an easy difficulty, I have the computer waiting about a second before it decides if it's even going to attack at all, once it makes it decision, it then has to choose whether it's going to use a heavy attack or a light attack (I haven't even gotten into throws and special moves yet). Once it makes its attack, it then runs through the sequence again. This makes for a good easy difficulty because there's a good chance the computer won't attack at all, let alone a series of attacks at once... But it is still in the realm of possibilities because random is still random. In addition to the offense timing, etc, I have it set so that it won't attack unless the player is in range.
I just know real developers are out there reading this and laughing at me... who am I kidding, nobody reads this. Trust me, real developers, to somebody who has no idea what he's doing, these are big accomplishments and they take forever!
Per usual, here's a video of progress that will make no sense to anybody not familiar with this blog:
Maybe in the future I should spice up these videos with some music... Meh.
Next steps... This week I'll start getting into the real meat of that Offense logic, then once that's finished I'll start screwing around with hit detection. The fun never stops!
You could say the logic is... Offensive! Bahahahahahahaha- Shut up.