User:Tiberius/Confrontation Coding

From BattleMaster Wiki
Jump to navigation Jump to search

This is a sample system with which to replace the current coding that determines battles. Please note any problems or improvements on the discussion page.


Diplomatic Relations:

  • Federation
  • Alliance
  • Peace
  • Neutral
  • War
  • Hatred

Unit Settings:

  • Evasive
  • Defensive
  • Normal
  • Aggressive
  • Murderous

When does a unit attack in a two realm confrontation?

EvasiveDefensiveNormalAggressiveMurderous
FederationNoNoNoNoNo
AllianceNoNoNoNoYes
PeaceNoNoNoNoYes
NeutralNoNoNoYesYes
WarNoNoYesYesYes
HatredNoYesYesYesYes

Two principles of note: Federations are NEVER attacked and Evasive units NEVER attack. This allows federations to attack mutual allies (while this would be a three realm confrontation, there is no diplomatic differences and it can then be treated as a two realm confrontation).

When does a realm support another realm in a three (or more) realm confrontation?

\/Defending Realm|Attacking Realm>Neutral RealmPeace RealmAllied RealmFederated RealmOwn Realm
FederationDefenderDefenderDefender
AllianceDefenderDefenderNeutralAttackerAttacker
PeaceDefenderNeutralAttackerAttackerAttacker
NeutralNeutralAttackerAttackerAttackerAttacker

Obviously, you never support a realm with which you are warring or hate and you always support an attack against a warring or hated realm. In fact, you may not be supporting such an attack, but leading it instead, which may affect which parties take part.

How does the engine determine which two realms determine each side and which realms choose a side based on the sides already determined?

The largest army (by realm) in the region is first matched against every other realm in the region (descending by army size). If this creates a conflict, sides are drawn and the other realms are checked against the support table to determine their side. If any two realm's relations do not appear on this table, they are neutral<super>1</super>.

Alternatively, the two realms with the lowest relations could determine sides and then every other realm supports the side with which they have the higher relation (with the lowest relation for each side). If these are equal, they check the next lowest relation for the side, until one side runs out. If the realm has not determined a side by then, it is neutral.

<super>1</super>This means that when three realms each at war with each other meet in the same region, the two with the largest armies fight, but the third does not support either one. This ensures that a realm NEVER supports an enemy realm.