Sprites Done, Moving On To Non-Hostiles

After a few more tweaks this morning, I got the creature sprites finished and updating correctly. There was a small issue of draw order with some slots, and I needed a way to update mid-battle, but all seems to be working now!

Next up: non-hostiles. Originally, I was going to start on dynamic creature names. E.g. bandits first appear as "stranger" (thanks, Malacodor!) until being identified. However, I had some questions about what constitutes "identified." Does the NPC say "I am a bandit?" Do we assume they're a bandit because they attacked? There's something at work here, and I'm not sure yet how to model it.

So instead, I decided to turn towards non-hostile interactions. One of the first building blocks here is to halt combat so creatures can exist in the same hex without being in battle. Doing this allows us to move freely from the hex, start encounters (e.g. have a conversation) without reverting to battle, and even re-enter battle if someone else enters the hex.

So far, this wasn't hard to do. I setup a test battlemove for "talk" which exits battle. I had to tweak a few things so battle didn't start right up again, but I can now enter and exit 1v1 battle at will.

If there are more than 2 people in battle, however, things get tricky. Does battle just keep going until everyone agrees to talk? Should this work like surrender, where one combatant suggests talking, and everyone is presented with the option to agree? Should everyone be forced to choose yes/no before continuing the battle? What about feigning peace and tricking the opponent into disarming?

So far, the idea of one person kicking-off talks with a request seems simplest. Then, everyone in the battle only has responses to the talk request their next turn, so we can see who wants to talk, and who doesn't. There's a possibility that this opens up cheating via spamming talk requests, so maybe I need to have a "cooldown" on such requests if they fail the first time.

The other tricky thing here is the AI's decision-making process. So far, attack/retreat/hold position are the three modes AI chooses between when in battle. They go through a pretty complex threat assessment to arrive at this choice, based on their condition and that of other combatants.

How does talking fit into this assessment? What makes AI decide talking is a good idea or bad? And more to the point, what makes it better than attacking or retreating? This will require some thinking.

I did get an interesting idea for faction relations while I was working. It seems like I can pretty easily setup a look-up table for each creature that says what their relationship is to each faction, and change those values based on events in the game. This way, creatures can develop a hatred for former allies if there are enough abuses, or form truces. I could also make certain encounters change these values. And it wouldn't be too hard for AI to share this info with other AI it encounters, so we have a sort of viral propagation of love/hate.

It's a lot to chew on, so haven't started coding yet. It'll be good to come back to these ideas tomorrow with a fresh perspective, and see if they're still worth trying.

Have a good one, all!


Kaaven's picture

So far this whole idea looks better and better with each day passing.

Random thought on the subject:
If I remember correctly, right now the NPCs follow an Alpha guy when travelling in groups, right? So in this new system, if the player meets with a group of NPCs from the same faction, the leader alone should decide whenever to talk or fight and his henchmen should follow. That would cover like, good 70% of all the "player vs. group of NPCs" encounters, and would make those situations much easier to handle / less random (as only leader's stats would count).

And in the matter of naming: enemies should be named as what the player recognizes them as, not by their faction, because:
a)player might not know about the faction
b)they might lie
c)why would they tell him that anyway ("Hello, I'm Johnny and I am a raider from Bad Muthas cannibals" ?!?) - it only makes sense for DMC Guards.

So, optimal way could be to have a double-layered identification: all are "Stranger" until interaction, then a "Traveller" if the guy is peaceful, or a "Bandit" if the guy is aggressive.
Finally, when player gets actually introduced (properly) to the faction, they become "Bad Mutahs Raider", "Martha's Army Travelling Merchant" or "SkyCorps Guard" or whatever.

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Cryovisitor's picture

Methinks talk should be a one-and-done option. If they weren't going to talk before, what's the chance that they will talk now that you put a bullet in their shoulder? Or after they smashed your kneecap with their flashlight? Or now that they see that you're a wuss and are trying to chicken away from a fight? Or perhaps, now that you've been chasing them for five minutes? Nay, I say. Not good at all.

Melvarius's picture

How about not starting combat when entering the same hex as another unit unless that unit is hostile. Then you could press a button to talk or fight for free (like the scavenger button).

~The Pirate

Malacodor's picture

"Stranger" was Kaaven's idea!

Ran around with a clown mask before it was cool

dcfedor's picture

Whoops! Sorry, Kaaven!

Having the leader decide makes sense to me. I'll have to see if the code makes that easy or not. And I like the idea of leaving all NPCs named something ambiguous until otherwise told. So everyone is a "Stranger" unless you have an encounter with them that names them. We could probably just have "hostile" or "friendly" prepended to "stranger" once they take a hostile or friendly action.

And yeah, it makes sense if "talk" is a one-shot move. Either it works or it doesn't. It might be nice if that move is reserved for a closer range, so it presents more risk of ambush. A long-range version might just be "hail" or "ignore." "Hail" means the person comes in peace, but still has distance to reach you, and will likely advance slowly. "Ignore" means they try to leave battle, and if you "ignore" too, battle is over.

That would leave the slow approach until close enough to "talk" or "trade," or in some cases, "tackle" or "melee surge."

Re: not starting combat when entering a hex, I actually thought about this, but it turned out to be a big can of worms. Getting battles to work correctly was pretty difficult, and I'm afraid to wake that sleeping dog :)

I'm hoping it'll be just as effective to start battle automatically, and have "talk" vs. "fight" for options then, which either continues or halts the battle.

Thanks for the help, guys!

Dan Fedor - Founder, Blue Bottle Games