Aller au contenu

Photo

Morale check during triggered encounter


  • Veuillez vous connecter pour répondre
10 réponses à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 507 messages
I've got encounters scripted up so that they will track the spawned enemy's losses suffered by the end of each heartbeat. What I want to do is make a morale check to see if the opponent "breaks" once they start to suffer heavy casualties. (Kind of like they did in the old Baldur's Gate series.) It could use some sort of weighted test with higher level enemies carrying more weight. A Willpower check will be made with suitable modifiers; success means the opponent keeps fighting, while a fail may mean the opponent goes into defensive mode or, if the creature's hit point total is low, flee the scene. Alternatively, the shaken opponent could rally by running toward the nearest leader.

I haven't quite worked out all the details yet, but I was looking for feedback and advice. Any thoughts or ideas? :)

Modifié par rjshae, 23 juillet 2012 - 03:11 .


#2
kevL

kevL
  • Members
  • 4 075 messages
quantum mechanics for monsters, i like it

#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
I manage all that with a pretty complicated AI system sprawled out over the heartbeat, death, damaged, attacked, and perception scripts, but I think you might be able to something simpler for each encounter.

Maybe set up an i-point with each encounter with a heartbeat script. When you spawn your encounter monsters, add another little script at the death script hook (local string, sDeathScript, I think), and add the i-point as a local object. Then add the creature to the i-point as a local object in a pseudo-array.

When a creature dies, the hook script checks a few variables on the i-point, and does your morale checks, and then sets some variables on the i-point for the i-point's heartbeat script. On that HB script, you cycle through each creature in the pseudo array and give them commands (run away, run to waypoint, run to leader, etc). I've taken to repeating these commands with a delay, to make the action more fluid (i.e. do now, do in 2.0 seconds, do in 4.0 seconds, then wait for next heartbeat). You might want to put some sort of timer in the heartbeat script, too, to shut itself off.

If you haven't, you should play around with the Danaan Tactics mini-mod I dumped in the script section of the Vault and the Nexus, to get a feel for the different kind of battle flow, and how you want to do things differently.

#4
rjshae

rjshae
  • Members
  • 4 507 messages
Thanks Lugiad. Is there a reason why you run the heartbeat from an Ipoint rather than from the encounter object? Looks like I'll need to do some reworking of the AI for this.

In looking at the AI code, I decided I could use the GetRawThreatRating routine from the hench_i0_generic file to determine a morale weight for each encounter creature. However, in looking at that routine, it occurs to me that it could be refined some more. For example, creatures with levels in animal, humanoid, ooze or vermin classes tend to have a lower CR than their number of Hit Dice, compared to player classes, for example. Giving a lower weight to wimpy classes would give a more realistic result. That would have the side benefit of making the combat AI more realistic.

Modifié par rjshae, 23 juillet 2012 - 01:21 .


#5
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
The i-point is just a place to hang a heartbeat script and some variables. I thought the trigger HB only fired while something was in it.

#6
rjshae

rjshae
  • Members
  • 4 507 messages

Lugaid of the Red Stripes wrote...

The i-point is just a place to hang a heartbeat script and some variables. I thought the trigger HB only fired while something was in it.


Ah, okay. That makes sense then. Thanks.

#7
rjshae

rjshae
  • Members
  • 4 507 messages
The group morale tracker seems to be working as I want it now. Basically, after the enemy has suffered at least a 1/3 reduction in their threat rating, the heartbeat script compares the enemy threat rating to the party threat rating. While the party is double the threat rating of the enemy, they start making individual morale checks. So it's the individual morale check I'd like to work out now.

The group check results in a base DC value. I'm thinking the individual moral checker takes this DC value and does the following:

* Exit if dying, immune to fear, held, paralyzed, charmed, dominated, or confused.
* Exit if immune to mental effects:i.e. a construct, ooze, plant, undead, or a vermin.
* Check if target recovers from a prior morale failure; individual recovery DC decreases each round.
* The individual DC is increased based on the target's hit point losses by up to +4.
* DC is increased by +2 for each time the morale check has returned a non-steady result.
* The DC is significantly reduced if the enemy is undergoing rage or frenzy, or is invisible, or hidden.

Now the morale check is made and the result can be one of four states:

* Morale is steady and there is no change in status.
* Morale is weakened. The target is set to use Defensive and Ranged combat states, per x0_i0_combat.
* Morale is crumbling. The target is set to the Cowardly combat state.
* Morale is shattered. The target surrenders, drops its loot, and is destroyed.

Does this seem like a reasonable approach? Is there anything obvious I missed? :happy:

Thank you.

Modifié par rjshae, 25 juillet 2012 - 03:59 .


#8
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
You might want to think about how different spells and abilities could affect the morale of enemies. For example, I tried to use the will save in some calculations so that a hit to will could cause enemies to rout faster.

I also keep a separate variable on all the blueprints that measure the creature's base morale, or how quickly they will run in a fight. So well-trained veterans will fight longer than low-level conscripts, animals will flee as soon as they're wounded, and some desperate creatures fight to the death.

I think your overall goal has to be to make different encounters feel more different (i.e. cowardly goblins vs. more aggressive orcs), and to give the player new ways to deal with an encounter (i.e. kill the leaders first, creative use of spells). Ultimately, your system should reflect something important about how your game world works, and the particular character of your creatures and characters.

#9
rjshae

rjshae
  • Members
  • 4 507 messages
Yep, I've included some of that. The encounter has a morale_modifier variable that adjusts the group's modifier checks. The threat rating is modified based on the monster type; animals and humanoids have a lower threat rating than aberrations and dragons. The morale check is based on a WIllpower save, so a Will or Wisdom lowering effect should make an opponent more likely to rout. Maybe I should add a variable to list the tag of the leader monsters, then give those creatures a better Will save and a higher "threat" rating?

#10
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
It might be good to have a tweak variable on the blueprint that doesn't have anything to do with the rest of the character sheet, so you can fine-tune your adjustments later on, but it seems your approach is to make the system applicable to stock, unmodified blueprints, so maybe you shouldn't worry too much about the leader tags and other details, and save that for the runtime of your encounter script.

Each encounter might end up having a particular setting, as the tactical and strategic situation varies. Goblins ambushing a lone traveling party might run as soon as the party proves dangerous, but the same goblins might fight to the death if the same party starts crawling through their caverns.

#11
rjshae

rjshae
  • Members
  • 4 507 messages
Yes, I agree it needs to be tunable to the circumstances and on a per-creature basis. I have been making a few squad-leader type creatures, but mostly its variation based on weapons, shields and appearance. There are also higher level elite types that should definitely have better morale, and a home base or two that should firm up the resolve.

After some experimentation, I'm starting to think that I should use some type of individual morale counter mechanism that gets updated round by round. That would cause the morale failure to last for a period, gradually compensate for changes in the battle, and allow for a cool-down once the creature is out of range. Maybe the Willpower check will be to see how big the modifier to the counter will be.

Modifié par rjshae, 26 juillet 2012 - 09:12 .