Skip to content

Rules field catalog

The Rules core (Melange 0.18) describes a match’s rules as a rules document: values for the scalars of the game’s SchemeData (the “Game Style”) and three numbers for each of its 58 weapon entries. This page is the catalog behind that document: which fields exist, their types and ranges, and the weapons with their tags. The same tables (src/rules/fields.inc) drive the validator, the Rules tab, the generated JSON Schema and the rules.schema RPC.

The tables under “Generated tables” below are written by rules_fields_selftest --markdown, and the self-test fails when they are out of date. Everything else on this page is written by hand.

A SchemeData has 91 fields. The catalog covers the 29 that a rules document may set:

  • the 28 scalars (all i32 except MineFactoryOn and TelepadsOn, which are bools) and the string AssistedShotLevel: 29 catalog rows, 28 of them editable (Special is listed but not editable: it is 0 in every built-in style and its meaning is not known);
  • the 58 weapon entries, each a WeaponSettingsData {Ammo, Crate, Delay};
  • not covered: Name, Permanent, Lock and AssistedShotSettings. A rules document never writes them.

The design called these “26 scalars”. A count of SchemeData gives 28 scalars plus the string, so the catalog has all of them and marks Special not editable. The catalog is by field name, so a count changes nothing else.

Ranges are the ranges this catalog commits to. Each contains every value used by the 18 built-in styles of LOCAL.XOM, by Kanly, Kanly Melee and Sandworms (the self-test proves it). A range is wider than what those styles use where the engine plainly allows more; it is not a statement that every value in it was played. What was played is listed under “Measured in game”, and what the game’s own style editor offers under “The game’s style editor”. A label or help text that says “not measured” or “not confirmed” describes only what the field name and the built-in values show.

My Worms > Customise > Create Game Style opens the game’s editor (7 pages). Pages 1 to 3 were walked by keyboard in game for 0.18.0, from “A blank style”, and left with “lose changes? Yes”, so nothing was saved. Every row cycles (it wraps from the last option to the first). What it offers:

Editor row Options Field
Number of Rounds 1 to 9 Wins
Turn Time 15, 20, 30, 45, 60, 90 s TurnTime
Round Time 0:00, 5:00 to 30:00 in 5-minute steps RoundTime
Worm Health 50, 100, 150, 200 WormHealth
Worm Select No, Yes WormSelect
Sudden Death 1 Health, Raise Water, Draw Round SuddenDeath
Water Rise Speed Slow, Medium, Fast WaterSpeed
Wind Off, 1 to 5, 1 to 10 WindMaxStrength
Telepads, Mine Factory Yes, No TelepadsOn, MineFactoryOn
Mine Fuse Random, 0 to 5 MineFuse (-1 is Random)
Assisted Shot Beginner, Standard, Pro AssistedShotLevel
Chance of Crate 0 to 100% in steps of 10 RandomCrateChancePerTurn
Weapon, Utility, Mystery, Health Crate a bar of 10 steps the four ...Chance weights
Health Crate Amount 25, 50, 75, 100 HealthInCrates
Land Objects None, Mines, Oil Drums, Full Objects
(row label hidden by the cursor) Normal, Additive, Limited Stockpiling (Limited’s stored value not read)
Artillery Mode No, Yes ArtileryMode
Retreat Time 0, 3, 5, 10 s probably LandTime; not confirmed
Fall Damage Yes, No FallDamage
Weapon Settings: Ammo none, 1 to 8, infinite weapon ammo
Weapon Settings: Crate Chance a bar of 10 steps weapon crate
Weapon Settings: Turn Delay 0 to 10 weapon delay

The editor’s limits are not the engine’s: the built-in Holy Grail style gives the Concrete Donkey a delay of 16 and Family gives the Binoculars 10 ammo, and ammo up to 99 and turns of 15 s were played in game. The catalog therefore keeps the wider ranges, which contain every built-in value. DisplayTime, RopeTime, HotSeat, HelpPanelDelay and TeleportIn have no row on pages 1 and 2; pages 4 to 7 (the rest of the weapon list) were not walked.

The editor writes the game’s save when a style is saved, so the save was backed up first. The walk saved nothing. The test instance’s own copy of the save was written once, when the game was quit from the main menu, and was put back from the backup to the same bytes (sha256 e5c0fce9...); the real Steam save kept its sha256 (c648364e...) and timestamp throughout.

Value Range Meaning
ammo -1 to 99 Shots each worm’s team starts with. -1 is infinite, 0 is absent. Values above 9 display as numbers: see below.
crate 0 to 100 The weapon’s weight among weapon crates. 0 keeps it out of crates.
delay 0 to 20 Own-team turns the weapon stays greyed at the start of the match: see below.

A mystery entry (the 15 ...Mystery ones) takes only crate: its ammo and delay stay 0 in a rules document. A mod scheme file’s "*" entry also reaches mystery entries in the game’s data, which is harmless and not stored.

Not every entry’s three values reach the game (the ld-01 trace of the level script, lib_SetupDefaultInventoryAndDelays in lib_help.lub). The “Values used” column of the weapons table and Uses() in src/rules/fields.h say which do:

  • The level script copies ammo and delay into the inventories for the weapons and utilities on the panel, except Skip Go and Surrender, which it hard-wires to infinite ammo and no delay whatever the style says.
  • Double Damage, Crate Shower, Crate Spy and Armour are never copied into an inventory (they are not on the panel); only their crate weight is used, like the mysteries.
  • Every entry’s crate weight feeds the crate table, which leaves out an entry whose ammo is -1, so an infinite weapon never comes in a crate.

The validator still accepts a value the game ignores (built-in styles and Kanly set some), so a style always validates; the Rules tab greys those inputs.

Weapon clones (Acid Spitter, Acid Flask, Crucible, Grave Spade) share their base weapon’s three values; see weapons.md. Panel cells 29, 39 and 40 are empty in the vanilla panel (clones take them) and cell 41 holds the Binoculars.

Delay = N greys the weapon on the weapons panel for the first N turns of the team, and the weapon is usable from the team’s turn N + 1. Turn 1 counts. While it is greyed the cell shows the turns still to wait, counting down from N on the team’s first turn (the panel shows 2 on turn 1 and 1 on turn 2 for a Delay of 2). The highlighted cell’s caption says “Delayed”.

The count is per team and per own-team turn, not per global turn: the team’s own turns, one after another. With two teams in the match one global turn is half a team turn, so a counter that ran per global turn would have shown 2 on global turn 1 and 0 on global turn 3, and the panel showed 2 and then 1. (The engine keeps the counter as a u8 per team in Inventory<n>.WeaponDelays.) In a match where each team plays once per round, a team turn is a round; the check could not tell the two apart, and they differ only when a team skips a round. ld-01’s trace of the delay counters agrees: a team’s counter goes down by one at the end of that team’s own turn (four teams, Delay 1: 1 1 1 1, then 0 1 1 1, then 0 0 1 1).

So “available from turn N” in a prompt or a rule means delay = N - 1. The game’s own editor offers delays 0 to 10; the built-in Holy Grail style uses 16, and the catalog allows up to 20.

  • A weapon cell with ammo 1 to 9 on a turn it can be used shows no number on the cell; the caption of the highlighted cell shows the count as a number before the name (“12 Bazooka”, “98 Air Strike”, “25 Sheep”, “10 Shotgun”). Counts above 9 are shown in full as two digits, and 98 was shown after a 99 had been used once.
  • Infinite ammo (-1) shows no number at all: the caption is the name alone (“Grenade”).
  • The catalog’s ceiling is 99. The panel’s caption draws two digits; no three-digit count was tried. The engine keeps each inventory count in an i8, so 127 is the most a worm’s inventory can hold and a larger value would wrap to a negative: do not exceed 99. The game’s own editor stops at 8 (then infinite).
  • Greyed cells show their delay, not their ammo, so a delayed weapon’s ammo is visible again only once it unlocks.

A weapon has at least one tag; the Rules API (wum.rules.weapons()) and a prompt such as “melee only for 3 turns, then airstrikes” use them to name sets of weapons. Tags are a judgement from what the weapon does in play and from the game’s own help text for it (the English text bank, HelpText.kWeapon...), listed with the weapons in the table below. “Removing a weapon after N turns” cannot be expressed in a rules document; “available from turn N” can, as a delay.

Tag Weapons
melee Baseball Bat, Fire Punch, Prod, No More Nails
airstrike Airstrike, Super Airstrike, Fatkins, Alien Abduction, Concrete Donkey (the ones aimed from the sky)
explosive anything that explodes for damage: the launchers, the grenades, dynamite, mines, sheep, the airstrikes and more
thrown thrown or dropped by the worm: the grenades, Banana Bomb, Dynamite, Gas Canister
ballistic fired along a line: Bazooka, Homing Missile, Shotgun, Sniper Rifle, Poison Arrow, Sentry Gun
fire Fire Punch (the only fire weapon in the game’s weapon list)
animal Sheep, Super Sheep, Concrete Donkey
utility tools and pickups: Girder, Skip Go, Surrender, Binoculars, crates’ utilities, most mystery crates
movement moves the worm itself: Jetpack, Ninja Rope, Parachute, Redbull, Starburst (the worm flies and detonates: “Your own life, but at what cost?”), three mystery crates. Not Super Sheep, which flies the sheep.

The Rules core writes a style at match VM creation. A field marked “Early read” in the table below is read by something before that moment, so the write may come too late for that reader. ld-01 traced every read of GM.SchemeData by code address, from the start of a match to its third turn:

  • WindMaxStrength: the HUD wind gauge is set up from it before the VM. Display only; the sim’s wind cap is read later, after the write.
  • Wins: kept early-read to be safe. No traced run reached a round end, so when the round loop reads it is not known; the core restores the style at match end rather than at VM close.
  • Every other scalar (Objects and HotSeat included) is first read by the level script’s Initialise, after the write. Weapon ammo and crate also feed the crate table before the VM, but the table is rebuilt at turn 1.

Run on a private 0.18.0 build in a test instance, with a copy of the Kanly style whose values were changed for the check (turn time 15 s or 30 s, worm health 500) and no change to the real save. Deathmatch, two teams, one human and one CPU team, each with 4 worms; the human team only opened the weapons panel (and in run 4 played Skip Go).

Run 4 is the acceptance check (Bazooka ammo 12, delay 2; Grenade ammo -1; everything else Kanly’s, whose "*" gives delay 1). The human team played global turns 1, 3 and 5:

Team turn (global) Bazooka cell Caption Shot
1 (1) greyed, 2 “Delayed” ld02-r4-team-turn1.png
2 (3) greyed, 1 “Delayed” ld02-r4-team-turn2.png
3 (5) usable “12 Bazooka”; the Grenade’s caption is “Grenade”, no number ld02-r4-team-turn3.png, ld02-r4-team-turn3-grenade.png

Earlier runs:

What Setting Seen
Delay 2 (Bazooka), 5 (Holy Hand Grenade), 4 (Air Strike), run 1 team turn 1, then 2 greyed with 2, 5, 4; then greyed with 1, 4, 3
Delay 2 (Shotgun) team turns 2, 3 greyed with 1; usable
Delay 4 (Holy Hand Grenade) team turns 2, 3, 4 greyed with 3, 2, 1
Delay 3 (Air Strike) team turns 2, 3, 4 greyed with 2, 1; usable
Delay 1 (Girder) team turn 2 usable
Ammo 12 (Bazooka) team turns 2 to 4 caption “12 Bazooka”
Ammo 25 (Sheep), 10 (Shotgun), 99 (Air Strike) highlighted cell “25 Sheep”, “10 Shotgun”, “98 Air Strike” after one use
Ammo -1 (Grenade) highlighted cell “Grenade”, no number
Turn time 15000 match clock 15 s turns

The screenshots are ld02-r4-*.png, ld02-run1-*.png and ld02-run2-*.png in the task’s evidence folder. A team’s turns were global turns 1, 3, 5, 7: the counter went down once per team turn, not once per global turn.

Not measured: whether a delay counts rounds or own-team turns when a team misses a round; delays above 5; ammo of 100 or more; the effect of DisplayTime, LandTime, RopeTime, HotSeat, TeleportIn and WormSelect.

build\x86-release\rules_fields_selftest.exe --markdown

prints the block below. Paste it between the two marker lines. python -I scripts/rules-dump-schemes.py LOCAL.XOM tests/fixtures/rules/local-schemes.json rebuilds the fixture of the 18 built-in styles (numbers only, no game assets).

Field Type Range Step Unit Group Label Early read Editable
AssistedShotLevel string enum enum 1 match Assisted shot no yes
ArtileryMode enum 0 to 1 1 worms Artillery mode no yes
TeleportIn enum 0 to 1 1 worms Worm placement no yes
Wins int 1 to 9 1 match Rounds to win yes yes
WormSelect enum 0 to 1 1 worms Worm select no yes
WormHealth int 1 to 1000 1 hp worms Worm health no yes
RoundTime int 60000 to 3600000 1000 ms time Round time no yes
TurnTime int 5000 to 300000 1000 ms time Turn time no yes
Objects enum 0 to 3 1 objects Mines and oil drums no yes
RandomCrateChancePerTurn int 0 to 100 1 % crates Crate chance per turn no yes
MysteryChance int 0 to 100 1 crates Mystery crate weight no yes
WeaponChance int 0 to 100 1 crates Weapon crate weight no yes
UtilityChance int 0 to 100 1 crates Utility crate weight no yes
HealthChance int 0 to 100 1 crates Health crate weight no yes
HealthInCrates int 0 to 500 1 hp crates Health per crate no yes
Stockpiling enum 0 to 1 1 match Stockpiling no yes
SuddenDeath enum 0 to 2 1 suddendeath Sudden death no yes
WaterSpeed enum 1 to 3 1 suddendeath Water speed no yes
DisplayTime enum 0 to 1 1 time Display time no yes
LandTime int 0 to 20000 1000 ms time Land time no yes
RopeTime int 0 to 20000 1000 ms time Rope time no yes
FallDamage enum 0 to 1 1 worms Fall damage no yes
HotSeat int 0 to 30000 1000 ms time Hot seat time no yes
Special int 0 1 special Special no no
MineFuse int -1 to 10 1 s objects Mine fuse no yes
HelpPanelDelay int 0 to 10000 1000 ms time Weapon help delay no yes
MineFactoryOn bool true, false 1 objects Mine factory no yes
TelepadsOn bool true, false 1 objects Telepads no yes
WindMaxStrength int 0 to 10 1 match Wind strength yes yes

Values of the enum fields:

  • AssistedShotLevel: AssistedShot.Beginner = Beginner, AssistedShot.Intermediate = Standard, AssistedShot.Pro = Pro
  • ArtileryMode: 0 = Off, 1 = On
  • TeleportIn: 0 = Off, 1 = On
  • WormSelect: 0 = Off, 1 = On
  • Objects: 0 = None, 1 = Mines, 2 = Oil drums, 3 = Full
  • Stockpiling: 0 = Normal, 1 = Additive
  • SuddenDeath: 0 = 1 health, 1 = Raise water, 2 = Draw round
  • WaterSpeed: 1 = Slow, 2 = Medium, 3 = Fast
  • DisplayTime: 0 = Off, 1 = On
  • FallDamage: 0 = Off, 1 = On
Key Id Kind Panel cell Values used Tags
Airstrike 4 weapon 15 ammo, crate, delay airstrike,explosive
BananaBomb 7 weapon 10 ammo, crate, delay explosive,thrown
BaseballBat 10 weapon 14 ammo, crate, delay melee
Bazooka 1 weapon 0 ammo, crate, delay explosive,ballistic
ClusterGrenade 3 weapon 7 ammo, crate, delay explosive,thrown
ConcreteDonkey 18 weapon 27 ammo, crate, delay airstrike,explosive,animal
CrateShower 45 utility none crate utility
CrateSpy 46 utility none crate utility
DoubleDamage 44 utility none crate utility
Dynamite 5 weapon 19 ammo, crate, delay explosive,thrown
FirePunch 12 weapon 12 ammo, crate, delay melee,fire
GasCanister 16 weapon 8 ammo, crate, delay thrown
Girder 34 utility 34 ammo, crate, delay utility
Grenade 2 weapon 6 ammo, crate, delay explosive,thrown
HolyHandGrenade 6 weapon 9 ammo, crate, delay explosive,thrown
HomingMissile 13 weapon 1 ammo, crate, delay explosive,ballistic
Jetpack 37 utility 33 ammo, crate, delay utility,movement
Landmine 8 weapon 18 ammo, crate, delay explosive
NinjaRope 35 utility 31 ammo, crate, delay utility,movement
OldWoman 17 weapon 21 ammo, crate, delay explosive
Parachute 36 utility 30 ammo, crate, delay utility,movement
Prod 11 weapon 13 ammo, crate, delay melee
SelectWorm 40 utility 37 ammo, crate, delay utility
Sheep 15 weapon 20 ammo, crate, delay explosive,animal
Shotgun 9 weapon 2 ammo, crate, delay ballistic
SkipGo 38 utility 36 crate utility
SuperSheep 19 weapon 23 ammo, crate, delay explosive,animal
Redbull 41 utility 32 ammo, crate, delay utility,movement
Flood 14 weapon 24 ammo, crate, delay utility
Armour 47 utility none crate utility
WeaponFactoryWeapon 21 weapon 28 ammo, crate, delay explosive
AlienAbduction 22 weapon 17 ammo, crate, delay airstrike
Fatkins 23 weapon 11 ammo, crate, delay airstrike,explosive
Scouser 24 weapon 22 ammo, crate, delay explosive
NoMoreNails 25 weapon 25 ammo, crate, delay melee
PoisonArrow 26 weapon 3 ammo, crate, delay ballistic
SentryGun 27 weapon 4 ammo, crate, delay ballistic
SniperRifle 28 weapon 5 ammo, crate, delay ballistic
SuperAirstrike 29 weapon 16 ammo, crate, delay airstrike,explosive
BubbleTrouble 42 utility 35 ammo, crate, delay utility
Starburst 20 weapon 26 ammo, crate, delay explosive,movement
Surrender 39 utility 38 crate utility
Binoculars 43 utility 41 ammo, crate, delay utility
MineLayerMystery 50 mystery none crate explosive
MineTripletMystery 51 mystery none crate explosive
BarrelTripletMystery 52 mystery none crate explosive
FloodMystery 53 mystery none crate utility
DisarmMystery 54 mystery none crate utility
TeleportMystery 55 mystery none crate utility,movement
QuickWalkMystery 56 mystery none crate utility,movement
LowGravityMystery 57 mystery none crate utility,movement
DoubleTurnTimeMystery 58 mystery none crate utility
HealthMystery 59 mystery none crate utility
DamageMystery 60 mystery none crate utility
SuperHealthMystery 61 mystery none crate utility
SpecialWeaponMystery 62 mystery none crate utility
BadPoisonMystery 63 mystery none crate utility
GoodPoisonMystery 64 mystery none crate utility