New ennemy #96

Closed
opened 2026-08-22 21:29:45 +00:00 by metaheavens · 1 comment
Owner

A new ennemy vessel tries to suicide itself like the default vessel. Though this new ennemy starts a bit far from the target, lock it and wait a bit. A small back and forth announce its departure to its target, in a straight line, quickly. 300ms before it actually starts going, a small line goes from it to its target to announce its trajectory

A new ennemy vessel tries to suicide itself like the default vessel. Though this new ennemy starts a bit far from the target, lock it and wait a bit. A small back and forth announce its departure to its target, in a straight line, quickly. 300ms before it actually starts going, a small line goes from it to its target to announce its trajectory
Author
Owner

Implemented in 890e1c8 as the "lancer".

It follows the brief in four beats:

  • starts a bit far - it drifts in from up to 1500px at half its speed,
    and refuses to charge until the fleet is inside lock_range (820px).
  • locks it and waits a bit - at that point it freezes a target POINT and
    holds it for a 1.2s wind-up. Nothing re-reads the fleet after that, so the
    charge goes where the target was and stepping off the line works. That is
    the whole reason the telegraph is worth reading, and it is the same bargain
    the mothership's big laser makes.
  • a small back and forth - it rocks 30px along the charge axis during the
    wind-up, leaning backwards first, and does not drift sideways at all.
  • 300ms before it goes, a line to its target - a thin line from the hull
    down the trajectory, brightening as the launch approaches, with a tick
    across the locked point. Exactly the last 0.3s of the 1.2s wind-up.

Then it crosses in a straight line at 950px/s, flies through the locked point
rather than stopping on it, coasts to a halt and starts hunting again. Like
the chaser it is dies_on_contact, so it trades itself for the vessel it
hits - 2hp, so it is cheap to shoot down if you see it coming.

It is registered in EnemyDefinitions, so the setup editor can place it on any
map, and the roaming spawner gives it a 25% share - otherwise a new enemy would
exist only in the editor and never be met in open space.

Covered by tests/test_lancer_enemy.gd. Measured on the last run: rocked 30px
back and forth with 0px lateral drift, line up for 0.30s of the 1.20s wind-up,
charged 1124px at 950px/s with 0px off axis, and the ship that dodged when the
line appeared survived with the locked point landing 400px away.

Implemented in 890e1c8 as the "lancer". It follows the brief in four beats: - **starts a bit far** - it drifts in from up to 1500px at half its speed, and refuses to charge until the fleet is inside `lock_range` (820px). - **locks it and waits a bit** - at that point it freezes a target POINT and holds it for a 1.2s wind-up. Nothing re-reads the fleet after that, so the charge goes where the target was and stepping off the line works. That is the whole reason the telegraph is worth reading, and it is the same bargain the mothership's big laser makes. - **a small back and forth** - it rocks 30px along the charge axis during the wind-up, leaning backwards first, and does not drift sideways at all. - **300ms before it goes, a line to its target** - a thin line from the hull down the trajectory, brightening as the launch approaches, with a tick across the locked point. Exactly the last 0.3s of the 1.2s wind-up. Then it crosses in a straight line at 950px/s, flies through the locked point rather than stopping on it, coasts to a halt and starts hunting again. Like the chaser it is `dies_on_contact`, so it trades itself for the vessel it hits - 2hp, so it is cheap to shoot down if you see it coming. It is registered in `EnemyDefinitions`, so the setup editor can place it on any map, and the roaming spawner gives it a 25% share - otherwise a new enemy would exist only in the editor and never be met in open space. Covered by `tests/test_lancer_enemy.gd`. Measured on the last run: rocked 30px back and forth with 0px lateral drift, line up for 0.30s of the 1.20s wind-up, charged 1124px at 950px/s with 0px off axis, and the ship that dodged when the line appeared survived with the locked point landing 400px away.
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#96
No description provided.