Chewing the Fat
Today was all about ironing-out the issues in the NPC conversation feature. While basic functionality seemed to work in yesterday's tests, there were several edge cases that needed to be fixed.
For example, what if the player offers to talk and the target leaves battle? That offer needs to be cleared so the next meeting launches battle normally.
Or, what if the player and target both offer at the same time? Technically, the game only started conversations if one person offered and the other agreed, so I needed special case handling for double-offers.
What if the player offers to talk, the target doesn't talk, but doesn't fight, and another AI decides to talk? Seems like this should also start a conversation.
In the end, I made a few adjustments to make my life easier. One of the bigger changes was to make the "offer to talk" and "offer ceasefire" moves cause the "distracted" condition. It's sort of like "recovering" or "stunned." It lasts one turn, and it means anyone trying to ceasefire or talk gives up their next turn while they wait for a reply.
It's not perfectly realistic, but a necessary rule to make it easier to keep track of things. Plus, it adds some risk to those moves, so players can't just spam it every turn without worrying. If you're gonna talk, put that weapon down, and act civil. But better be sure your target isn't going to take advantage :)
One other change I added was the ability to right-click on a creature to restart a battle if you're in the same hex:
After things like conversations and ceasefires, you're in the same hex as other creatures with no battle triggered. And if you leave and return to the same hex, there's still no battle (ceasefire/talk conditions remain until "end turn.")
With this change, users can right-click on a creature and click "engage" to restart a battle. You don't have to fight, and there's no penalty for doing this. It just gives you a chance to use battle moves on the target(s) if you decide you actually want to fight them after all. You can also offer to talk with them again, or ceasefire.
There are still a few details I need to sort out. I need to make sure clicking outside the "engage" button doesn't trigger player hex movement, and some conversations can end abruptly if no choice is made.
Also, I'm thinking I might make "talk" only available at short range. You can offer ceasefire to anyone who sees you, but you have to take a bigger risk if you want to talk.
That's all on the to-do list for Monday. Right now, it's Friday. It's dinner time. And I could use a weekend to rest!
Have a good one, all, and see you Monday!