Jump to content

mechanics of Morale?


critto

Recommended Posts

Hello, everyone.

I've been trying to understand the mechanics of Morale in the game and, hopefully, learn how to manipulate it reliably through scripts and opcodes. Gradual degradation of morale, followed by morale failure, is a cool concept that I haven't seen to be used much in mods, I don't think. Now I am beginning to understand why.

Anyhow, here's a simple experiment that I've done. I made a creature that has 15 base morale, morale breakpoint set at 5 and morale recovery at 20, initially. Once the creature's HP is less than 25%, it gets hit with a morale hit of -3 every 6 seconds by timer, using MoraleInc(), through its AI script. This does not seem to produce any effect. I switch from MoraleInc() to force-applying a spell that does essentially the same using the opcode #23 (same params: value of -3 applied in a cumulative fashion, in BG1 mode). The creature suffers morale failure after the first hit of the spell but recovers pretty quickly, in a second or two. I change the value of morale recovery to 100, and the creature now spends maybe a few seconds/rounds in the state of morale failure. After the creature recovers, it does not suffer another morale failure despite numerous consecutive hits with the spell every 6 seconds (I guess there's a built-in immunity to morale break after recovery?) 

What exactly is happening here? The description of morale recovery in IESDP states that it is time taken to recover morale to its equilibrium value of 10. It is unclear, though, what is the unit of measure. My guess is that it is not seconds (as it says in IESDP) but rather AI updates? Still, doesn't feel right. In any case, none of this explains why one hit of -3 from the spell causes instant morale break. If the creature's morale were to restore from 15 to 10 before the conditions for triggering the spell are met, -3 does not seem like enough. Unless the damage the creatures suffers in the process also causes it to lose some morale?

Also, apparently the state of Morale Failure: Panic is not the same panic caused by opcode #24? The AI script has a block that causes the creature to escape the area if it reaches a state of panic [StateCheck(Myself,STATE_PANIC)]. This does not trigger during Morale Failure. It is unclear to me how to check for morale failure inside the trigger, without resorting to custom-made spell states, at least. What's even more interesting, a trigger condition MoraleLT(Myself,6) does not catch the creature in the state of Morale Failure either. Which is confusing because its morale breakpoint is at the value of 5 or less. If morale failure has occurred, the value supposed to be at less than 6, right?

All of this is painfully convoluted. The only way to debug is unhelpful: CTRL+M always returns the value of 10 for Morale. I wonder if anyone here has some explanations how all of this works.

PS: not exactly relevant, but in case anyone is interested, a scripting action Panic() does something weird: it simply causes the active creature to move around, without triggering any other effects expected of the opcode #24 (changing circle to yellow, applying a relevant state, etc.) I guess, the description of Panic() inside the IESDP is truthful, but one might expect it to behave closer to the Horror opcode.

Link to comment

Well, I have never tried to use scripts to change morale. It is interesting, in principle, although I don't know where I would put those checks and changes in a working script and what results I could hope for except the same failure I can already produce by moving the breaking point with a spell. The changes to the Morale stat with scripts may be doing something different from shifting the breaking point, but nothing easily usable is peeking out of this, is it? And you do understand that the opcode change reduces morale with positive values, right? It bumps up the breaking point until it synchs with current morale, and then a failure of one of those three types (panic, fleeing, berserk) happens. Positive values bring cowardice, in other words, and the opcode works, so unless script morale can do something different, an effect-based change - over time, if you prefer - gets the job done. Ending it - well, that's a different story.

I have made a spell like this, Poltroonery, for bringing up targets' breaking point by 2. That doesn't normally lead to panic and so on, but it was supposed to make a stampede more likely when morale would be checked after damage, seeing many nearby allies killed and what else may cause those breaks. I never got around to testing how useful it really was, though, which would be tricky anyway. Breaking point-fudging might work well against enemies like Tazok: his saving throws are all at 1 and morale also at 1, but saves you can't do anything about without Greater Malison. His morale total is still 18, but with a few shots of this medicine... even a golem would break and run. :D Also even the main character will experience the triple bouquet if his point is moved far enough, despite being excluded from routine morale failure.

Go ahead, though, and look in the script function. Maybe you'll find something different there.

Link to comment

A creature naturally loses 2 morale whenever:

  • its health drops below 50%
  • its health drops below 25%
  • an ally dies (pc's likely detect only party members, while everyone else likely uses SPECIFICS group)
  • ? ? ?

But only if it is not currently suffering from morale failure.

A poison/regen combo properly staggered (not hitting at the same time) can cause continuous morale loss:

With 40 MaxHP:  20HP -> 19HP (-2 morale) -> 20HP -> 19HP (-2 morale) -> 20HP -> 19HP (-2 morale) -> 20HP -> 19HP (-2 morale) etc...

Morale loss doesn't have lower bounds checking (or likely upper bounds checking).  1 - 2 = 25 (like the old rod of terror), but normally only creature's with a morale break of 0 (immune) would notice it, since anything else would already have morale failure. However, manual changes to morale (with op23) can cause the same issue to any creature since it still applies during morale failure.

Morale Recovery is in seconds.

There is no way to direct way to detect morale failure, nor any way to detect the type of morale failure (panic, berserk, run away), nor do they have any direct relation to the similar opcodes (3, 4, 24, 245, 246, 247) or STATEs.

Morale Failure disables a creature's scripts, which is why it could not detect it's morale, or anything for that matter.

Applying op23 (BG1 mode) with timing mode 1 (and possibly others) applies the amount for each instance already on the creature, including itself.

  • Your first applies 2x (itself and itself). (-6)
  • Your second applies 3x (itself, itself, and the first one). (-9, total of -15)
  • Your fourth applies 4x (itself, itself, the second one, and the first one). (-12, total of -27)
  • Always use timing mode 0 (no duration) to avoid this (with BG1 mode).
Edited by kjeron
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...