Aaaaand… it’s broken.

Well, not entirely. But over the last few days I’ve had to completely reorganize and redo huge chunks of code, and each time it’s started as just a minor “well, I need these two animations to be able to play at the same time” sort of thing, and turned into a “861 compiler errors? How is that even possible?” sort of thing.

I’ve got it back to a (mostly) working state, but I think I’m about to do it all over again, because I just realized there are no animations or health bars when it comes to the “happen every turn” status effects (like bleed damage, for instance). The function I created that runs the “start a new turn” function basically resets everything back to normal as far as things like “currently playing an animation,” “waiting on the user to select a target,” and “selecting a weapon to attack with” statuses, but it also runs the upkeep functions for each special status in effect. Some of them are pretty minor, like the one that boosts an ally’s defense, but for something like “on fire,” I need to be able to play a burning animation, show the affected unit’s health bar, change their sprite over to the “just took damage” animation, decrease their health, and then check and see if I need to kill them off or not. And then if they died I need to figure out what to do if it was about to be their turn (or was already their turn).

And again, like usual, this is sort of a mixed bag- on one hand it’s super-frustrating having to keep going back and redo stuff I’ve already done over and over.

On the other hand, it’s really forced me to optimize my code a lot more than I normally would have by now. Optimization is something I’ve typically saved for last, after I know everything actually works, even though I know that goes against every list of “best practices” in the book. But getting rid of superfluous loops and awkwardly-named variables earlier in the process definitely makes the later-on-down-the-road steps a whole lot easier, so I’ll count it as a net gain.

So what do I have left to work on?

  • I’m still tweaking stuff with the “special abilities” in combat, mostly because I’m trying to get them to share code with the “use item” function- they both do exactly the same thing, except the specials have cooldowns per person, and the items are dependent on how many are left in your inventory.
  • I need to refine all the concurrent animation stuff- I thought I had it worked out, but after realizing that I forgot to account for things that happen right at the start of a new turn, I can see that there’s still plenty left to do.
  • I need to implement some sort of in-combat dialogue; I’m hoping I’ll be able to re-use most of the dialogue code I set up in the non-combat scenes. I’m not sure how often I’ll actually use dialogue during a combat sequence, but at the very least it will be necessary during some of the “boss battles.”
  • At the moment, none of the weapons have pop-up descriptions (well, they do, but they’re all blank), only two of the items have names (and only placeholder descriptions), and only a few of the specials actually have any code associated with their DoStart(), DoUpkeep(), and DoEnd() functions. I can’t decide if I want to go ahead and get all the “fleshing out” of the combat stuff done now, or save that for later once I have a better idea of what sorts of weapons, specials, and items will be necessary throughout the course of the game.

And, you know, the whole rest of the game, of course. But for now, I’m just looking forward to getting the combat stuff out of the way so I can start working on the “fun” parts. Next week my wife and I are headed to Borneo for the honeymoon we never got the chance for; I think it will be good to have that forced distance from my game and the obligation to work on it, so long as I can get it to a good stopping point before we leave. There’s nothing worse then having to pick something back up that was in the middle of a major mess.