Morale System

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Morale System

Post by AcadiusLost »

OK, I'm doing another round of improvements to the ACR morale system.

The basics:

Currently, the morale roll is running on each perception event. This can make them fairly frequent at times, and is something we may want to improve upon in the future.

The roll: 2d10, for a range of 2-20.

The score:

Morale rating of the creature + creature CR modifier + damage modifier + outnumber modifier.

So, for an uninjured "rating 8" CR1 orc vs. a single PC, we have:
8+0+0+0 = 8

so any roll on the 2d10 of 9 or greater means the creature will flee. 63% chance.

If there are three orcs instead, against one PC, still with rating "8" each,
8+0+0+2 = 10, for ~53% chance of flight.

Now, remember each orc is rolling this separately, so a 47% chance each of standing and fighting means 0.47*0.47*0.47 = only a ~10% chance that all three will stand ready.

So, currently each one a creature outnumbers the NPCs decreases the odds of flight by 5% or so, likewise for being outnumbered by PCs (decreases by 5% per PC). Outnumbering is calculated based on the number of foes and allies in a 50.0 radius.

Damage to a creature shifts the modifier. If the creature is wounded, but still at 50-75% of it's HP, it gets a -2 (~11% increase in fleeing chance).
25-50% HP means -4 (22% increase in fleeing)

CR of the creature has some effect as well, CR 0.25 or less gets a -2, CR 0.5 is -1, CR 2-4.5 is +1, CR 4.5-7.5 is +2, CR 7.5 or greater is +3

I'm not sure the CR shifting is necessary, since we are already assigning a Morale value to each creature in the toolset, which may take the CR into account.

The largest problems I see with the system at current are:

1. creatures outnumbering the PCs is having only a minor effect.
2. creatures with a morale rating of 11 or less are going to flee 50% of the time, all other things being equal.
3. The 50.0 radius means that creatures are being affected by the presence of allies and enemies considerably beyond their perception range.

My suggestions:

1. Double the bonus to morale for outnumbering PCs (so up by 1 = +2, up by 3 = +6, up by 4 = +8), leave the outnumbered modifiers as-is.
2. bump Morale ratings for creatures into the 11+ range, such that fleeing on sighting a PC is a comparatively rare event.
3. Cut the radius down to 30.0, so fled allies no longer contribute to the calculations.

I'd also add a "less than 25% HP" case which would impose a - 8 penalty.

These should help address the majority of the problems, we can refine it with another pass or two later if necessary.

I'm up for other ideas as well, certainly. Thoughts?
User avatar
hollyfant
Staff Head on a Pike - Standards
Posts: 3481
Joined: Mon Oct 24, 2005 3:33 pm
Location: the Netherworl... lands! I meant the Netherlands.

Post by hollyfant »

Not just outnumbering, but simply having numbers should bolster bravery. Three Orcs should always be braver than a single Orc, regardless of how many foes they face.

Also, is there any way a DM could improve or decrease the fighting mood of creatures?
paazin
Fionn In Disguise
Posts: 3544
Joined: Thu Apr 15, 2004 1:07 am
Location: UTC +2
Contact:

Post by paazin »

hollyfant wrote:Not just outnumbering, but simply having numbers should bolster bravery. Three Orcs should always be braver than a single Orc, regardless of how many foes they face.

Also, is there any way a DM could improve or decrease the fighting mood of creatures?
Indeed, this is one key thing - I sometimes throw one or two "baddies" as a distraction or an advance raiding party, then throw the full brunt at the PCs (or sometimes even buff up a single monster and throw it at them). It'd be nice if I could force them to engage no matter what.
People talk of bestial cruelty, but that's a great injustice and insult to the beasts; a beast can never be so cruel as man, so artistically cruel.
Thangorn
Haste Bear
Posts: 2081
Joined: Fri Oct 01, 2004 1:00 pm
Location: Queenstown, New Zealand

Post by Thangorn »

DMs must be able to remove not just morale but creature AI scripts firing (onspawn events, heartbeat events, etc.).. some widget or DMFI control to set a variable that stops onspawn/hb events would be awesome..

Its a real pain in the arse when you set up an encounter with traps and casters and then all of a sudden the whole scene takes flight.. Any wonder the DMs like using undead :)..

random walking events, etc have always been a thorn in my side in DMing..
On indefinite real life hiatus

[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

I've done some thinking on how to enable DMs to override morale settings, but I'm still not quite sure what would be easiest.

Making the scripts check for a DM-defined variable that overrides any rolls (one way or the other) is fairly trivial, what's more difficult is finding a satisfactory way to make such functionality available to DMs in a way that:

1) allows them to change fight/flight for an individual NPC or group of NPCs, without affecting the entire area (variable radius?)

2) allows morale to be changed fairly quickly (quickslot-able?)

3) allows morale adjustment during a DM session without "breaking" morale for later users of the area without need for a module reset to clear things up.

I might have a go at scripting something along the lines of a DM Wand that deactivates morale (returns creatures to the Fight Till Death default mode) in a 10.0 radius, with some DM message feedback. If that works, we could probably make it's complement, a "Wand of Flight" which makes everything in a 10.0 radius flee. I might be able to work it such that having an active target causes it to affect a single creature instead of the radius as well. I think that would cover most of the intentions above.

Thoughts?

[edit: for the Wand of Flight, we have the potential problem of deciding what the creatures should be running from- normally they have whatever PC who triggered their OnPerception event to flee "away" from. If a DM triggers a "flight" event without a PC in perception range, what should happen? Should the creatures just hang out until they see something to run from? Or should we give them a meta bearing on the nearest enemy (even though it's beyond their perception range) and send them packing? The former is easier, but not sure what the DMs would prefer.]
User avatar
bartleby
Brown Bear
Posts: 276
Joined: Fri Apr 16, 2004 10:01 pm
Location: New York

Post by bartleby »

AcadiusLost wrote:I've done some thinking on how to enable DMs to override morale settings, but I'm still not quite sure what would be easiest.

Making the scripts check for a DM-defined variable that overrides any rolls (one way or the other) is fairly trivial, what's more difficult is finding a satisfactory way to make such functionality available to DMs in a way that:

1) allows them to change fight/flight for an individual NPC or group of NPCs, without affecting the entire area (variable radius?)

2) allows morale to be changed fairly quickly (quickslot-able?)

3) allows morale adjustment during a DM session without "breaking" morale for later users of the area without need for a module reset to clear things up.

I might have a go at scripting something along the lines of a DM Wand that deactivates morale (returns creatures to the Fight Till Death default mode) in a 10.0 radius, with some DM message feedback. If that works, we could probably make it's complement, a "Wand of Flight" which makes everything in a 10.0 radius flee. I might be able to work it such that having an active target causes it to affect a single creature instead of the radius as well. I think that would cover most of the intentions above.

Thoughts?

[edit: for the Wand of Flight, we have the potential problem of deciding what the creatures should be running from- normally they have whatever PC who triggered their OnPerception event to flee "away" from. If a DM triggers a "flight" event without a PC in perception range, what should happen? Should the creatures just hang out until they see something to run from? Or should we give them a meta bearing on the nearest enemy (even though it's beyond their perception range) and send them packing? The former is easier, but not sure what the DMs would prefer.]
People are going to get so sick of me taling about Guis hehe

The pnp summoning system i made makes use of a gui function i beleive called UIObject_Input_ActionTargetScript in order to unsummon one or all of the creatures a PC has summoned ... the thing is awsomly powerfull with it you can pass in a particular object or location (among other things)very easily and even include on screen feedback in the form of cursor icons and area selection.

So you could make a DM toggalable Morale GUI if you wanted with button options to allow dms to modify group behavior by distance (with variable distance if wanted via anohter GUI box) or a single creatures by specifcly clicking on the creature only

... could also put a sliding control in to set Modual Global morale conditions for subsets of creautures or just all hostiles in general ... say orcs are raiding for an ic reason ok make them run away less lets turn their hostility up and then turn it back down again when teh campaign comes to a close ... those sorts of things ... woudl be good to do for weather too maybe ...

Heres some info on the function if its usefull:

UIObject_Input_ActionTargetScript


This callback will be one of the most powerful new tools when it comes to creating custom actions in the game.

UIObject_Input_ActionTargetScript(), new in 1.06, will let you make 'GUI actions' similar to the 'actions' that are created when you click on a spell or feat button to cast it, or on a button in the DM Choser that then has you select a target to do the action to.

Once the user clicks on a valid target, a bunch of data will be sent to the server along with a request to execute a script associated with the click.

Anyway, enough summary, here's the details:

UIObject_Input_ActionTargetScript("sValidTargetTypes",nValidCursor,nInvalidCursor,nSpellTargetIndex,bUseHostile,"sScriptName", script parameter list...)


From: http://forums.obsidian.net/index.php?au ... id=2&cat=7
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

I was thinking about trying to copy/tweak/edit one of the DMFI placeable destruction radius buttons, though I may find it leads me to the same place as Bartleby's suggestion. I'd like to get more comfortable with GUI tool scripting since it's so powerful for this sort of thing, we'll see if this project helps get me over the hurdle with it.
Thangorn
Haste Bear
Posts: 2081
Joined: Fri Oct 01, 2004 1:00 pm
Location: Queenstown, New Zealand

Post by Thangorn »

Can you have a widget/DMFI gui function that sets the morale rating on an NPC or group of NPCs from within the client with the current system? That would mean you could do both fight and flight from within the same interface wouldn't it?

Doesn't the morale system currently work by setting a variable on the NPC/monster to a particular value that script reads and plays out behaviour accordingly? If that's the way it works, doesnt that make it pretty easy to script up a function that makes the morale rating changeable in the DM client?

Might I suggest, if thats not the way the moral system works, perhaps thats the way it should work..?
On indefinite real life hiatus

[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

How are you implementing this if it's now "ACR Morale"? Will creatures only check for morale if they have a Morale Rating Variable set, or will everything now test? Because I'd prefer the former. Just FYI the intention of the original script was to add some interest to random spawn encounters so the OnPerceive script was only on the blueprints being referenced by the spawn group scripts. It was never my intention to make it "across the board" for the reasons Thangs has mentioned above. It was also meant as a way around the "wild animals just kinda stand staring at you" problem.

A couple of other observations; AL's saying a +/-1 change to the modifiers is a ~5% change to the chance of fleeing/standing. I'm afraid it isn't, quite. The roll is 2D10, not 1D20. The percentage increase depends on what number is changing to what.

For what it's worth I reckon the chances of rolling certain numbers are:
20: 1%
19+: 3%
18+: 6%
17+: 10%
16+: 15%
15+: 21%
14+: 28%
13+: 36%
12+: 45%
11+: 55%
10+: 64%
9+: 72%
8+: 79%
7+: 85%
6+: 90%
5+: 94%
4+: 97%
3+: 99%
The point of the dice used is that the chance of an average roll is higher than the chance of an extreme high or low. (Not my idea, BTW, I stole all this from 2nd ed DMG).
Also you may have changed it, but the original script dealt with outnumbering by having the +/- modifier equal to the ratio of enemies to allies, e.g 2:1 = +2, 3:1 = +3 etc., which is obviously causing you problems. I'm happy with this from a "realism" point of view because I don't think low CR humanoids would pick a fight unless they felt they had a good chance of swamping their target, but I understand if that's spoiling everyone's game.

Those pedantries aside your suggestions seem to be perfectly sensible. The easiest way to fine-tune the system is probably just to nudge up your creatures' Morale Rating until they act how you want them to.

Edit: Writing out the chances of rolling certain numbers is not intended to insult anyone's intelligence, BTW.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Teric neDhalir wrote: Writing out the chances of rolling certain numbers is not intended to insult anyone's intelligence, BTW.
I don't tend to remember much of my statistics and probabilities coursework from undergrad these days; no offense taken. The table is plenty useful for easy reference.

For now, the morale scripts only act on creatures which have the morale script in their OnPerception event. Builders switch over to this script only if they are assigning a Morale Rating, and most of the mobs so altered have been given a { morale } label in their name to indicate this to DMs using the creator on the fly. That said, it's been rolled out for most of the random mobs on Silver Marches thanks to some industrious work by Wynna and Curmudgeon.

It's still a good long way from being an ACR Morale system; I agree that it's best not to implement it by default for any creature blueprints at this stage. Maybe later if we integrate or work in a more nuanced AI system for combat (like TonyK's off the nwvault), we can consider a more inclusive approach.
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

A couple of further thoughts on this..
Maybe you could add a positive modifier if any of the perceived PCs are wounded.
Also perhaps we could change the die roll for "Taking 10" so that creatures that have enough pluses or a high enough rating always stand, rather than each having a 50-odd percent chance of fleeing as in your orcish example above. It would then be quite simple to assign Morale Ratings based on what behaviour you want, such as "only attacks when odds of 2:1" because you can calculate the exact number required to attack.
User avatar
hollyfant
Staff Head on a Pike - Standards
Posts: 3481
Joined: Mon Oct 24, 2005 3:33 pm
Location: the Netherworl... lands! I meant the Netherlands.

Post by hollyfant »

I really, really suggest the following tweaks. Not so much to the system but rather the actual outcome in play:
  • Monsters need to make their minds up. They constantly end up yoyoing and thus picked off by archers. Good for the archers of course, but it looks downright stupid.
  • Monsters need to grow a pair. They're monsters ffs! Bugbears do not run away from a single human. We're making out first level characters become way too cocky...
:muffy:
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

I put these changes in a while back, but, due to a bizzare eccentricity of the NWN2 toolset, all the creatures have been ignoring the new script and using the old one. Should be in place by tomorrow, though, now that I know what's the matter with it.
Dorn
Haste Bear
Posts: 2196
Joined: Sat Apr 17, 2004 5:00 pm
Location: Australia (West - GMT+8)

Post by Dorn »

I'd like to see Charisma, or perhaps more appropriatly Intimidate score, be the key driver for morale checks.

You can have a group of 4 level 20 gnome bard who looks fairly unscarey to an orc

You can have a single level 6 greatsword wielding, spikey armoured human fighter who looks a lot more scarey.

But that may just complicate matters.

And i agree with Holly and am glad that's been fixed AL.
playing Nathaniel Ward - Paladin of the Morninglord and devout of Torm (cookie cutter and proud of it)
User avatar
Keryn
Ogre
Posts: 678
Joined: Sat May 24, 2008 7:17 pm

Post by Keryn »

Dorn wrote:I'd like to see Charisma, or perhaps more appropriatly Intimidate score, be the key driver for morale checks.

You can have a group of 4 level 20 gnome bard who looks fairly unscarey to an orc

You can have a single level 6 greatsword wielding, spikey armoured human fighter who looks a lot more scarey.

But that may just complicate matters.

And i agree with Holly and am glad that's been fixed AL.
Dorn, even though I understand what you would like, char doesnt translate IG directly by your appearance its an ability and it is not affected by your greatsword, spikey armor and unholy helmet.

I supose as it is its working fine if we are able to tweak it properly, I guess that from a more realistic point of view, as a toon grows in level an power it would also grow in confidence, and show a much higher skills using his weapon, something that can be rather scary to anyone looking.
Locked