User Tools

Site Tools


user:loggy:gemusage

Loggy's Gembait RE notes

(v5.54 beta, which is identical to v5.54 release)

  • For each unit on the map that will be in the battle:
    • Calculate chassis value. Keep a count of total friendly chassis values and hostile chassis values.
    • If hostile:
      • If the unit is not a commander, has retreat = 0, otherwise:
        • If the commander is gone berserk, has retreat = 0:
          • If commander is scripted to retreat and is scripted returning in their first slot, has retreat = 2
            • If commander is simply scripted to retreat, has retreat = 1
            • If commander has either kind of returning on damage, has retreat = 1
            • Otherwise, has retreat = 0
      • If the unit is a commander and has retreat is not 2:
        • Calculate the total of this commander's non-holy magic path levels. If has retreat = 1, subtract 2 from this, to a minimum final value of 0.
        • Add this value to the total number of hostile magic paths
        • Add (this value * 15) to the hostile total chassis value
        • If the total number of non-holy magic paths is nonzero:
          • Calculate (total number of non-blood gems) + (total number of blood slaves/2, rounded down).
        • If this value was greater than (total number of non-holy paths * 5), set it to (total number of non-holy paths * 5)
        • Add this value to the total number of hostile gems.
        • If total nonholy paths (as calculated above) is 4+ and the number of gems > 0:
          • If (a random number 1-3) + 4 ⇐ nonholy paths + gems, trigger gem usage, regardless of anything else.
        • If has retreat is 0:
          • Look up the number of items carried by the commander, add it to the total number of hostile items
          • If (a random number 1-2) + 3 ⇐ number of items, trigger gem usage, regardless of anything else
  • If the total number of hostile magic paths calculated above is 10+ and the total number of gems calculated above > 0, trigger gem usage.
  • If total gems + (total items * 3) + total paths is 16+, trigger gem usage.
  • If (total hostile chassis value + 2) * 5 >= total friendly chassis value, trigger gem usage.
  • Otherwise, don't.

I don't normally withhold mechanical stuff, but in this case I did. The reason I didn't post this before, is because in 5.53 and earlier versions 16 gems spread across any number of commanders would trigger gem usage, even if they were set to retreat and had no magic paths to use the gems. Gemburning every turn with scouts set to hold as many turns as is safe vs the enemy scripting then retreat did not sound like it was going to be terribly fun to play around. Even if you got some of the gembearing commanders killed, you could almost certainly trigger more gem loss of pointless spells than you lost when burning in this way.

Even if gem usage is not triggered by the above, once the round counter (ctrl-c) hits 8 or higher, gems will be spent normally. Also, once the opponent's army is routed, further gems won't be used.

TL;DR or "My head hurts!"

"Retreating" is defined by:

  • Gone berserk always means you are considered to have no retreat
  • Having returning or vortex of returning (or a modded spell with the same effect number) in the FIRST scripted slot only
  • Being scripted to retreat
  • Having any kind of returning of damage effect (ritual of returning, ring of returning…)

If a given commander is considered to have a means of retreating:

  • Its items don't count
  • Its non-holy magic paths are considered to be 2 lower than they really are, to a minimum of 0

The number of gems carried by a commander is considered to be at most (non-holy magic paths * 5). Blood slaves count half, before the cap.

Considering these things, gem usage is triggered if any of the following are true:

  • (hostile chassis value + 2) * 5 is greater than the friendly chassis value (this is not easy to calculate, but accounts for most cases where PD triggers gem usage)
  • There is any number of gems (so long as it isn't 0) and a total of 10+ non-holy paths across all hostile commanders
  • Total numbers of hostile gems + (items * 3) + non-holy paths is 16+
  • Any single mage, providing it has some gems and 4+ non-holy paths, has a ((paths + gems - 4)*33)% chance to trigger gem usage
  • Any single commander has an ((number of carried items - 3)*50)% chance to trigger gem usage

At round 8, enemies will start spending gems normally.

user/loggy/gemusage.txt · Last modified: 2023/05/15 11:42 by loggy