WARBIRDS.IO Dev Log

← All posts

AI that fights for the cap

The capture zone landed, but the AI didn't care about it — the bots homed on the nearest enemy and traded salvos wherever they happened to meet, often nowhere near the objective. So the naval AI got two upgrades: it can navigate around islands, and it actually makes for the cap to fight for the centre.

The glowing boundary of the central capture zone curving across the open sea, islands inside it, with a crimson cruiser holding the line and a cobalt cruiser crossing in to contest it
Fighting for the centre — the cap boundary curves across the sea, islands inside it for cover, two cruisers trading fire across the line.

Steering around islands

The old land avoidance was a reflex: if the bow was about to hit a shore, put the helm hard over one fixed way and hope. On a sea strewn with island chains that left hulls stalling against shorelines or sheering off into open water, away from where they wanted to go. The new version casts a spread of feeler rays off the bow and steers for the clear heading nearest the one it wants — so a ship threads the gap toward its goal instead of fleeing the obstacle. It's a small change with a big effect: the bots now pick their way through the archipelago instead of getting hung up on it.

Making for the cap

On top of that, the bots have an objective. A hull that isn't already holding the zone steams for it; one that holds it loiters in the ring to defend it; and an enemy in close gun range still gets a broadside. The result is that both fleets converge on the centre and the cap actually changes hands — you'll sail up to find the bots already brawling over it, and taking it from them (or holding it against them) is the game.

Tuning it surfaced a map truth: the island-dense middle is hard to push into, so the control zone is a broad central area rather than a pinpoint — big enough that the fight for the centre is the fight for the cap, islands and all. The bots use their consumables here too: repairing when they're hurt, boosting to break contact when they're not going to win the exchange.

How it sits in the engine

It's all in the naval AI step, behind the same seam as the rest of the sea war — the air bots are a completely separate brain and don't change. The obstacle feelers are cheap ray marches over the existing terrain heightfield (the one the ships run aground on); the objective is a couple of distance checks against the zone the server already tracks. A regression test sails a full AI fleet action and asserts the bots reach the cap and hold it — so the sea stays lively even with nobody watching.