Skip to content

Instantly share code, notes, and snippets.

@becked
Created January 1, 2026 21:33
Show Gist options
  • Select an option

  • Save becked/558fffa9846338669c388726ce649630 to your computer and use it in GitHub Desktop.

Select an option

Save becked/558fffa9846338669c388726ce649630 to your computer and use it in GitHub Desktop.
Calamity Mirroring in Duels

Calamity Balancing in Multiplayer/Duel Games

No Direct "Mirror" Mechanic, But There IS Balancing

There is NO mechanism that forces one player to experience a calamity within 4 turns after another player experiences one. However, there is a sophisticated balancing distribution system that makes it more likely (but not guaranteed) that calamities spread between players.


How the Calamity Balancing Works

The OCCURRENCECLASS_CALAMITIES has bBalanceDistribution enabled (occurrenceClass.xml:20), which activates two balancing behaviors:

1. Per-Player Cooldown (iMinRepeatPlayer = 5 turns)

Source: occurrenceClass.xml:18 and Game.cs:9022-9047

  • After a player experiences any calamity, they are blocked from receiving another calamity of the same class for at least 5 turns
  • This is a protection, not a trigger for the other player

2. Preferential Targeting of Players Who Haven't Had Calamities Recently

Source: Game.cs:9765-9768

if (infos().occurrenceClass(eClass).mbBalanceDistribution)
{
    iValue += randomNext(50 + getTurnsSinceLastOccurrence(eOccurrence, eLoopPlayer));
}
  • When selecting who gets hit by a calamity, players who haven't experienced one recently get higher weight
  • If Player A just had a drought 2 turns ago and Player B hasn't had one for 20 turns, Player B is significantly more likely to be targeted (but not guaranteed)

3. Increased Chance for Calamity Types That Haven't Occurred

Source: Game.cs:8185-8188

iStartChance += getTurnsSinceLastOccurrence(eLoopOccurrence);
  • The longer since a specific calamity type occurred globally, the more likely it is to trigger

Bottom Line

Mechanic Effect
bBalanceDistribution Enables even distribution of calamities between players
iMinRepeatPlayer = 5 Protects a player for 5 turns after receiving a calamity
Preferential targeting Players who haven't had calamities recently are more likely targets
Random trigger Calamities still trigger based on iStartChance per turn (not forced)

The system distributes calamities more evenly between players over time, but:

  • It does NOT force Player B to get a calamity after Player A gets one
  • The calamity trigger is still random (based on iStartChance per turn)
  • Player A gets 5 turns of protection, making Player B more likely to be the next target if a calamity triggers during that window

Note: If you're experiencing what seems like synchronized calamities in duels, it's likely due to this balancing system making the other player a more probable target once one player has been hit—but it's probabilistic, not deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment