#97g: garrison vessels patrol and defend their outpost #105

Closed
opened 2026-08-23 11:18:44 +00:00 by metaheavens · 1 comment
Owner

Subticket of #97, depends on #97f.

"When a vessel is assigned to an outpost, it navigates around the outpost by
itself, attacking nearby ennemies if any are detected."

  • A garrisoned vessel orbits its outpost on its own, without player input.
  • It engages enemies inside a detection radius and returns to its post
    afterwards, rather than being pulled across the map.
  • It is NOT part of the fleet: it does not follow the formation, does not count
    against max_fleet_size(), and does not move when the player flies away.
Subticket of #97, depends on #97f. "When a vessel is assigned to an outpost, it navigates around the outpost by itself, attacking nearby ennemies if any are detected." - A garrisoned vessel orbits its outpost on its own, without player input. - It engages enemies inside a detection radius and returns to its post afterwards, rather than being pulled across the map. - It is NOT part of the fleet: it does not follow the formation, does not count against `max_fleet_size()`, and does not move when the player flies away.
Author
Owner

Done in bd0cc84.

A garrisoned vessel circles its post, engages what comes into range, and goes
back to circling. It steers by writing move_target and lets Ship's own steering
fly it, so it accelerates and banks exactly like a vessel in the formation, and
it is not in Fleet.ships - no formation, no fleet slot consumed, and it stays
put when you fly away.

The leash is the load-bearing part. Enemies are judged from the POST rather than
from the vessel, so a garrison that has drifted out to its leash cannot see
further still and be walked away from its outpost one enemy at a time; an
engagement is clamped to a circle around the post rather than to a straight
line, so it still manoeuvres while pinned.

Two things worth recording:

  • the orbit starts from where the vessel actually is, not a random bearing. A
    random one makes the first waypoint a point on the far side of the circle, and
    the vessel flies straight across the middle - through the outpost it is
    guarding. That was a real bug the test caught.
  • enemies now pick targets from the player_ships group rather than from
    Fleet.ships, or an enemy would ignore the guns shooting at it and a garrison
    could hold a position without ever being fought back.
Done in bd0cc84. A garrisoned vessel circles its post, engages what comes into range, and goes back to circling. It steers by writing move_target and lets Ship's own steering fly it, so it accelerates and banks exactly like a vessel in the formation, and it is not in Fleet.ships - no formation, no fleet slot consumed, and it stays put when you fly away. The leash is the load-bearing part. Enemies are judged from the POST rather than from the vessel, so a garrison that has drifted out to its leash cannot see further still and be walked away from its outpost one enemy at a time; an engagement is clamped to a circle around the post rather than to a straight line, so it still manoeuvres while pinned. Two things worth recording: - the orbit starts from where the vessel actually is, not a random bearing. A random one makes the first waypoint a point on the far side of the circle, and the vessel flies straight across the middle - through the outpost it is guarding. That was a real bug the test caught. - enemies now pick targets from the player_ships group rather than from Fleet.ships, or an enemy would ignore the guns shooting at it and a garrison could hold a position without ever being fought back.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#105
No description provided.