HomeALiVE 3Docs
Menu
Donate

ALiVE.OS · ALiVE 3 Development

Pathfinding

How ALiVE's units find their way around the map: what it does, and what has been fixed.

On by default · ALiVE 3

ALiVE 3 is in active development. This briefing describes work in progress, and the behaviour it covers is subject to change as testing continues. Check the changelog at the foot of the page for what has moved recently.

On this page

Overview

What pathfinding does

ALiVE runs most of a mission's units in the background, out of sight of any player, so an entire battlefield can play out at once. Pathfinding plans the routes for every unit ALiVE manages as a profile, whether it is simulated in the background or spawned near a player: instead of drifting in straight lines through hills, forests and water, they follow sensible routes across the terrain. A simulated group is moved along its route by ALiVE, and a spawned one gets the same route as its own waypoints.

It is enabled by default and sizes its route grid to the map automatically, so units cross the terrain the way you would expect without any setup.

How a route is built, part 1: the order A group is given an order, by the AI commander, logistics, a patrol or another module. If pathfinding is off, the order stays a single waypoint and no route is worked out. If it is on, which is the default, a start point is picked (where the group is, or the end of the order queued before it) along with movement rules for foot, vehicle, boat, helicopter or plane, and the request joins a queue that works on one route at a time, a little every frame. 1 · THE ORDER A group gets an order AI commander, logistics, patrols and others Pathfinding on? The order stays one waypoint; no route is worked out no yes (default) Start point picked where the group is, or the end of the order queued before it Movement rules picked foot, vehicle, boat, helicopter or plane; a group riding in a vehicle uses its rules Queued one route at a time, a little every frame on to 2
How a route is built, part 2: the search A boat gets a water-only search, shown in the boat diagram. For everything else, a goal in deep water is moved to the nearest land for the search. No search is needed for a plane, or when start and goal share one sub-sector (the route is one point at the goal), or when there is no dry land near the goal (the route stays at the start). Otherwise a rough route is found across the grid's sectors, then a detailed route across the sub-sectors, steered by the rough one. A group boxed in at its start follows the rough route and its order stays where it was given. If the goal is out of reach the route ends at the closest point reached and the order moves there. Routes that reach the goal, or end at the closest point, are tidied by merging near-straight bends. Every result is handed back. 2 · THE SEARCH Moving by boat? Water-only search, shown in full in the boat diagram yes no Goal in deep water: the route aims for the nearest land instead Search needed? A plane, or start and goal in one sub-sector: one point, at the goal No dry land near the goal: the route stays at the start no yes Rough route across the sectors Detailed route across the sub-sectors, steered by the rough one Boxed in at the start: follows the rough route; the order stays put Goal out of reach: ends at the closest point reached; the order moves there got there Route tidied near-straight bends (under 15°) merged handed back, on to 3
How a route is built, part 3: the waypoints Finished routes are applied in the order they were asked for, and a route still being worked out holds up the ones after it. Each point of the route becomes a move waypoint, and the last one is the order itself, so its actions still run on arrival. A spawned group gets the points as the AI's own game waypoints; a simulated group is moved by ALiVE from point to point. 3 · THE WAYPOINTS Applied in order a route still being worked out holds up the ones after it Each point becomes a move waypoint The last one is the order itself, so its actions still run on arrival Group spawned? The points become the AI's own game waypoints yes no, simulated ALiVE moves the group from point to point
How a group's order becomes a route. Rounded boxes ask a question, dashed boxes are the fallbacks, and every result is handed back the same way. The boat branch is shown in full further down.
The same steps on a map: one route from a group to its objective An illustration on a made-up patch of map, not a real one. A lake, a steep hill and a dense forest lie between a group on the left and its objective on the right, with a road winding between them, and a 5 by 4 grid of sectors drawn over the whole map. Without pathfinding the group would take the dashed straight line, into the lake and over the hill. The rough route is a chain of six sectors, up from the group's sector and along the row to the objective. The detailed route threads through the sub-sectors of those sectors only: north round the lake, along the road between the forest and the hill, then down to the objective. Bends under 15 degrees are merged, so waypoints sit only where the route turns, and the last waypoint is at the objective. THE SAME STEPS ON A MAP dense forest lake deep water steep hill road group objective without pathfinding straight into the lake and over the hill 1 · THE ORDER group: the route starts here objective: the order's position 2 · THE SEARCH sector sub-sector, a finer grid rough route: a chain of sectors detailed route through their sub-sectors 3 · THE WAYPOINTS waypoint: only where it bends bends under 15° are merged, so straight runs carry no dots; the last one sits on the objective WITHOUT PATHFINDING a straight line, into the lake and over the hill
Illustration, not a real map: the rough route picks a chain of sectors, the detailed route threads through their sub-sectors around deep water, steep slopes and dense forest, and the group gets a waypoint at each bend. The dashed line is the straight line it would take without pathfinding.

Capabilities

What it handles

Routes

Real routes, not straight lines

ALiVE's units, simulated or spawned, follow the terrain across a route grid that sizes itself to the map, rather than cutting through whatever lies between them and their goal.

Land & water

Stays out of the water

Foot and ground units route around lakes, rivers and coastline instead of marching into the sea.

Boats

Rivers and crossings

Boats get a water route that follows rivers as well as open sea, cross water cleanly without zig-zagging or stalling at the shore, and infantry embark boats to cross water and continue on the far side.

Airfields

Around the runway

Ground routes bend around runways and taxiways instead of cutting straight across an active airfield.

Re-tasking

New orders on the move

A unit handed a new destination mid-route picks it up and carries on, rather than stalling where it was.

Danger

Routes can steer round trouble

With the new Route Memory setting on, routes on foot and by land vehicle remember where their side has lost men or vehicles and go round those places for a while. It is off by default.

Scale

Built for a whole map

The route-finder is fast enough to run for a full map's worth of units at once, without the mission hitching.

There is an optional map overlay that draws the route grid and each side's paths in their side colour, for anyone wanting to see exactly how units are choosing to move.

What's fixed

Fixes and improvements

  • Pathfinding is on by defaultWith a route grid that sizes itself to the map, no setup required.
  • Foot and ground units keep out of waterNo more units wandering into lakes and out to sea on their way somewhere.
  • Boats go round land on long tripsA coarse water route first, then the detail along it, so a far shore is reached in seconds.
  • Boats cross water properlyNo zig-zagging between waypoints, no halting against the shore, and editor-placed boats move while simulated.
  • Infantry use boats to cross waterUnits embark to make a crossing and disembark on the far bank.
  • Ground routes bend around airfieldsRunways and taxiways are routed around rather than driven across.
  • New destinations apply mid-routeA waypoint inserted while a unit is already moving no longer stalls its movement.
  • Substantial performance gainsFaster route-finding across the board, so it scales to many units without cost.
  • Units nudged clear of rock formations at spawnFewer units appearing wedged in terrain when they spawn back in near a player.

Status

Where it stands

Delivered

Default-on pathfinding for every profiled unit

The route grid, land and water awareness, airfield avoidance, boat crossings and mid-route re-tasking are all in and on by default.

Convoys keep off runways

Routes are meant to treat a runway as ground to stay off, and until 16 September they did not. The runway line was worked out from an instrument approach point and a fixed length rather than measured, and on Stratis it ran off the end of the field and out to sea, so nothing along the actual runway was recognised and routes crossed it freely. The line is now fitted through the runway itself. Worth watching at busy airfields if you saw convoys driving down a runway before.

Performance

The core route-finding has been made significantly faster so it runs comfortably at mission scale.

Route Memory

A new Route Memory setting on the Virtual AI System, Off by default, lets routes on foot and by land vehicle remember where their side has lost men or vehicles, or come under attack, and go round those places for a while. A group wiped out or a land vehicle destroyed counts most, each man lost a quarter of that and an attack a tenth, and losses in aircraft and boats count for nothing. The memory is kept for each side, fades by half every two hours and starts empty when a saved game is loaded. Each route also varies a little, so groups sent the same way stop walking one line. A group that makes no headway towards its next waypoint (90 seconds, 150 on foot) also marks the ground ahead as blocked for its size class and gets a detour laid in front of that waypoint; its orders are never changed. Low is a little variation with dangerous ground up to three times dearer, High is more variation and up to five times dearer. On Altis an 18 km route took 3 to 3.5 seconds on High and on Off alike. Added on 17 October.

A blocked approach no longer strands a group

A destination that could be reached several ways was written off as unreachable as soon as one of those ways was refused, so the group stayed where it was rather than coming round another side. It now gives up only when every approach has actually been tried and refused. A related fault where an empty search queue produced no answer at all is fixed with it.

Boats find their way round land

A boat sent a long way with land in between used to run out of search before it got there, and sat where it stopped. Now it plans a rough route on a coarse grid of water first, then works out the detail a kilometre at a time. On Altis 11 trips of 3 to 10 km all arrive, in 1.3 to 9.5 seconds each, where 9 of them used to stop 3 to 7 km short. A boat sent to a point inland stops at the shore in under a second instead of searching for about 3 minutes.

Boats follow rivers

A boat now gets a water route to its destination along rivers as well as open sea, and it takes each bend of the river rather than cutting across the bank. When no water route goes all the way, it stops at the furthest point it can reach. Sea Patrols only pick water deep enough for the boat. Added on 5 October.

Boats following a river, part 1: keeping to the water A map of a river bend. A straight line from the boat's start to its goal would cross the land inside the bend, so it is dropped, and the route instead keeps a point at each bend of the river. Every leg is checked: the water must be over 1 m deep along the middle of the leg and 2.5 m to each side, and all round both ends, or the leg is dropped. 1 · KEEPING TO THE WATER start goal straight line crosses land, so it's dropped route: a point at each bend Every leg is checked 2.5 m The water must be over 1 m deep along all three lines and all round both ends. If it isn't, the leg is dropped.
Boats following a river, part 2: finding the route If the boat's start is not in deep water it stays put. If the goal is in deep water, straight hops of up to 200 m are tried first, and if all are clear the route ends at the goal. Otherwise the water is searched, with long jumps toward the goal and steps down to 5 m beside a bank. The route is then pulled tight: from each point, the farthest point within 200 m that a clear leg reaches. Each bend becomes a waypoint, and the boat reaches each one before it turns for the next. The boat ends at the goal, or at the shore within 100 m if the goal is on land or in shallows, and the order completes. If there is no way through it ends as near the goal as it got, holds there, and the order never completes. 2 · FINDING THE ROUTE Start in deep water? Stays put no yes Straight line first hops of up to 200 m, if the goal is in deep water All clear: at the goal otherwise Search the water long jumps toward the goal, then steps down to 5 m beside a bank Route pulled tight from each point, the farthest point within 200 m that a clear leg reaches A waypoint at each bend the boat reaches each one before it turns for the next Where the boat ends up at the goal at the shore, if the goal is on land or in shallows (within 100 m) as near the goal as it got, if there's no way through the order completes the boat holds there and the order never completes
How a boat's route keeps to the water. Every leg has to pass the same check, so the route takes each bend instead of cutting across the bank. The 1 m depth and 2.5 m clearance are the defaults.

Temporary walks stay temporary

A group given somewhere to wander keeps that only while it is spawned. Turning a waypoint into a route used to erase the mark that said so, and the walk was then saved onto the group and came back with it, so a garrison told to hold its post would set off for somewhere it had been sent minutes earlier. Only missions with pathfinding on were affected. Fixed on 4 September.

Refinements

Naval route smoothing

Ironing out the last of the route jitter on some complex coastlines.

Ongoing performance tuning

Three rounds of optimisation are done, most recently on 16 September, and that last one was a substantial reworking of how routes are generated rather than a tidy-up. Work continues for very large missions with a great many units, which is where any remaining cost shows up first.

Testing

How you can help

Open the map during a mission and watch how ALiVE's units move between objectives over time; turning on the pathfinding overlay shows the grid, and the route overlay draws each route as it is worked out, so it fills in over time rather than all at once when you switch it on. The behaviours worth flagging are units that walk into water, stall and stop moving, take a clearly wrong route, or fail to cross water where a crossing plainly exists.

When you spot one, note the map, roughly where it happened, and what the units were doing; a game log from that session helps pin it down. Coastlines, river crossings and busy airfields are the most rewarding places to look.

Spotted a problem? Please report it on the ALiVE issue tracker on GitHub, with the map, rough location and what the units were doing so it can be reproduced.

Changelog

Updates to this page

  • 2026-10-30
    Routes hand a group far fewer waypoints: points along a straight stretch are merged when the line between them stays within 40 m of the route and never crosses water. A Stratis route went from 332 waypoints to 155.
  • 2026-10-17
    New Route Memory setting on the Virtual AI System (Off by default): routes on foot and by land vehicle steer round places their side has lost men or vehicles or come under attack, for a few hours, and each route varies a little so groups sent the same way do not all walk one line. On Altis an 18 km route took 3 to 3.5 seconds on High and on Off alike.
  • 2026-10-05
    Boats now follow rivers: a boat gets a water route along rivers as well as open sea, and stops at the furthest point it can reach when no water route goes all the way. Sea Patrols only pick water deep enough for the boat. Worth trying on maps with navigable rivers.
  • 2026-09-29
    A unit made in a spot boxed in by trees, walls, buildings or a steep slope, with no road nearby, now follows the rough route to its order and its order stays where it was given. The detailed route used to give up there and move the order onto the unit's own spot, so a Logistics convoy made in such a spot let its passengers out and removed its truck where it started, 2 km short; about one request in three on Stratis did this, depending on where the truck was made. From an open spot the route is unchanged.
  • 2026-09-16
    Convoys now keep off runways, and a group with one blocked approach no longer strands itself. Routes are supposed to treat a runway as ground to stay off, and until today they did not: the runway line was guessed from an instrument approach point and a fixed length rather than measured, and on Stratis it ran off the end of the field and out to sea, so nothing along the real runway was recognised and routes crossed it freely. It is fitted through the runway itself now. Separately, a destination reachable several ways was written off as soon as one of those ways was refused, so the group stayed put instead of coming round another side; it now gives up only after every approach has been tried. A third round of route-generation optimisation came with those, a substantial reworking rather than a tidy-up, so both speed and route quality are worth a look on busy airfields and complex coastlines.
  • 2026-07-27
    Overhaul briefing first published.