AI Fixes, Battle Issues
Players are continuing to discover bugs in 0.983, so it looks like it had more problems than initially thought. Fortunately, there are some good repro steps and save games for me to work with!
One of the first issues fixed today was a crash bug when the player escaped a battle with 2 or more NPCs. The leftover NPCs were still targeting the player, causing a null pointer when doing visibility calculations. Similarly, the escaping player would screw up AI in the leftover battle, causing the AI to turn on its allies. These should be fixed in the next build.
There was also a bug where AI would attack targets that it wanted to be passive towards because the target wasn't conscious. Basically, it had no valid passive moves toward unconscious targets. I've set this to fall-back on retreat moves if it happens again.
The "Stranger" moniker was not changing as a result of battle actions, and this was due to a typo on my part. I fixed the typo, and also updated it so that any move which changes faction standings identifies the creature (rather than just attack and talk). It seemed sensible that if the faction standings change, then we know who we're dealing with :)
I adjusted the SBS4/military shotgun artwork to be a bit bigger, so it's in-line with the other guns in the game. It's still shorter than a traditional shotgun, but it should no longer look miniature.
There was a bug in the AI which prevented it from switching to a melee attack mode when at grapple range (range 0). At range 0, ranged attacks are not available due to interference from the target, and AI was still trying to choose it (since it was the most powerful). This resulted in AI randomly choosing moves since no attacks were available. Players who beat on DMC Guards while they offered to talk ran into this issue.
I updated battle to clean up certain moves when done, such as offers to surrender, ceasefire, and talk, so the next battle wouldn't leave those options open during the first turn.
There was a bug in the battle UI that caused creature sprites to get mixed up when one creature left. This might be the cause of the "creatures trade weapons" issue we've been seeing.
Finally, there were two AI bugs that caused it not to consider range when gauging threats, as well as running away from creatures if no faction reputation existed yet. These should also be fixed in the next build.
I got a lot done today, but one of the bigger problems still remains: how to make talking and ceasefire more intuitive. These fixes should make the existing system a bit more intuitive and consistent, but I still need to think about it a bit.
Just so you're aware, I need to run into town tomorrow to return the power supply I didn't need. So I'll be out of the office for a bit. I expect to be back later in the day, though. If I seem quiet tomorrow, that's why!
Have a good night, all!