API catalog

103 APIs, each one telling you
“Verified? How fast? How does it work?”

Generated from code by python -m openwar3 catalog --write and updated along with the SDK, so models never have to guess which methods exist or which ones actually work. The same data is also available as JSON to hand straight to an agent.

58 Observe
28 Command
9 Game control
6 Sandbox
2 Connection and utilities
98 Verified in live games
0 Experimental
5 Inferred / not fully tested
103 APIs

Observe 58

Read state without changing the game. Nearly all of it reads the pushed snapshot directly, with zero wait.

Full state of the whole map (WorldState): .units .players .items .clock .me; repeated calls within max_age seconds return the same copy. ⚠ Workers inside a gold mine are not in the list; by default the whole map is visible (in the lockstep model everything exists locally), and only Game(fair=True) filters by vision.

Mechanism W3P world block Local\War3World_<pid> (pushed by the runtime every 50 ms, seqlock)

Verified Pushed snapshot

Enemy units (or 'creep' for creeps, or a given player number) as last seen: [(the unit as it was then, the game clock at that time, seconds elapsed since)], newest first. Units seen dying are removed from the list. Both fair mode and normal mode record based on "what we can see right now" — this is the map in a player's head: scouted army, where the enemy hero was last seen, when the enemy expansion went up. max_age keeps only entries from within that many game seconds.

Mechanism visibleTo of the pushed snapshot (every snapshot refresh records the visible enemy/creep units)

Verified Pushed snapshot

This game's terrain table MapInfo: .walkable(x,y) .buildable(x,y) .at(x,y) .bounds (playable area) .starts (start locations) .cells (bit0 unwalkable, bit1 unbuildable). It takes a few seconds after the game starts to compute; returns None until it's ready. Trees aren't included (use trees()).

Mechanism W3P map block Local\War3Map_<pid> (computed in batches by the runtime after the game starts; IsTerrainPathable walk/build)

Verified Pushed snapshot

Which player number I am (0~11).

Mechanism World block header

Verified Pushed snapshot

{'gold','lumber','food_used','food_cap','gold_gathered','lumber_gathered'}; player defaults to us, and any player can be read. Returns None when it can't be read — don't treat that as 0.

Mechanism World block players[16]

Verified Pushed snapshot

All 16 player slots: Player(id, gold, lumber, food_used, food_cap, gold_gathered, lumber_gathered, race, known).

Mechanism World block players[16]

Verified Pushed snapshot

Find a unit by handle pair (lo, hi) (order targets, task targets and events all give handle pairs).

Mechanism World block by_handle

Verified Pushed snapshot

Whether it's a building (including towers). Determined by movement speed 0 in the unit table; the Undead hall has a footprint of 0, so don't go by footprint.

Mechanism Snapshot + units.json (spd==0 = building)

Verified Pushed snapshot

Our workers (Peasants/Peons/Acolytes/Wisps).

Mechanism Pushed snapshot

Verified Pushed snapshot

Workers with nothing to do: no order and no task (workers you just gave a job this tick don't count). ⚠ Re-issuing a gather order to a worker that has a task interrupts its harvest cycle (income drops to zero).

Mechanism Pushed snapshot (order slot + task slot)

Verified Pushed snapshot

Our living heroes (dead ones are in the altar's revive list; see revive).

Mechanism Pushed snapshot

Verified Pushed snapshot

Our combat units: not workers, not buildings.

Mechanism Pushed snapshot + units.json

Verified Pushed snapshot

Our buildings (including towers and foundations under construction); types can restrict it to certain kinds, e.g. {'hbar'}.

Mechanism Pushed snapshot

Verified Pushed snapshot

Whether this worker is building something (or walking over to build / helping repair; includes jobs assigned this tick). Skip it when picking a builder, otherwise the previous foundation stops.

Mechanism Pushed snapshot (order = building four-character code, or construction/repair order)

Verified Pushed snapshot

This building isn't finished yet (HP not full). ⚠ Damaged buildings aren't at full HP either — good enough for the opening, but once fighting starts, combine it with timing.

Mechanism Pushed snapshot (a foundation's HP climbs from very low all the way to full)

Verified Pushed snapshot

Gold mines on the map. ⚠ A Night Elf Entangled Gold Mine and the neutral gold mine are two separate units at the same coordinates; send harvesters to your own one.

Mechanism Pushed snapshot (ngol/egol/ugol)

Verified Pushed snapshot

Creeps (neutral hostile). ⚠ Vision shrinks at night; once distant camps fall into the fog of war, target commands on them are rejected (reason code 1001).

Mechanism Pushed snapshot (owner 12 = neutral hostile)

Verified Pushed snapshot

{'hp','hp_max','mana','mana_max'} (floats, raw engine values). Passing the unit you got from a snapshot is fine (it's swapped for the latest copy).

Mechanism World block unit hp/hpMax/mana/manaMax

Verified Pushed snapshot

[{code, level, cooldown, flags}]; buffs are in buffs(u). Only available for units that "have details" (heroes > player units > creeps, up to 256).

Mechanism World block details: abilities (code/level/flags/cooldown remaining)

Verified Pushed snapshot

Buff codes on the unit (e.g. 'BHds' Divine Shield, 'Bslo' Slow). See data/game/buffs.json for what each code does.

Mechanism World block details: ability objects starting with B

Verified Pushed snapshot

Seconds of cooldown left on this ability (game seconds); 0 = ready to cast; returns None if the unit doesn't have this ability (or has no details).

Mechanism World block details: ability cooldown remaining (ability timer)

Verified Pushed snapshot

Four-character codes of the 6 item slots (None for empty slots); returns None if there's no inventory.

Mechanism World block details: 6 inventory slots

Verified Pushed snapshot

{'order','target','x','y'}: the order the unit is currently carrying out (order is 0x000D00xx or a building four-character code; 0 = idle). target is a handle pair; use g.unit(target) to turn it into a unit.

Mechanism World block unit order / order target / order target point

Verified Pushed snapshot

The unit it is **actually attacking/chasing** (None if there isn't one). ⚠ After an attack order, the order slot quickly empties and the attack hangs on the task — to tell "what it's attacking", use this, not current_order.

Mechanism World block unit task target

Verified Pushed snapshot

Engine game clock (game seconds; 0 while loading). At higher game speeds it runs faster than the wall clock.

Mechanism World block header clockMs (engine game clock)

Verified Pushed snapshot

What this building is producing: Production(kind, queue, duration, elapsed, blocked, progress, remaining…); returns None if it's idle. kind 'queue' (training/research/hero; queue has up to 7 slots, [0] is the one in progress) / 'construction' (being built) / 'upgrade' (upgrading a hall/tower); blocked = something is queued but hasn't started (usually not enough food — time to build a Farm); progress 0..1. Opponents' buildings can be inspected too (in fair mode, only buildings you can see).

Mechanism World block production table (Aque/ABnP/AUnP ability objects + elapsed time tracked by the runtime; measured error < 0.2 game seconds)

Verified Pushed snapshot

Four-character codes in the training/research queue ([0] is in progress); idle or not a production building = [].

Mechanism World block production table

Verified Pushed snapshot

All production in progress [(building, Production)]. owner works like units(): 'me' / 'enemy' / player number / 'all'. Pro use: see what units the opponent is training, what tech it's researching, and when it tiers up (once you've scouted the buildings).

Mechanism World block production table

Verified Pushed snapshot

Walking distance for a ground unit from a to b (a and b can be units or (x,y)); None if unreachable. On island maps, use this to decide "can ground units reach this creep camp/expansion" — it's more reliable than straight-line distance (it goes around forests, cliffs and buildings). Precision is one 128 cell; gaps narrower than a cell count as blocked.

Mechanism Map block (engine IsTerrainPathable) + tree block + building footprints, A* on the SDK side (128 per cell)

Verified Pushed snapshot + local compute

Whether it can be reached on the ground (map block not ready = None).

Mechanism Same as above

Verified Pushed snapshot + local compute

Path corner points [(x,y)...] (the last point is b); combine with path(units, points) to move the army along this route (around towers, via side paths).

Mechanism Same as above

Verified Pushed snapshot + local compute

Upkeep level: {'level': 'none'/'low'/'high', 'income': 1.0/0.7/0.4, 'next_at': food count at which the next level starts (None if there isn't one)}. Pro common knowledge: stay at 50 food while teching to tier 3 / getting attack/armor upgrades, and only go up to 80 right before the decisive fight.

Mechanism Fixed 1.27 rule: 0~50 food no upkeep, 51~80 income ×0.7, 81~100 ×0.4

Inferred Pushed snapshot

How much XP the hero still needs for the next level (level 10 = 0).

Mechanism World block level/xp + MiscGame NeedHeroXP formula

Verified Pushed snapshot

Groups the (visible) creeps on the map into camps: [{'x','y','units','level','hp','max_level'}], sorted from nearest to farthest from our main base. level = total camp level (the usual measure of creeping difficulty), hp = total HP. Combine with time_to_kill / path_distance to pick camps.

Mechanism Pushed snapshot (creeps within 600 of each other are grouped together) + levels from units.json

Verified Pushed snapshot

What a buff code is: {'ability','effect','dur','hero_dur','targets'} (e.g. 'Bslo' -> Slow). When a code has multiple rows, the first row is returned.

Mechanism data/game/buffs.json (BuffID -> ability/effect/duration from AbilityData.slk)

Verified Local data

The unit's combat stats combat.UnitStats: max HP/mana, armor (including attack/armor upgrades and hero agility), armor type, movement speed, day/night sight range, weapons (what it can hit, range, attack cooldown, damage range, attack type, splash). u is a unit (automatically uses its owner's tech and its hero level) or a four-character code (player defaults to us). Then use .dps_vs(other) / .hits_to_kill(other) / combat.time_to_kill(group, other). ⚠ Doesn't include items, auras or buffs.

Mechanism Data tables (UnitBalance/UnitWeapons/UpgradeData/MiscGame) + live tech levels + hero level

Verified Pushed snapshot + fast lane (batched every 5 s)

How many game seconds this group of units needs to kill target together (uses target's current HP; accounts for counters, armor and attack/armor upgrades; not for movement, splash or healing). Pro use: focus fire the one that "dies fastest" (smallest time_to_kill) first, not the closest one. Can't hit it = None.

Mechanism stats() + live HP

Verified Pushed snapshot

In-game time of day (hours, 0~24). The game starts at 8 AM; a full day = 480 game seconds (240 seconds each for day and night, scaled by the day/night speed). Returns None when it can't be read (old runtime / not in a game).

Mechanism World block extension area: GetFloatGameState(GAME_STATE_TIME_OF_DAY)

Verified Pushed snapshot

Whether it's night now (18:00~6:00). Pro play: at night creeps are asleep (you get the first hit when creeping, without being surrounded), and every unit's sight range shrinks (a good time for surprise attacks); Night Elf Sentinels/units are invisible next to trees at night. Returns None when it can't be read.

Mechanism World block extension area (daytime is 6~18)

Verified Pushed snapshot

Game seconds until the in-game time reaches hour o'clock (e.g. seconds_until(18) = time until nightfall, for planning night creeping).

Mechanism World block extension area + a 480-second day (measured 20 game seconds per hour)

Verified Pushed snapshot

Items on the ground [Item(addr, handle_lo, handle_hi, type, x, y, life)]. Picking one up or using it emits an item.removed event.

Mechanism World block items[] (ground items only: holder handle is all FF)

Verified Pushed snapshot

Living trees (those whose targType in DestructableData includes tree); given (x,y), sorted from nearest to farthest, up to limit trees. Each is Tree(addr, handle_lo, handle_hi, type, x, y, life), and can be passed straight to gather to harvest lumber.

Mechanism Tree block Local\War3Trees_<pid> (refreshed every 2 seconds)

Verified Pushed snapshot

What happened since the last call: unit.appeared / unit.died / unit.removed / unit.damaged / order.changed / hero.levelup / owner.changed / item.appeared / item.removed / game.started (these come from diffing publishes; precision = publish period 50 ms), plus the engine-level damage / killed (the runtime records them on the game thread as they happen, so there's one for **every single hit**): damage: handle = the unit being hit, .source_addr = who hit it (snapshot().unit_by_addr turns it into a unit), .value = actual HP lost, .raw_damage = pre-armor damage, .attack_type (normal/pierce/siege/magic/chaos/hero/spell), .damage_type killed: this hit killed it, .source_addr = the killer plus production.done, derived by the runtime tracking the production table (precision = publish period): unit = the building, .done_code = four-character code of what finished, .done_kind = 'training' (units/heroes/revives) / 'research' / 'construction' (building completed) / 'upgrade' (tier-up/tower upgrade), .value = game seconds taken Added 09-25: spell.cast: unit = the caster, .spell spell four-character code, b level, value cooldown seconds, x,y cast point (recognized when the spell's cooldown starts; precision = publish period) player.left: .player the number of the player who left / was removed after being defeated; game.ended: left the game selection.changed: the local player's selection changed (get the units with g.selection()) message: a line in an on-screen message frame (game hints, chat, system): .text full text, .frame message frame number, .chat = {'channel', 'sender', 'text'} (when it's chat; this is where you read what the player typed in the chat box) ui.click / ui.hover / hotkey / mouse.world: UI & input (g.ui); .key is the canvas key / hotkey string Each one is Event(seq, kind, clock, addr, handle, type, owner, a, b, x, y, value, extra). Fair mode (fair=True) only gives: events for your own units, events for units visible right now (or still visible within the last 1 second), damage dealt to us or by us, and local UI / message / game events.

Mechanism Event ring Local\War3Events_<pid> (publish diffing + damage events captured by the runtime)

Verified Pushed snapshot

The units the local player has selected right now (the main unit comes first; up to 12). Any change to the selection fires a selection.changed event.

Mechanism W3P world block extension area selAddrs (the runtime includes the local player's selection in every publish)

Verified Pushed snapshot

Messages newly shown in the on-screen message frames since the last call: [{'text', 'frame', 'repeat', 'seq', 'game_ms'}]. Game hints ("You need more farms", "Can't build there"), chat and system messages are all here; frame tells you which message frame. Same batch as the message events in the event stream (each has its own cursor).

Mechanism Shared memory Local\War3Msgs_<pid> (screen messages captured by the runtime)

Verified Pushed snapshot

Research level / number of completed buildings (upgrade chains count: a Castle also counts as htow). player defaults to us; any player can be queried.

Mechanism W3P query q_tech (the engine's player tech count)

Verified Fast lane

The engine's feasibility verdict: 0/220 OK; 3 not enough food, 8 not enough gold, 9 not enough lumber, 32 queue full, 183 missing prerequisite, 185 altar is reviving, 221 no such item/under construction. ⚠ Always 221 for a worker constructing a building, so it can't be used to check placement (use build_near).

Mechanism W3P query q_feasible (engine feasibility check)

Verified Fast lane

Ask many can_do at once: pairs = [(unit, four-character code), ...]; returns a list of verdict codes in the same order (None where it couldn't be asked). When planning what to build/train in a tick, ask about everything at once first — N times faster than one can_do at a time (reference brain 09-23: build planning 76 -> 25 ms).

Mechanism W3P query q_feasible × N, submitted as one batch

Verified Fast lane × 1

Whether we can see this point right now (not in the fog of war/black mask). Bots in fair mode should only use visible enemies.

Mechanism W3P query q_visible (visible / fog of war / black mask)

Verified Fast lane

How much gold is left in a gold mine.

Mechanism W3P query q_mine_gold (the engine's remaining gold in the mine)

Inferred Fast lane

The computer AI's captain: where it's taking its army (you know which part of your base it will attack before it leaves home). Only works against computer opponents; returns None if the unit isn't following a captain.

Mechanism W3P query q_captain (the computer captain that enemy units follow)

Verified Fast lane

The unit's current order, **including ones you just issued this tick** (uses the new order from the receipt until the snapshot catches up). ⚠ 09-23 live game: hello_bot had just sent a peasant to build a Farm, and in the same tick rush_bot saw it as "idle" in the snapshot and sent it to build Barracks, so the Farm was abandoned halfway over and over. When picking "idle/not building" units, use this instead of u.order.

Mechanism Snapshot order + commands just accepted in this process (receipts)

Verified Pushed snapshot

Whether current gold/lumber is enough to buy code (units, buildings; by the prices in units.json). Anything missing from the price table is treated as affordable. ⚠ Tier-up four-character codes have cumulative prices in the table, so this errs on the conservative side; the engine's receipt is the final word.

Mechanism Our resources from the pushed snapshot + prices from units.json

Verified Pushed snapshot

Data for the map being played (openwar3.mapdata.MapData): name_of('HC07') for the names of custom units/items/abilities, hero_names, tooltip. Most units in RPG maps are created by the map itself and aren't in the built-in name table. Returns None for games not started by the launcher (the map file can't be found).

Mechanism Map file (the launcher's --map path): w3u/w3t/w3a + wts; for protected maps, reads the TXT files inside the map

Verified Read file (~0.1 s the first time)

Command 28

Make units do things. Lands in about one frame, with a receipt for every command.

Combine a tick's commands into one batch: with g.batch() as b: g.attack(archers, target) # returns Pending; becomes a receipt only after the block ends g.move(wounded, *home) g.cast(hero, "thunderclap") print(b.sent, b.wait_ms, [r.reason for r in b.receipts]) Sent one by one, every command waits for the game thread once (about 10 ms); a batch waits only once — this is how the reference brain cut a round from 48 -> 26 ms on 09-23. * Claims are still checked per command (a unit held by someone else gets a held receipt immediately and isn't added to the batch); * Commands inside the block return Pending: reading its .ok before the block ends raises an error (the receipt doesn't exist yet); after the block ends, use it like a Receipt; * An exception inside the block = the whole batch is discarded (status 97 cancelled), and the units it held are released; * Queries (can_do / tech / visible …), build_near and buy aren't batched and are still asked immediately — their results are needed on the spot; to ask about many things at once, use can_do_many / tech_many; * A nested with g.batch() merges into the outermost batch; beyond 16 commands the runtime automatically splits it into several segments (one wait per segment).

Mechanism Commands in the block are gathered into one batch and submitted once when the block ends (executed in the same frame, waiting on the game thread only once)

Verified Fast lane × 1

Move to (x,y) without fighting on the way (use this for retreating). Accepts a single unit or a list (ordered together in the same frame). queue='after': go after finishing the current task (inserted after the current order). Receipt values[0] = how many orders this unit has queued after the command (including the current one).

Mechanism W3P point: move (extra bits = queue mode)

Verified Fast lane

Attack target. Uses right-click by default (on an enemy = attack this one; measured 09-23: both the order target and the task target are it). ⚠ The target must be in vision; targets you can't see are rejected (reason code 1001). force=True uses the attack order 0x0F (needed to attack your own units/neutral critters) — measured: it only switches to the attack order and doesn't remember the target, so the unit goes off to attack other enemies nearby. Don't use it to attack a specific target.

Mechanism W3P target: target command (right-click smart)

Verified Fast lane

Stop everything it's doing (order ID 0x000D0004), and clear queued orders too.

Mechanism W3P immediate: stop

Verified Fast lane

Cancel: the last slot of the training/research queue (refunded), a building under construction (75% refunded), or a hall that's upgrading.

Mechanism W3P immediate: cancel

Verified Fast lane

Move through a series of points in order (Shift-click waypoints: patrol routes, routing around towers, scouting routes). attack=True makes every leg an attack-move. Submitted once; one receipt per point (in points order).

Mechanism One batch: the first leg runs immediately, the rest are inserted in reverse order with queue='after' (the engine can only insert right after the current order)

Verified Fast lane × 1

Harvest gold/lumber (target is a gold mine or a tree from trees()). ⚠ Only assign idle workers (idle_workers): re-issuing to a worker that has a task interrupts its harvest cycle. Pro use: go back to mining after building = gather(worker, mine, queue='after') after build(...).

Mechanism W3P target: harvest (gold mine or tree)

Verified Fast lane

Have a worker build code at (x,y) (coordinates aligned to a 32 grid). Receipt accepted = the worker's order is now this building (or the start-construction order); with queue='after' = added to the worker's order queue (receipt values[0] is the queue count). ⚠ Accepted ≠ built: the engine also accepts a spot inside a forest on the spot, and the worker only fails once it gets there (measured 09-23); gold being spent elsewhere can also keep the foundation from appearing. If you don't know where it fits, use build_near (it tracks the result and blacklists failed spots). To build several in a row, use build_queue.

Mechanism W3P build: build order, with the worker's order read back in the same frame to confirm

Verified Fast lane

One worker builds several in order (Shift-queued building): plan = [(four-character code, x, y), ...]. Submitted once; receipts in plan order. ⚠ Gold is deducted only when construction starts (not when queued) — if you queue 3 but can only afford 1, the other two fail when the worker gets there.

Mechanism One batch: the first immediately, the rest in reverse order with queue='after'

Verified Fast lane × 1

Find a spot that fits around (x,y), searching from near to far, and build code there. **Non-blocking** — fine to call every tick: * An attempt for this building type is still in progress (the worker is on its way) -> returns that spot without re-issuing the order; * The last attempt succeeded (the foundation appeared) -> finds a new spot this time if needed; * The last attempt failed (the worker found on arrival that it didn't fit, the engine dropped the order, no foundation) -> that spot is blacklisted for 45 seconds and the next one is tried; * Not enough gold -> returns None right away (no attempt, no blacklisting); returns None once every spot has been tried. ⚠ Why tracking is needed: in 09-23 live games, the engine **accepted on the spot** a point inside a forest, and the worker only failed once it got there (the same-frame receipt can't tell); and the engine's placement check always returns 221 for a worker constructing a building, so you can't "check" before building either. Only obviously occupied spots (the middle of the hall) are rejected on the spot.

Mechanism Per-point build + tracking (foundation appears = success; worker drops the order with no foundation = that spot is blacklisted)

Verified Fast lane × points tried

Train units / research tech / upgrade the hall (tier up = give the hall itself the target hall's four-character code, e.g. 'hkee'). When rejected, the receipt's reason says why (not enough food, not enough gold, not enough lumber, queue full, missing prerequisite…).

Mechanism W3P immediate: four-character code, with the feasibility reason code when rejected

Verified Fast lane

The hero learns an ability (four-character code, e.g. 'AHbz' Blizzard).

Mechanism W3P learn: only counts as learned once the skill points decrease

Verified Fast lane

Cast a spell. spell is an order string ('thunderbolt' Storm Bolt, 'blizzard', 'holybolt' Holy Light…; see data/order-ids.txt) or an order ID. Give target = on a unit; give x,y = on the ground; neither = no target (Thunder Clap, Divine Shield, Summon Water Elemental). An accepted receipt only means the engine accepted it; to see whether it actually went off, check whether cooldown() shows a cooldown or buffs() shows the buff.

Mechanism W3P target / point / immediate (chosen by arguments)

Verified Fast lane

Revive a dead hero at the altar (if hero isn't given, revives the first one in the list). Common rejection reasons (written in the receipt's reason): not enough food (heroes cost food too), not enough gold, died too recently (a hero can only be revived about 3 game seconds after dying), revive already in progress (the engine clears that slot on the spot once it's accepted).

Mechanism W3P revive: dead hero list -> the altar casts revive on the dead hero

Verified Fast lane

The hero goes to pick up an item from the ground (item comes from items_on_ground). Once picked up, it appears in the inventory and an item.removed event is emitted for the ground item.

Mechanism W3P target: right-click the item

Verified Fast lane

Drop the item in inventory slot slot at (x,y) (the hero walks over and puts it down).

Mechanism W3P item_drop (mirrors JASS UnitDropItemPoint: dropitem 0xD0021 on a point + the item as the instant target)

Verified Fast lane

Give the item in inventory slot slot to to (another hero / unit; the hero walks over and hands it over). Giving it to a shop = selling it (see sell_item).

Mechanism W3P item_drop (mirrors JASS UnitDropItemTarget: dropitem on a unit)

Verified Fast lane

Sell the item in inventory slot slot to a shop (the hero must walk next to the shop; only sellable items are accepted, for half the price).

Mechanism Same as give_item, with the shop as the target (measured: Staff of Sanctuary sells for 125 gold)

Verified Fast lane

Move an item within the inventory (from slot slot to slot to_slot; if both slots hold items, they swap). Useful for arranging hotkey positions.

Mechanism W3P target: order 0xD0022 + slot number, target = the item (mirrors JASS UnitDropItemSlot)

Verified Fast lane

Buy an item at a shop (for a hero standing next to the shop). If a tech prerequisite is missing, the engine returns 0 and no gold is spent.

Mechanism W3P buy: the shop sells to a nearby hero

Inferred Fast lane

Human Call to Arms: Peasants become Militia (a tier-1 Town Hall doesn't have this ability; only works on a Keep/Castle).

Mechanism W3P immediate: townbellon/off

Verified Fast lane

Game control 9

Game speed, pause, publish interval, speech bubbles, canvas, UI & input, messages.

UI & input (openwar3.ui.UI): clickable buttons and choice cards, hotkeys, picking a position by clicking the ground, where the mouse is pointing. The game never receives the click that lands on a button; pure local input + local drawing, so it's safe in multiplayer.

Mechanism W3P 74 input_enable + shared memory Local\War3Input_<pid> (the runtime receives window input)

Verified Shared memory

Pause / resume the game. While paused, the engine clock stops, but the fast lane can still issue orders (event dispatch keeps running).

Mechanism W3P pause

Verified Fast lane

Publish period of the world state (16~1000 ms, default 50). One sample takes about 0.5 ms, so even 33 ms is fine; there's a single value shared machine-wide, and the last write wins.

Mechanism World block requestedPeriodMs

Verified Pushed snapshot

Show a chat bubble over a unit's head (for streaming/debugging; doesn't affect the game). Returns False if the bubble didn't appear; the reason is in g.last_say_error.

Mechanism Action 56

Verified Control channel

Print a line in the message area at the bottom left of the game (visible only on this machine). The game must have shown a notice on its own first (the DLL grabs the message box from that one).

Mechanism Action 45

Inferred Control channel

End this game process (farm.py --keep automatically starts the next game according to next_game.json).

Mechanism Action 22

Verified Control channel

Canvas: draw text boxes, panels, progress bars, images, circles on the ground and routes on the game screen (openwar3.canvas.Canvas). Drawn by the runtime itself — no game handles created, no game state changed — so it's safe in multiplayer; style it however you like (CJK text, rounded corners, translucency).

Mechanism W3P 73 canvas_enable + shared memory Local\War3Canvas_<pid> (drawn by the runtime every frame just before the game draws the mouse cursor; the cursor covers it)

Verified Shared memory

Press Space once on the "Press any key to continue" loading screen. Many RPG / story maps need a key press after loading before they start (measured on WarChasers, 09-24: without it the game sits on the loading screen, the game clock stays at 0 and the fast lane never drains). openwar3.run presses it itself while waiting to enter the game, so you rarely need to call it by hand.

Mechanism PostMessage WM_KEYDOWN/UP Space to the game window (doesn't steal focus)

Verified Window message

Sandbox 6

JASS channel: spawn units, set alliances, rename players, show text… for RPG helpers and companions. It can change the world only in single-player games and local tools.

Call any JASS native by name: g.jass.CreateUnit(g.jass.Player(1), "Hpal", x, y, 270.0). Arguments I/R/B/S/H are converted automatically (pass unit/item objects directly); in multiplayer only read-only natives can be called. See openwar3/jass.py and docs/COMPANION_ZH.md for details.

Mechanism W3P 70 jass (the runtime looks the name up in the native table, 1291 entries)

Verified Fast lane

The 16 player slots: controller (user = human / computer / neutral…), state (empty / playing / left), human, me, ally (whether it's allied with me). Use it in RPG maps to find an empty slot for a companion, or to tell whether it's a single-player game.

Mechanism JASS GetPlayerController / GetPlayerSlotState / IsPlayerAlly

Verified Fast lane

Create a unit at (x,y) (player defaults to the local player) and return it as a snapshot unit (after the next world publish, ~50 ms); returns None if it can't be created. The returned unit has an extra attribute, jass_handle. ⚠ Single-player only (it desyncs in multiplayer).

Mechanism JASS CreateUnit + W3P 72 handle -> unit

Verified Fast lane

Connection and utilities 2

Connection status and pure computation helpers.

Connection status: pid, world publishing (period, sampling time), fast lane counters.

Mechanism World block + fast lane + claim table

Verified Local compute

The one closest to to (a unit or (x,y)); returns None if there are no candidates.

Mechanism Pure computation

Verified Local compute