Today was a pretty exciting day! Work covered a lot of ground, including testing and bug-fixing of AI, random-number generators, and some new moves.
Much of the morning was spent hammering out major dents in the AI code, and it started working much better. There were some bugs that caused chaotic behavior yesterday, and I was a little disheartened.
After a morning of squaring away AI and battle bugs, I managed to get a bit of testing done. The available moves are still pretty basic, but I'm able to tweak the AI based on behavior in battle. Here's a shot of a battle with a looter today:
Oh no you didn't!
In this case, a looter decided to get brave and came at me. So I whacked him with a crowbar, injuring him, and he decided to run.
I did quite a lot of revising of the AI code today. Cameron's feedback on the initial draft had a lot of good ideas, so I rolled many of those into the new AI code.
One of the big changes is better threat assessment. Cameron found a good way to describe a creature's current confidence vs. a target numerically. It incorporates values for both the AI and target's current wounds, wielded weapon, battle conditions (like fallen or stunned), visibility, per-creature morale (brave vs. cowardly creatures), and a range of other factors.
I got the AI decision code hooked up to actual moves today! That was a pretty big step, as I could actually test out how combat feels, instead of guessing.
So far, I think it's moving in the right direction. I had a few moments where the AI surprised me, and made me smile. My very first encounter was with a dogman, and I charged it full-tilt, and it actually ran away.
I did a lot of restructuring today. I originally planned on getting the AI up and running in battle, but ran into a snag. The way NEO Scavengers turn-order is setup caused some weirdness. Plus, conditions (like "recently moved") had a minimum duration of 1 hour, which meant it would last several battle turns (which are currently a small fraction of an hour).
So I had to change the turn-order, and that meant some architecture changes. I also had to change the data format for conditions to support fractions of hours.
I made a pretty big change to the underlying architecture for combat today. As mentioned yesterday, I decided to move battles into their own class, so that the player's UI only displays battle info, and the battle manages itself. Now, each hex can have a battle, but only the one the player has joined is displayed in the UI.
I also reworked the player's options so they're easier to handle in-game. My early prototype had a growing tangle of if/else and switch statements to handle all the special cases of combat (checking range, visibility, cover, etc.).
We just got back from our trip last night, and I had a productive first day back at work. I was able to make a number of changes to the new combat system, though I don't have much to show for it. It still looks pretty much like last week's screenshot.
However, I was able to get most of the basic maneuvers working for the player, including advancing/falling back, running forward/back, attacking, improving cover, and retreating from battle.