Skip to content

145 computer players 3 navigation

Alex Diakovsky edited this page Nov 20, 2026 · 3 revisions

145. Computer players, part 3: navigation

Question: phase 2 of document 142: how does a computer player get from where it is to where it wants to be? It must go round buildings, water and walls, through gates of its own side, and shoot its way through where there is no other way.

Document Covers
142 The plan: the layers, skill levels, the order of work
143 What a computer player is, and how it plugs in where a person would be
144 The brain: what it decides each tick
145 (this one) Navigation: the map of where a vehicle can drive, the path, following it, breaching, getting unstuck, and the harness that tests it on the real maps
146 Combat: targets, leading, the turret, flying a copy of the shot before firing, raised fire, turrets, the Drone, no spawn camping

A port feature. The original has no computer-driven vehicle (document 113). Nothing here is traced, but everything it measures is the match's own traced rules:

The answer, up front

  1. A navigation grid per vehicle type and side. It asks the match's own collision code, through an invisible probe vehicle of that type: can it stand on this tile, and can it drive from this tile's centre to the next? Each answer is worked out the first time a search needs it, then kept.
  2. Steps, not just tiles. A tile's centre being clear is not enough: a vehicle driving across can still clip a shape near the edge, or a shore tile's deep corner. Every step is checked by driving the probe along the line, every 8 px, at the line's heading, keeping 10 px from deep water.
  3. Walls and gates that can be shot down are breaches. They are passable at a high cost, so a path goes round when there is a reasonable way and through when there isn't. The navigator shoots the breach down, then drives on.
  4. A* finds the path; the navigator follows it. It steers at a point a little ahead on the line, not at the waypoint, drives forward only when nearly facing it, and backs up and replans when it is stuck.
  5. The brain now goes somewhere. With no enemy in sight it drives to the other side's base; with one in sight but no clear shot, it drives round to one.
  6. A headless harness runs two computer players against each other on the real maps. It found every one of the problems this document fixes. On every map in the sample where a land route joins the bases, they meet and nobody stays stuck. Where only water joins them, they can't meet until phase 5 brings the Heli and the swimming Jeep.

Words used here

Word Means In the code
grid one vehicle type's and one side's map of costs and steps for a match NavGrid, NavGrid.for_vehicle
probe an invisible vehicle of that type, never added to the scene: only its shape and rules are used NavGrid._probe
tile cost what entering a tile costs a path: 1 on open ground, less on a road, more in shallow water or for a breach, INF when blocked NavGrid.cost
step driving from a tile's centre to one of its eight neighbours' NavGrid.step_rule
plain tile no tile shape within reach of a vehicle on it, and plain land or plain shallow water: a step between two needs no checking NavGrid._plain
breach a tile or step blocked only by tiles that can be shot down STEP_BREACH, BREACH_COST, first_breach
leg the straight stretch of a path from one waypoint to the next AINavigator._leg_start, path[0]
carrot the point on the leg the vehicle steers at, a little ahead of where it is AINavigator.carrot
watch re-checking tiles round a reported change, until the level shows it NavGrid.watch

Step 1: asking the match's own collision code, without side effects

A moving vehicle's collision test is MatchController.vehicle_blocked: the nine tiles round it, each tile's shapes, and each shape's callback deciding whether it blocks (document 54). But the callbacks also do things. A zone shape remembers that the vehicle entered a refuel or rearm zone, the ruin hands over its flag, and a fast enough vehicle crushes bushes and crates. A planner may not set any of that off, so the decision is now split out as a pure rule, used by both:

vehicle_blocked and terrain_rule_at both go through _for_tile_shapes_hit and tile_shape_rule; only vehicle_blocked's _tile_blocks_vehicle adds the effects (zones, the ruin's flag, crushing)

Mermaid source
flowchart TB
  VB["vehicle_blocked(v, at, heading)<br/>a vehicle really moving"] --> FT["_for_tile_shapes_hit<br/>the nine tiles, their shapes,<br/>layer, mask and z rules"]
  TR["terrain_rule_at / terrain_blocker_at<br/>planning: touches nothing"] --> FT
  FT --> R["tile_shape_rule(v, info, shape)<br/>PASSES, BLOCKS or CRUSHES"]
  VB --> FX["_tile_blocks_vehicle<br/>the rule, plus the effects:<br/>zone remembered, ruin's flag,<br/>crush at speed"]
  FX --> R
Loading

The rule (game/match_controller.gd):

func tile_shape_rule(v: Vehicle, info: Dictionary, sh: Dictionary) -> int:
	match String(info.get("callback", "0x0")):
		"0x436640":
			if int(sh["mask"]) == 4:
				return SHAPE_PASSES
			if v.rule("terrain.blocked_by_bushes"):   # FUN_00436640 tests the Jeep's type: it cannot flatten bushes
				return SHAPE_BLOCKS
			return SHAPE_CRUSHES
		"0x436610":
			return SHAPE_BLOCKS if v.rule("terrain.blocked_by_rocks") else SHAPE_PASSES   # FUN_00436610: rocks stop only the Jeep
		"0x4366f0":
			# FUN_004366f0: a shape whose byte +8 has bit 1 is a zone a vehicle may enter (byte +9: 1 refuel, 2 rearm, 3 pick-up)
			return SHAPE_PASSES if (int(sh.get("b8", 0)) & 2) != 0 else SHAPE_BLOCKS
		"0x432d80":
			return SHAPE_BLOCKS  # the ruin: it answers 0, so the tile's posts still block
		"0x436a50":
			return SHAPE_CRUSHES   # crates
	return SHAPE_BLOCKS

Translation: the same decisions the callbacks always made, as an answer only. "Crushes" means passable at speed: a vehicle faster than 0.5 units a tick flattens the bush or crate, a slower one is stopped. The real collision (_tile_blocks_vehicle) now asks this rule and then does what touching does. Its behaviour is unchanged: the crush, gate, dock, ruin and playthrough checks all still pass.

The planning query adds two things a vehicle in motion doesn't need:

func _terrain_hit(v: Vehicle, at: Vector2, heading_deg: float, own_side: int, ignore: Dictionary, worst: Array) -> Vector2i:
	var poly := v.polygon_for(at, heading_deg)
	return _for_tile_shapes_hit(v, poly, at, func(t: Vector2i, id: int, info: Dictionary, sh: Dictionary) -> bool:
		if ignore.has(t) or (own_side >= 0 and pack.gates.has(str(id)) and level.get_variant(t.x, t.y) == own_side):
			return false
		var r := tile_shape_rule(v, info, sh)
		if r == SHAPE_CRUSHES:
			worst[0] = SHAPE_CRUSHES
		return r == SHAPE_BLOCKS)
  • Gates of its own side count as open. A gate opens for its own side's vehicles (document 56), so to the planner it is not in the way.
  • ignore leaves out tiles as if they were already destroyed: that is how a breach is tested (step 4).

Step 2: tiles and steps

Why a tile's centre is not enough: left, a vehicle parked at a tile's centre clears a shape near the tile's top edge, but driving to the next tile it clips it; right, a shore tile is shallow at its centre and along the line, but deep within the margin to one side

The first version checked only tiles: stand the probe on the centre at four headings. The harness showed why that isn't enough (step 8):

  • vehicles kept stopping against a "passable" tile whose shape sat near its edge;
  • one drove into deep water across a shore tile that is shallow at its centre.

So the grid answers two questions.

A tile's cost, the first time a search reaches the tile (_sample_tile):

The probe on the tile's centre Cost
deep water (a vehicle with a water module sinks) INF
a blocking shape at all four headings, only from tiles that can be shot down BREACH_COST = 12
a blocking shape at all four headings, anything else INF
passes only by crushing (bushes, crates) CRUSH_COST = 1.5
shallow water (0.75 of the speed) 1 / 0.75 = 1.33
a road (1.2 of the speed, document 94) 1 / 1.2 = 0.83
open ground 1

A step's rule, the first time a search tries it (step_rule and _drive_line):

func step_rule(t: Vector2i, dir: int) -> int:
	var k := _index(t) * 8 + dir
	if _step[k] == STEP_UNKNOWN:
		var n: Vector2i = t + _DIRS[dir]
		var r := STEP_BLOCKED
		if inside(n):
			r = STEP_PASSES if _plain(t) and _plain(n) and _plain(Vector2i(n.x, t.y)) and _plain(Vector2i(t.x, n.y)) \
					else _segment_rule(centre_of(t), centre_of(n))
			steps_sampled += 1
			_step[_index(n) * 8 + _REVERSE[dir]] = r   # the way back crosses the same ground
		_step[k] = r
	return _step[k]

and the line itself:

	for k in n + 1:
		var p := a.lerp(b, float(k) / n)
		var t := tile_of(p)
		if not inside(t):
			return STEP_BLOCKED
		if floats:
			for q in [p, p + perp, p - perp]:
				if _deep_at(q):
					return STEP_BLOCKED
		if _signature_cached(t) != 0:
			var r := mc.terrain_rule_at(_probe, p, heading, side, ignore)
			if r == MatchController.SHAPE_BLOCKS and not _breachable_at(p, heading, ignore, found):
				return STEP_BLOCKED
			crush = crush or r == MatchController.SHAPE_CRUSHES
	if not ignore.is_empty():
		return STEP_BREACH
	return STEP_CRUSHES if crush else STEP_PASSES

Translation: every 8 px along the line, the probe stands at the line's heading. The point and the two points 10 px to either side must not be deep water, and the probe must clear the tile shapes. A shape that blocks is acceptable only if every tile blocking there can be shot down: then the step is a breach.

Keeping it fast. Most of a map is open, so a step between two plain tiles passes at once. A tile is plain when no coastal id within its 3 x 3 neighbourhood has a shape and its water is the same all over (land, or shallow). _water_kind reads that from the art alone, with the rules of Water.class_at. Deep and shore tiles are tested point by point only where a line crosses them.

How a step is decided: two plain tiles pass at once; otherwise the probe drives the line, every 8 px checking deep water on the line and 10 px either side, then the tile shapes; a blocking shape that can be shot down makes the step a breach

Mermaid source
flowchart TB
  S["a step: tile T to neighbour N"] --> P{"all plain?"}
  P -- yes --> OK["PASSES"]
  P -- no --> L["drive the probe along the line,<br/>every 8 px, at its heading"]
  L --> W{"deep water?"}
  W -- yes --> BL["BLOCKED"]
  W -- no --> SH{"a shape<br/>blocks?"}
  SH -- no --> NX["next point"]
  SH -- yes --> DS{"can be<br/>shot down?"}
  DS -- no --> BL
  DS -- yes --> IG["set it aside"] --> NX
  NX --> R["line done:<br/>something set aside - BREACH<br/>crushable only - CRUSHES<br/>else - PASSES"]
Loading

Who flies, who floats. A rotor vehicle (the Heli, lands_before_docking()) flies: every tile and step passes, and its path is a straight line. A vehicle without a water module never sinks, so water does not block it.

One grid per (vehicle type, side), shared. The grid is kept on the match (for_vehicle, the match's ai_nav_grids meta). Every computer player of that side driving that type uses the same one, and nothing in MatchController knows it exists. Different sides need their own grids because their gates differ.

Step 3: the search

find_path(from, to) is an A* search over the eight neighbours of each tile. A move costs the tile's cost, times 1.41 for a diagonal. The step must not be blocked, a diagonal may not squeeze past two blocked corners, and a tile with a known mine costs 25 more.

		for di in 8:
			var d: Vector2i = _DIRS[di]
			var nt: Vector2i = ct + d
			var c := cost(nt)
			if c == INF:
				continue
			var diagonal: bool = d.x != 0 and d.y != 0
			if diagonal and (not passable(Vector2i(ct.x + d.x, ct.y)) or not passable(Vector2i(ct.x, ct.y + d.y))):
				continue   # no squeezing between two blocked corners
			var step := step_rule(ct, di)
			if step == STEP_BLOCKED:
				continue
			if step == STEP_CRUSHES:
				c = maxf(c, CRUSH_COST)
			elif step == STEP_BREACH:
				c = maxf(c, BREACH_COST)
			if mc.mine_tiles.has(nt):
				c += MINE_COST
  • The estimate is the octile distance at the cheapest tile cost (a road's 0.83), so the search never overestimates and finds the cheapest path.
  • An unreachable goal (blocked, or walled off by water) gives a path to the reachable tile nearest it, not nothing.
  • Mines: the ones the match records in mine_tiles are the ones the radar shows a player (the tile word's bit 31, drawn in colour 0xc9), so avoiding them is fair.
  • Simplifying. The path comes back as tile centres. simplify keeps, from each point, the farthest of the next 10 waypoints the vehicle can drive to in a clear straight line (line_clear, the same probe test as a step). A breach is never a clear line, so the waypoint before it is kept.

Step 4: breaches

A wall, a building, or the other side's gate is shot down by shells. A tile can be shot down when its coastal id has hit points (MatchController.tile_destructible, which reads the coastal damage table, document 44).

func _breachable_at(p: Vector2, heading: float, ignore: Dictionary, found: Array = []) -> bool:
	var mc: MatchController = _mc.get_ref()
	for i in 6:
		var b := mc.terrain_blocker_at(_probe, p, heading, side, ignore)
		if b.x < 0:
			return true
		if not mc.tile_destructible(b):
			return false
		ignore[b] = true
		if found.is_empty():
			found.append(b)
	return false

Translation: ask which tile blocks. If it can be shot down, set it aside and ask again. If, once every blocker that can be shot down is set aside, nothing blocks, it is a breach. A blocker that can't be shot down (rock, a cliff) makes it a wall for good.

BREACH_COST (12) is "about a dozen tiles of detour". With a gap two tiles away the path goes round; with the bases walled in it goes through. The navigator does the shooting (step 6).

Step 5: tiles that change

Buildings fall, bushes are flattened, gates open and close. The match reports each (tile_destroyed, tile_crushed, gate_created, gate_removed), but the level scene changes the tile some time later, after its explosion (TerrainView3D._apply_tile_destroyed). So the grid cannot just recompute when the report comes. It watches the tile and its neighbours for 20 seconds instead:

A tile changing: a shell destroys a wall, the match reports it and every grid watches the tiles round it; the scene changes the tile later; at the next search the grid sees the neighbourhood signature changed and works those tiles and steps out again

Mermaid source
sequenceDiagram
  participant MC as MatchController
  participant G as NavGrid
  participant TV as level scene
  MC->>G: tile_destroyed(t)
  G->>G: watch t and its neighbours (20 s)
  Note over TV: the explosion plays
  TV->>TV: the tile gets its destroyed id
  G->>G: next search - each watched tile's<br/>neighbourhood signature compared
  G->>G: changed - forget its cost and steps<br/>(worked out again when reached)
Loading

The signature is a hash of the 3 x 3 coastal ids round a tile. A tile whose signature is unchanged keeps its answers; one that changed forgets them, with every step into or out of it and its neighbours.

Correction (stage S5.5a, document 166): the 20 seconds were wall-clock time (Time.get_ticks_msec()), so a headless run, many times faster than real time, watched for a varying number of ticks and could choose differently from one run to the next. The watch now counts match ticks: WATCH_TICKS = 1250, 20 seconds at 62.5 ticks a second.

Step 6: following the path

AINavigator.steer(mc, v, goal, prev) returns the bits of the input word that take the vehicle toward goal:

The navigator each tick: backing up if recovering; planning when the goal moved or every 150 ticks; dropping reached waypoints; waiting if the goal cannot be reached; shooting a breach on the planned leg; otherwise steering at the carrot, forward only when nearly facing it; then the stuck watch

Mermaid source
flowchart TB
  A["steer"] --> R{"recovering?"}
  R -- yes --> BK["one of four moves:<br/>back or forward, turning"]
  R -- no --> PL{"replan due?"}
  PL -- yes --> PLN["find_path + simplify"] --> DR
  PL -- no --> DR["drop reached waypoints"]
  DR --> UR{"goal out<br/>of reach?"}
  UR -- yes --> WT["wait"]
  UR -- no --> BR{"breach on<br/>the leg?"}
  BR -- yes --> SH["shoot it down"]
  BR -- no --> CA["steer at the carrot"]
  SH --> SW["stuck watch"]
  CA --> SW
Loading
  • Recovering: after getting stuck it makes one of four moves for 30 ticks, then plans again (below).
  • Replan due: the goal moved to another tile, or 150 ticks have passed since the last plan (tiles change, the vehicle drifts).
  • Goal out of reach: no path left, not at the goal, and no clear line to it. The path ended on the reachable tile nearest the goal, so it waits there.
  • Breach on the leg, carrot, stuck watch: below.

Following a leg: a vehicle that drifted off the line steers at a point a little ahead on the leg, which brings it back onto the line before a one-tile gap between walls; steering straight at the waypoint would cut in at an angle, into the wall

The carrot. Gates and gaps between walls are one tile wide: 32 px, for a Tank 15 px wide. Steering straight at the next waypoint cuts in at an angle from wherever the vehicle is. So it steers at a point 28 px ahead of its place on the leg instead, which pulls it back onto the line:

static func carrot(pos: Vector2, start: Vector2, wp: Vector2) -> Vector2:
	var seg := wp - start
	var length := seg.length()
	if length < 1.0:
		return wp
	var along := clampf((pos - start).dot(seg) / length, 0.0, length) + LOOKAHEAD_PX
	return wp if along >= length else start + seg / length * along

Turn first. It presses UP only while the carrot is within 25 degrees of its nose. The first version drove on at up to 60 degrees and swung a tile wide out of its base, into its own wall (step 8).

Breaching. The navigator looks for a breach on the planned leg, from the last waypoint to the next, never on the line from wherever the vehicle has drifted to. So it shoots only what the path chose to go through, never a wall it happens to face. It faces the breach tile, closes to within 80 px, and fires when within 6 degrees (the fire rules of AIMotor.fire: never while it could dock, a fresh press for a press-only weapon). It checks again every 20 ticks; once the tile has fallen, the leg is clear and it drives on.

Stuck. When it has been pressing directions for 45 ticks and has neither moved 6 px nor turned 8 degrees, it is stuck. For 30 ticks it makes one of four moves, the next one each time it is stuck: back turning left, back turning right, forward turning left, forward turning right. Then it plans again.

Two details matter here, and the harness found both:

  • Turning counts as progress. A Tank pressed against a wall can be unable to turn, because its corners would swing into the wall, and it never tries to drive forward (the carrot is too far off its nose). The first version only watched for movement, so a turn-locked vehicle sat there for good.
  • The moves take turns. A Tank that turned sideways to fire inside a narrow corridor can only turn back from the corridor's middle, and backing up may just press it against the other wall. Trying forward as well as back works it free.

Step 7: what the brain does with it

The brain while driving: an enemy within 500 px and a clear line within 300 px - engage; within sight but no clear shot - approach via the navigator; nobody in sight - advance to the nearest enemy base via the navigator; breach while the navigator shoots its way through

Mermaid source
flowchart TB
  D["driving"] --> E{"enemy within<br/>500 px?"}
  E -- yes --> C{"clear shot<br/>within 300 px?"}
  C -- yes --> EN["engage"]
  C -- no --> AP["approach<br/>(navigator)"]
  E -- no --> AD["advance to the<br/>enemy base (navigator)"]
  AP --> BRE["breach, while the navigator<br/>shoots its way through"]
  AD --> BRE
Loading

"Advance to the enemy base" is an interim goal. It makes two computer players meet so navigation and fighting can be tested; phase 4 replaces it with the real objective (the targets, the flag). The motor pieces of document 144 (the choice, turning toward a point, the fire rules) moved into AIMotor, shared by the brain and the navigator.

Step 8: the harness, and what it found

tools/tests/ai_match_harness.gd (openfire) runs two computer players against each other on Return Fire's two-sided maps, headless. It has no level scene: it steps every node of the match each tick, and applies destroyed tiles the way the scene does. Per map it reports:

  • whether a land route joins the two bases (A* with breaches allowed), and how long it is;
  • the tick they first came within sight, and how close they got;
  • how often they got stuck, and the work the grids did;
  • the time per tick, the shots fired, the tiles shot down, and how the match stood at the end.
RF_AI_LEVELS=all RF_AI_TICKS=6000 godot --headless --audio-driver Dummy --path . --script res://tools/tests/ai_match_harness.gd

Each bug below was found by a harness run, in this order:

Run What it showed Cause Fix
1 five maps with a vehicle stuck for 10 s or more; a Tank drowned tiles judged by their centre only steps checked as driven, with the water margin (step 2)
1 no shot ever hit the harness never stepped the shells (they are nodes of their own) the harness steps every node
2 three maps where the players never meet the bases are walled in, or water lies between breaches (step 4); water needs phase 5
3 a Tank stuck by its own base's gate, and shooting its own wall it turned while already driving, swung a tile wide, then "breached" the wall it faced the carrot, turn first, breaches on the planned leg only (step 6)
4 a Tank pressed against a wall for 16 s, never counted as stuck it could not turn there, and turning is not driving the stuck watch counts turning too (step 6)
5, all 104 maps two maps with a Tank wedged sideways in a corridor for a long time it turned to fire inside the corridor; backing up only pressed it against the far wall the four recovery moves in turn (step 6)
5, all 104 maps two maps with a land route where they never met one: both still driving the whole time on a 16,010 px route round the map's edge, longer than 96 s allows; the other: slow breaching the harness counts a missed meeting only on a route it is possible to drive in the time

The sample of every tenth two-sided map, after the fixes of runs 1 to 4 (6,000 ticks = 96 s each):

Map Land route Met at tick Closest (px) Stuck Shots Tiles shot down
RFMAP101 yes 303 16 0 109 / 109 0
RFMAP111 yes 463 15 1 105 / 105 0
RFMAP121 yes 530 24 0 91 / 91 7
RFMAP131 no 365 131 0 0 / 0 0
RFMAP141 no never 1152 7 0 / 0 4
RFMAP151 no 303 175 0 0 / 0 0
RFMAP161 yes 1529 120 0 68 / 68 0
RFMAP171 yes 303 60 0 63 / 83 1
RFMAP181 no never 623 3 0 / 0 0
RFMAP191 yes 967 57 1 65 / 61 34
RFMAP201 yes 577 26 1 61 / 59 23
  • Where a land route joins the bases (7 maps), they meet within 5 to 25 seconds and fight; vehicles die, respawn and spend stock. RFMAP191 and RFMAP201 have walled bases, which they shoot their way into (34 and 23 tiles).
  • Where only water joins them (4 maps), a Tank can't get there. RFMAP131 and RFMAP151 have the bases within sight across the water, so they face each other with no clear line. RFMAP141 and RFMAP181 wait on the shore. RFMAP151's bases, for example, are 11 tiles apart with four tiles of deep water between (art 2 at (63, 64) to (66, 64)). Phase 5 (the Heli, the swimming Jeep) is what reaches them.
  • Cost: 0.3 to 4 ms per tick for the whole match, both brains included. The grids work out a few thousand tiles and steps per map, far fewer than the 16,384 tiles of a 128 x 128 map times eight steps.

All 104 two-sided maps, after every fix (run 6, 6,000 ticks each, about an hour): ai_match_harness: 104 maps, 0 with a long stick or no meeting on a drivable land route.

Maps
a land route joins the bases (breaches allowed) 72
... and the players met 70 (at tick 885 on average, 5,596 at the latest)
... and they didn't meet, because the route is longer than 96 s of driving 2 (RFMAP173: 16,010 px round the map's edge; RFMAP174: 4,993 px)
only water joins the bases (phase 5) 32 (on 13 of them the bases are within sight across the water)
no vehicle stuck for 10 s or more 104
tiles shot down on the way 564, on 66 maps
shots fired on 77 maps

The navigator got stuck about twice a map on average (23 at most, on a map with walled bases and narrow gaps), and came free every time. The whole match took 1.2 ms a tick on average, 6.6 ms at most, both brains and their grids included.

What it can't do yet

It can't Fixed in (document 142)
cross water (the Heli flies over in the grid, but the brain never picks it; the Jeep doesn't swim) 5. other vehicles
lead a moving target, or check the line of fire for its own side 3. combat
use the turret or raised fire to shoot over things 3. combat
go for the targets and the flag instead of the base 4. the objective
avoid turrets on its way (it drives past them and takes the hits) 3. combat / 4. the objective
see only what a player would (it knows where every enemy vehicle is within 500 px, walls or not) 6. skill profiles

Tests

  • Engine, tests/ai_navigation_check.gd (32 checks on the synthetic pack, with a wall, a gap and a bush added to the level):
    • one grid per type and side; open ground 1, wall INF, bush CRUSH_COST; tiles worked out only when asked;
    • a path round the wall through the gap, never through it, no corner cutting; a blocked goal ends on the nearest reachable tile;
    • clear and blocked lines; simplify; a reported change seen, and seen closing again;
    • a known mine driven round;
    • stuck: backing up turning, then driving on;
    • a computer player driving round the wall to an enemy behind it, then engaging;
    • breaching: a destructible wall is a breach; with the gap near it goes round; walled in it goes through; the breach tile on the leg; firing at it when facing it; turning to it first.
  • Engine, tests/ai_player_check.gd: out of sight, it now heads for the enemy base.
  • Openfire: the harness above. The checks that cover the refactored collision code pass unchanged: crush_sound_check, dock_check, dock_sink_check, flag_pad_check, gate_sound_check, ruin_access, tile_shatter_check, vehicle_behaviour_trace_check and playthrough_rfmap001.

Where the code is

File What
game/ai/nav_grid.gd NavGrid: tile costs, steps, breaches, the search, clear lines, watching changes
game/ai/ai_navigator.gd AINavigator: planning, the carrot, breaching, getting unstuck
game/ai/ai_motor.gd AIMotor: the choice word, turning toward a point, the fire rules
game/ai/ai_brain.gd AIBrain: engage, approach, advance
game/match_controller.gd tile_shape_rule, _for_tile_shapes_hit, terrain_rule_at, terrain_blocker_at, tile_destructible
tools/tests/ai_match_harness.gd (openfire) the harness

Next: phase 3, combat: document 146.

Clone this wiki locally