W7: The drop: sky barge and wing-sail
Simulation.start_drop() plans a seeded straight route across the island at BARGE_ALTITUDE, through a point near the middle pulled onto land, and puts every player aboard. Riders move with the barge; jump leaps off with some of its speed. Freefall steers and tops out at FREEFALL_MAX_SPEED; jump opens the wing-sail, which also opens by itself WING_AUTO_DEPLOY_HEIGHT above the ground or water. Gliding sinks slowly and steers at GLIDE_SPEED, and the sail folds just above the ground or sea so landing does no damage. Anyone aboard at the end of the route is thrown off. Drop state is hashed. Every server match now starts with the drop. Bots leap at a time fixed by their player ID. The carrier's name and look are open in #72. Closes #14 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,16 +40,20 @@ func test_percentile_uses_nearest_rank() -> void:
|
||||
assert_eq(ServerLoop._percentile(PackedInt64Array([9]), 0.99), 9)
|
||||
|
||||
|
||||
func test_bots_move_and_humans_without_commands_stay_put() -> void:
|
||||
func test_bots_leap_and_humans_without_commands_stay_aboard() -> void:
|
||||
# Every match starts on the drop carrier. A human who sends nothing rides it; the bot
|
||||
# leaps at its own fixed moment and falls away.
|
||||
var loop: ServerLoop = ServerLoop.new(99, 1, 1)
|
||||
var human: SimEntity = loop.sim.entities.find(1)
|
||||
var bot: SimEntity = loop.sim.entities.find(2)
|
||||
var human_start: Vector3 = human.position
|
||||
var bot_start: Vector3 = bot.position
|
||||
for _index: int in 90:
|
||||
assert_eq(human.drop_state, Drop.ABOARD)
|
||||
assert_eq(bot.drop_state, Drop.ABOARD)
|
||||
for _index: int in Tuning.TICK_RATE_HZ * 24:
|
||||
loop.run_tick()
|
||||
assert_eq(human.position, human_start)
|
||||
assert_true(bot.position.distance_to(bot_start) > 1.0, "the bot should have walked")
|
||||
assert_eq(human.drop_state, Drop.ABOARD)
|
||||
assert_true(human.position.distance_to(loop.sim.drop.barge_position(loop.sim.tick)) < 0.001)
|
||||
assert_ne(bot.drop_state, Drop.ABOARD, "the bot should have leapt")
|
||||
assert_true(bot.position.y < Tuning.BARGE_ALTITUDE - 20.0, "the bot should be falling, at %s" % bot.position)
|
||||
|
||||
|
||||
func test_same_seed_gives_the_same_match() -> void:
|
||||
|
||||
Reference in New Issue
Block a user