#72: The packet ship, the lifeline mortar and the gull-kite
Eric chose option B on #72. The drop is now the GDD's launch: - A packet ship sails a seeded straight line past the island, offshore, as close in as it can while keeping 45 m of open water from any land (eight-way probes; up to 32 headings, then the four world sides). - Jump fires the lifeline mortar along the look heading. How high the player aims sets the charge (-10 to 45 degrees: 16 to 110 m/s over the ground; every shot climbs at 75 m/s). The climb can't be steered and the kite can't open until the arc tops out. Riders still aboard at the end are fired towards the middle of the island. - Drop.reach() mirrors the fall for both ways down (kite at the top, or a fall with the kite opening by itself); bots, the soak and autoplay clients and the tutorial pilot aim with Drop.aim_charge(). - Bots fire at their landing spot once abeam of it, when in easy reach at their own staggered moment, or just before the route ends, and open the kite early only when the spot is beyond the rest of a fall. - Art: VesselModels.ship() (two-masted packet, tanned square sails, a salt-white boot-top, a bowsprit and the mortar on its bed, mirrored to face the island), the figure's gull-kite (figure.py), and a lifeline cord from the muzzle to each player still climbing. - Renamed barge to ship and wing-sail to gull-kite throughout code, tests, captures, docs and the tutorial text. make match now defaults to seed 2, where the scripted player still harvests and builds. Closes #72 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
## by its autoplay script. The picture is the client's own: its copy of the world, its
|
||||
## predicted player, everyone else as the server's snapshots have them.
|
||||
##
|
||||
## Stages: barge (a few seconds into the drop), glide, landed, and basin: once landed,
|
||||
## Stages: ship (a few seconds into the drop), glide, landed, and basin: once landed,
|
||||
## the server rings a patch of low ground near the shore with breakwaters and play goes
|
||||
## on until the tide has risen past it, so the sea stands outside the ring and the
|
||||
## ground inside, below the sea, stays dry on the client too (issue N11). build and
|
||||
@@ -21,7 +21,7 @@ const DT: float = 1.0 / Tuning.TICK_RATE_HZ
|
||||
const HOST: String = "127.0.0.1"
|
||||
const LIMIT_ROUNDS: int = 200 * Tuning.TICK_RATE_HZ
|
||||
|
||||
@export var stage: String = "barge"
|
||||
@export var stage: String = "ship"
|
||||
@export var match_seed: int = 2
|
||||
@export var bots: int = 23
|
||||
## A13: a colour-vision set (Palette.VISION_*), captions for the sounds of the last
|
||||
@@ -75,7 +75,7 @@ func _ready() -> void:
|
||||
var reached: bool = false
|
||||
if _session.game.playing():
|
||||
match stage:
|
||||
"barge":
|
||||
"ship":
|
||||
reached = me.drop_state == Drop.ABOARD and _session.game.prediction.next_tick > 3 * Tuning.TICK_RATE_HZ
|
||||
"glide":
|
||||
reached = me.drop_state == Drop.GLIDING
|
||||
@@ -85,7 +85,7 @@ func _ready() -> void:
|
||||
since = 0
|
||||
elif since >= 0:
|
||||
since += 1
|
||||
if since >= (2 * Tuning.TICK_RATE_HZ if stage != "barge" else 1):
|
||||
if since >= (2 * Tuning.TICK_RATE_HZ if stage != "ship" else 1):
|
||||
break
|
||||
if since < 0:
|
||||
push_error("client capture: never reached stage '%s'" % stage)
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
[node name="CaptureClient" type="Node3D"]
|
||||
script = ExtResource("1")
|
||||
stage = "barge"
|
||||
stage = "ship"
|
||||
@@ -3,7 +3,7 @@
|
||||
## animation, seen from in front and to their right:
|
||||
##
|
||||
## - states: idle, walk, run, crouched, creeping, in the air, skydiving, gliding,
|
||||
## swimming, downed (M7). (Aboard the barge is the idle with the feet set wider; the deck
|
||||
## swimming, downed (M7). (Aboard the ship is the idle with the feet set wider; the deck
|
||||
## placement would pull it out of the row.)
|
||||
## - actions: carrying a longgun, a revolver and a tonic, firing each kind, a boathook
|
||||
## swing, a keg thrown, building, reloading, drinking and a flinch.
|
||||
@@ -131,7 +131,7 @@ func _stand(at: Vector3, row: Array) -> SimEntity:
|
||||
|
||||
func _pose(player: SimEntity, row: Array) -> void:
|
||||
var figure: FigureRig = view.entities.figure_of(player.id)
|
||||
# The barge's deck isn't drawn here: put the passenger back where it stands.
|
||||
# The ship's deck isn't drawn here: put the passenger back where it stands.
|
||||
figure.position = player.position
|
||||
figure.drive(player, 0.0)
|
||||
figure.drive(player, 1.0)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://test/capture/match_scene.gd" id="1"]
|
||||
|
||||
[node name="CaptureMatch" type="Node3D"]
|
||||
script = ExtResource("1")
|
||||
stage = "launch"
|
||||
@@ -3,7 +3,7 @@
|
||||
## prints what it shows as a caption (Godot's default font; this is a test caption,
|
||||
## not the game's HUD).
|
||||
##
|
||||
## Stages: lobby, barge, glide, landed, built, final, tide (the island just before the
|
||||
## Stages: lobby, ship, glide, landed, built, final, tide (the island just before the
|
||||
## end, from where the lobby saw it), results.
|
||||
extends Node3D
|
||||
|
||||
@@ -31,8 +31,11 @@ func _ready() -> void:
|
||||
match stage:
|
||||
"lobby":
|
||||
pass
|
||||
"barge":
|
||||
"ship":
|
||||
_replay.run_until(func() -> bool: return flow.in_match() and flow.sim.tick >= 2 * TICKS)
|
||||
"launch":
|
||||
# A bot half a second up the mortar's arc, its lifeline still trailing.
|
||||
_replay.run_until(func() -> bool: return flow.in_match() and _climber() != null and _climber().velocity.y < Tuning.MORTAR_RISE_SPEED - 8.0)
|
||||
"glide":
|
||||
_replay.run_until(func() -> bool: return _player() != null and _player().drop_state == Drop.GLIDING)
|
||||
_run_ticks(TICKS)
|
||||
@@ -67,11 +70,19 @@ func _ready() -> void:
|
||||
if stage == "lobby" or stage == "tide":
|
||||
_view.overview()
|
||||
who = "the island"
|
||||
elif stage == "barge":
|
||||
elif stage == "ship" or stage == "launch":
|
||||
# From over the water astern and seaward of the ship, looking past it to the island.
|
||||
var along: Vector3 = (sim.drop.finish - sim.drop.start).normalized()
|
||||
var at: Vector3 = sim.drop.barge_position(sim.tick)
|
||||
_view.look_from(at - along * 22.0 + Vector3(0.0, 9.0, 0.0) + along.cross(Vector3.UP) * 9.0, at + along * 40.0 - Vector3(0.0, 22.0, 0.0))
|
||||
who = "the barge"
|
||||
var at: Vector3 = sim.drop.ship_position(sim.tick)
|
||||
var centre: Vector3 = Vector3(Tuning.WORLD_SIZE_METRES * 0.5, 0.0, Tuning.WORLD_SIZE_METRES * 0.5)
|
||||
var inland: Vector3 = Vector3(centre.x - at.x, 0.0, centre.z - at.z).normalized()
|
||||
if stage == "ship":
|
||||
_view.look_from(at - along * 26.0 - inland * 16.0 + Vector3(0.0, 11.0, 0.0), at + inland * 30.0 + Vector3(0.0, 2.0, 0.0))
|
||||
who = "the ship"
|
||||
else:
|
||||
var climber: SimEntity = _climber()
|
||||
_view.look_from(at - along * 30.0 - inland * 24.0 + Vector3(0.0, 8.0, 0.0), climber.position.lerp(at, 0.45))
|
||||
who = "a bot fired from the ship"
|
||||
elif watched != 0:
|
||||
var entity: SimEntity = sim.entities.find(flow.entity_of[watched])
|
||||
var airborne: bool = entity.drop_state != Drop.NONE
|
||||
@@ -89,6 +100,17 @@ func _ready() -> void:
|
||||
_caption(_describe(who) + ("" if quality < 0 else "\nquality: %s, renderer: %s" % [GameSettings.QUALITY_NAMES[quality], RenderingServer.get_current_rendering_method()]))
|
||||
|
||||
|
||||
## The first player climbing the mortar's arc, or null.
|
||||
func _climber() -> SimEntity:
|
||||
var sim: Simulation = _replay.flow.sim
|
||||
if sim == null or sim.drop == null:
|
||||
return null
|
||||
for entity: SimEntity in sim.entities.entities():
|
||||
if entity.archetype == SimEntity.ARCHETYPE_PLAYER and entity.drop_state == Drop.FREEFALL and entity.velocity.y > 0.0:
|
||||
return entity
|
||||
return null
|
||||
|
||||
|
||||
func _player() -> SimEntity:
|
||||
var flow: Match = _replay.flow
|
||||
if not flow.entity_of.has(PLAYER):
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
[node name="CaptureMatch" type="Node3D"]
|
||||
script = ExtResource("1")
|
||||
stage = "barge"
|
||||
stage = "ship"
|
||||
@@ -1,4 +1,4 @@
|
||||
## Capture scenario for the generated barge and sea chests (A5): the barge from outside,
|
||||
## Capture scenario for the generated packet ship (#72) and sea chests (A5): the ship from outside,
|
||||
## in the air above the sea, with a row of chests on a plank stand, shut and opened.
|
||||
extends Node3D
|
||||
|
||||
@@ -8,11 +8,11 @@ func _ready() -> void:
|
||||
world.environment = Look.environment()
|
||||
add_child(world)
|
||||
add_child(Look.sun(200.0))
|
||||
var barge: MeshInstance3D = MeshInstance3D.new()
|
||||
barge.mesh = VesselModels.barge()
|
||||
barge.position = Vector3(0.0, 0.0, 0.0)
|
||||
barge.rotation.y = 0.5
|
||||
add_child(barge)
|
||||
var ship: MeshInstance3D = MeshInstance3D.new()
|
||||
ship.mesh = VesselModels.ship()
|
||||
ship.position = Vector3(0.0, 0.0, 0.0)
|
||||
ship.rotation.y = 0.5
|
||||
add_child(ship)
|
||||
var multimesh: MultiMesh = MultiMesh.new()
|
||||
multimesh.transform_format = MultiMesh.TRANSFORM_3D
|
||||
multimesh.use_colors = true
|
||||
@@ -24,12 +24,12 @@ func _ready() -> void:
|
||||
multimesh.set_instance_color(index, EntityView.CHEST_OPEN if index == 2 else EntityView.CHEST_SHUT)
|
||||
var chests: MultiMeshInstance3D = MultiMeshInstance3D.new()
|
||||
chests.multimesh = multimesh
|
||||
chests.position = Vector3(9.0, 0.0, 6.0)
|
||||
chests.position = Vector3(13.0, 0.0, 11.0)
|
||||
add_child(chests)
|
||||
var camera: Camera3D = Camera3D.new()
|
||||
camera.fov = 60.0
|
||||
camera.position = Vector3(16.0, 6.0, 20.0)
|
||||
camera.position = Vector3(27.0, 7.0, 25.0)
|
||||
add_child(camera)
|
||||
camera.look_at(Vector3(2.0, 5.0, 0.0))
|
||||
camera.look_at(Vector3(2.0, 3.5, 0.0))
|
||||
camera.make_current()
|
||||
Look.add_print_pass(camera)
|
||||
|
||||
Reference in New Issue
Block a user