Pages

Verified rule selection

Mod profiles that set match rules for a recognized mod, and profiles that set its lobby rule defaults.

A mod profile can set the match rules a mod's patch changed, or the lobby defaults the mod's players expect. Use a rules profile for what the mod always plays, and a lobby-defaults profile for what the host may still change.

The worked example

Two bundled profiles from assets/compatibility/mod-mappings.toml (evidence text left out here): one selects a rule, one sets lobby defaults.

[[profile]]
id = "taesc-combat-v1"
revision = 1
priority = 0
matcher = "verified-executable-combat-v1"
rules = ["combat.retargetOutOfRange=on"]
mod = "escalation"

[[profile]]
id = "tamayhem-match-defaults-v1"
revision = 2
priority = 0
matcher = "verified-module-match-defaults-v1"
match_defaults = ["match.maxUnits=1500", "ai.economyScaleMedium=1", "ai.economyScaleHard=2", "ai.keepOrdersWhenHit=on", "combat.cloakFinishedOnly=on", "ai.original.commanderBuildsBelowBuilders=12"]
mod = "mayhem"

Verified rule selection

A rules matcher selects the values of one group of match rules (the GameRules rows the lobby and --rule set, match rules) when the mounted mod has the profile's identity (Mod identity). Its rules field is a nonempty array of "key=value" assignments, written and checked as --rule is, each naming a different row of the matcher's group:

Matcher Rule group
"verified-executable-repair-v1" repair
"verified-executable-units-v1" units
"verified-executable-combat-v1" combat

Three bundled profiles recognize Escalation 10.2. taesc-repair-v1, revision 1, selects builder-rate repair, the healtime-mask self-repair with work scale 4 for finished units only, and the pad switch on the pad. taesc-units-v1, revision 2, selects units.submergedSpawnOccupancy: a mobile unit created with its whole model under the sea surface starts in setSFXoccupy state 3. It also selects units.sfxOccupyAtOrBelow: a unit's script is told it floats at the waterline (state 2) whenever its draft line is at or below the sea surface, not only exactly at it, and a unit within 5 of the surface is told it is in the shallows (state 1) instead. taesc-combat-v1, revision 1, selects combat.retargetOutOfRange: a weapon lets go of a target it can no longer reach and picks another. Starting from TA's values, the assignments make the group's selection once at load, and the match plays it in place of the lobby's rows, which stay as chosen. The selection enters the combined compatibility identity as the group's domain, so checkpoints, the sim hash and the multiplayer data fingerprint cover it. An unrecognized mod selects nothing: the rows play and the identity is unchanged. The repair field truth and the COB register and the combat register record the changes the patch makes.

Verified lobby rule defaults

Matcher "verified-module-match-defaults-v1" lists match_defaults, rule assignments in the --rule form ("match.mapSpawns=on"), and applies only when the mounted mod has the profile's identity. Every assignment must name a rule and a value it can hold, or the library is refused. The bundled taesc-match-defaults-v1, revision 8, recognizes Escalation 10.2 and lists 19 defaults:

Rule Escalation TA What a player sees
match.mapSpawns on off The map's own units join a skirmish or multiplayer match
sharing.giftDelayUnits 10 0 A gift of more than 10 units waits before the ally gets it
sharing.giftDelaySeconds 30 0 That wait is 30 seconds of game time
sharing.giftToEnemies off on Units can be given only to an ally
sharing.totalsExcludeShares on off Shared metal and energy leave the end-game totals
sharing.takeDropped on off A dropped ally's units can be taken
sharing.takeCommander LivingCommander Any Only while the dropped ally's commander lives
sharing.takeWithCommander on off The take includes the commander
combat.cloakFinishedOnly on off A unit being built does not cloak or pay for it
orders.patrolWorkHold ReclaimOnly Both A builder patrolling on Hold Position only reclaims
orders.patrolWorkManeuver Both Both On Maneuver it repairs, helps build and reclaims
orders.patrolWorkRoam Both Both On Roam likewise
ai.economyScaleEasy 1 0.5 A computer player on Easy banks this share of reclaim and received resources
ai.economyScaleMedium 2 0.7 On Medium
ai.economyScaleHard 4 1 On Hard
ai.keepOrdersWhenHit on off A computer player's unit keeps its orders when hit
ai.original.commanderBuildsBelowBuilders 10 5 The Original AI's commander builds until it has 10 builders
ai.original.assaultSetOutUnits 10 6 Its assault groups set out at 10 units
ai.original.airSmallGroup 15 5 Up to 14 of its aircraft patrol the base

Each row is described in the match rules; the profile's evidence records where each value comes from.

The defaults are laid over every rule the player has not chosen when a skirmish or a host's multiplayer lobby opens: a rule the player set in an earlier lobby, even to TA's own value, keeps the player's choice, and every other rule takes the mod's default. The host may change any of them, and the match runs the rules the lobby finally sends, so they add nothing to the compatibility plan. Only the player's choices are saved, so another mod's lobby does not inherit a default, and a mod that changes a default reaches every player who never chose that rule.

What goes wrong

Profiles that apply log:

rule compatibility: profile taesc-combat-v1@1 selected combat rules; evidence: <evidence>
match defaults compatibility: profile tamayhem-match-defaults-v1@2 selected 6 lobby rule defaults; evidence: <evidence>

An assignment outside the matcher's group, or a repeated row, refuses the library and the match does not load:

mod compatibility: mod-mappings.toml: profile[0].rules: 'repair.padSwitch=Pad' is not a rule assignment of the combat group
mod compatibility: mod-mappings.toml: profile[0].rules: duplicate rule 'combat.retargetOutOfRange'

Next