bug when the fleet is stopped #13

Closed
opened 2026-08-11 13:34:36 +00:00 by metaheavens · 1 comment
Owner

when I stop moving with the fleet, it pause a bit, htne slightly move again before fully stopping

when I stop moving with the fleet, it pause a bit, htne slightly move again before fully stopping
Author
Owner

Done in 0e07187. Reproduced first, because the cause was not what the symptom suggested.

A probe logging the fleet's speed after releasing the stick:

t=0.10  maxspeed= 45.000     <- starts from REST
t=0.20  maxspeed= 90.000
t=0.30  maxspeed=135.000
t=0.40  maxspeed=180.000     <- accelerating
t=0.70  maxspeed=  0.000     <- then brakes

It was not coasting at all. Fleet.stop() aims each ship at a braking point ~75 units ahead of it, but the ship's own velocity was ~0 - the anchor had been carrying it along, which is the same thing that caused the earlier stop-dead bug. So on release it started from a standstill, accelerated into its own stopping distance, and halted a second time. That is exactly the pause-then-lurch you described.

stop() now hands the fleet's motion to the ship, so the release is one continuous decelerating coast:

t=0.10  maxspeed=222.500
t=0.20  maxspeed=177.500
t=0.30  maxspeed=132.500
t=0.40  maxspeed= 87.500
t=0.50  maxspeed=  0.000

Same endpoint (x=599.445 either way), no pause and no second movement.

test_joystick_control now asserts the speed one frame after release is a real fraction of cruise_speed (so it cannot have started from rest) and that it never rises afterwards. With the fix reverted it fails with "the fleet stopped dead on release instead of coasting".

Done in 0e07187. Reproduced first, because the cause was not what the symptom suggested. A probe logging the fleet's speed after releasing the stick: ``` t=0.10 maxspeed= 45.000 <- starts from REST t=0.20 maxspeed= 90.000 t=0.30 maxspeed=135.000 t=0.40 maxspeed=180.000 <- accelerating t=0.70 maxspeed= 0.000 <- then brakes ``` It was not coasting at all. `Fleet.stop()` aims each ship at a braking point ~75 units ahead of it, but the ship's own `velocity` was ~0 - the anchor had been carrying it along, which is the same thing that caused the earlier stop-dead bug. So on release it started from a standstill, accelerated into its own stopping distance, and halted a second time. That is exactly the pause-then-lurch you described. `stop()` now hands the fleet's motion to the ship, so the release is one continuous decelerating coast: ``` t=0.10 maxspeed=222.500 t=0.20 maxspeed=177.500 t=0.30 maxspeed=132.500 t=0.40 maxspeed= 87.500 t=0.50 maxspeed= 0.000 ``` Same endpoint (x=599.445 either way), no pause and no second movement. `test_joystick_control` now asserts the speed one frame after release is a real fraction of `cruise_speed` (so it cannot have started from rest) and that it never rises afterwards. With the fix reverted it fails with "the fleet stopped dead on release instead of coasting".
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#13
No description provided.