Stacking distorders, menu layouts, lab rewards, enemy detail, artillery cross

DISTORDER STACKING. Each space-time distorder vessel past the first raises
the fleet's speed ceiling by 1.0, so a second one is worth crewing instead of
being dead weight. GameState gains max_fleet_speed_multiplier, pushed by
Fleet whenever composition changes - the same direction as every other
fleet-derived figure, since GameState does not reach into the scene tree to
count ships. The energy drain is normalised against the CURRENT ceiling, so
full boost costs the same per second however wide it is: extra vessels buy
more speed, not cheaper speed. Losing one re-clamps an over-ceiling boost
rather than leaving the fleet travelling faster than its crew can sustain.

TRANSFER MENU. Rows overlapped, and the last one ran into the hint text.
row_height is divided from the available space, but each row's contents used
a fixed pixel ladder - glyph at +10, buttons at +88, selector at +142 - which
needs about 244px. Three resources fit; the fourth cut rows to 180 and every
one spilled 64px into the next. Every offset is now a fraction of the row, so
it cannot overflow. Also dropped the per-row AMOUNT caption (four copies of a
word the footer hint already explains) and moved each glyph and name to the
TOP of its row, where they read as its heading rather than the next row's.

HANGAR. Six vessel types in one row gave each about 100px for a 155px label,
so the names ran together. Now a 3x2 grid per section, sized from the space
between the first heading and the status line, using the empty lower half.

LAB RESEARCH REWARD. A harder enemy lab is worth more research points, and
how hard a lab is depends on the layout authored for it - how many capture
points, how many defenders - which the planet TYPE cannot know. PlanetSetup
carries research_point_reward, set in the map editor, overriding the planet
type's flat rate. 0 means "no opinion", so every map authored before this
keeps its old value.

RESEARCH LAB BACKGROUND. Its own shader instead of the crater field with a
red tint, which read as "rocky planet, tinted" rather than someone's
facility: plated floor, seams, service conduits, lit junctions. Loop-free by
construction (#68's lesson applied up front) - conduits stay continuous
across cells by keying a horizontal run to cell.y and a vertical to cell.x,
so neighbouring cells agree without any cell scanning its neighbours.

ENEMY DETAIL. Every enemy was a single flat outline, which left the artillery
and the turret spawner as the same octagon at two sizes - the silhouette
carried no information about what the thing did. EnemyDefinition gains
detail_lines and detail_rings as DATA, so adding an enemy still means adding
a definition rather than editing Enemy.gd, and the four non-default hulls are
redrawn: a long-barrelled sniper, a squat mortar, a hive with launch bays, a
capital ship with spine and ribs.

Three things drew an enemy from its definition - the enemy, the map editor's
markers, and the palette buttons - each reimplementing it from hull_points
alone, so the new detail appeared in the game and nowhere else and an editor
marker stopped matching what it placed. They now share
EnemyDefinitions.draw_definition().

ARTILLERY. The 1.8s charge-up before the tower fired arrived long before the
threat was legible and mostly read as the tower being stuck. It fires
immediately now; the warning is the shell you can see in the air plus a small
cross on the ground at the impact point. Deliberately not a blast-radius ring
- a large translucent area was easy to read as the explosion having already
happened, where the cross says "move off this spot".

MAIN MENU. No Quit in any build (a web build has nothing to quit to, and
Android's back gesture already does it), a plain black background, and the
game is "Spaceship" - in the title and in config/name, which is what drives
the browser tab for the web export. change_scene_to_file() returns an error
and otherwise fails silently, leaving the menu up, which is indistinguishable
from an unpressed button; it is now checked and reported on screen.

Full suite green at 99/99.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-18 16:54:46 +02:00
commit 7817d1ffc6
48 changed files with 897 additions and 159 deletions

View file

@ -3,8 +3,9 @@ extends SceneTree
# Headless gameplay test: run with
# godot --headless -s res://tests/test_artillery_enemy.gd
# Verifies:
# 1. the telegraph is visible (phase == TELEGRAPHING) for the whole
# window before any damage lands
# 1. the tower fires IMMEDIATELY - the shell is in the air on the frame it
# is launched - and the warning is the shell's flight plus the impact
# cross drawn at its target, not a charge-up before anything happens
# 2. a ship that leaves the blast radius before impact takes no damage;
# one that stays takes the full hit
# 3. a shielded ship inside the blast survives, losing exactly one charge
@ -34,6 +35,7 @@ var live_shell: Node
var recorded_target: Vector2 = Vector2.ZERO
var impact_point: Vector2 = Vector2.ZERO
var travel_time: float = 0.0
var origin: Vector2 = Vector2.ZERO
var stage2_wait: float = 0.0
var stage5_wait: float = 0.0
var stage: int = 0
@ -79,10 +81,9 @@ func _process(delta: float) -> bool:
shield_ship = fleet.ships[fleet.ships.size() - 1]
shield_ship.position = impact_point + Vector2(-100, 0)
var origin: Vector2 = impact_point + Vector2(400, 400)
origin = impact_point + Vector2(400, 400)
travel_time = origin.distance_to(impact_point) / 300.0
shell = load("res://ArtilleryShell.tscn").instantiate()
shell.telegraph_time = 1.0
shell.shell_speed = 300.0
shell.aoe_radius = 220.0
shell.damage = 3
@ -93,28 +94,40 @@ func _process(delta: float) -> bool:
stage = 1
return false
1:
# Mid-telegraph: nobody hurt yet, still visibly telegraphing.
if elapsed < shell.telegraph_time * 0.8:
# The shell must already be travelling - there is no charge-up
# phase to sit in any more - and it must have moved off the
# tower under its own speed.
if shell.phase != ARTILLERY_SHELL_SCRIPT.Phase.TRAVELING:
return _fail("the shell is not in the air on the frame after firing")
if elapsed < travel_time * 0.4:
return false
if shell.phase != ARTILLERY_SHELL_SCRIPT.Phase.TELEGRAPHING:
return _fail("shell left the telegraph phase too early")
if shell.shell_pos.distance_to(shell.target) >= origin.distance_to(impact_point):
return _fail("the shell has not closed any distance on its target")
# The warning the player actually gets: a cross on the ground at
# the point of impact. Drawing cannot be asserted headlessly, so
# this checks what it is drawn FROM - the aim point is fixed and
# the marker has a real size.
if not shell.target.is_equal_approx(impact_point):
return _fail("the impact marker would not be drawn at the point the shell was aimed at")
if ARTILLERY_SHELL_SCRIPT.IMPACT_CROSS_RADIUS <= 0.0:
return _fail("the impact cross has no size, so nothing marks the landing point")
if not is_instance_valid(ship_inside) or not is_instance_valid(ship_leaves) \
or not is_instance_valid(shield_ship):
return _fail("damage landed before the telegraph window finished")
return _fail("damage landed before the shell arrived")
# Ship B clears the blast radius now, well before impact.
ship_leaves.position = impact_point + Vector2(2000, 0)
# Captured once, as a plain float: the shell frees itself once
# it resolves, so re-reading shell.telegraph_time from inside
# the wait condition below (evaluated every frame) would touch
# a freed object on any frame after that.
stage2_wait = shell.telegraph_time * 0.2 + travel_time + 1.5
# it resolves, so reading off it from inside the wait condition
# below (evaluated every frame) would touch a freed object on
# any frame after that.
stage2_wait = travel_time + 1.5
elapsed = 0.0
stage = 2
return false
2:
# Enough time for the remaining telegraph, travel, and the full
# explosion visual to resolve.
# Enough time for the remaining travel and the full explosion
# visual to resolve.
if elapsed < stage2_wait:
return false
if is_instance_valid(ship_inside):
@ -138,7 +151,6 @@ func _process(delta: float) -> bool:
main.add_child(artillery)
art_component = artillery.get_component("artillery")
art_component.cooldown_left = 0.0
art_component.telegraph_time = 0.3
art_component.fire_cooldown = 999.0 # only the one shot for this check
elapsed = 0.0
stage = 3
@ -173,7 +185,9 @@ func _process(delta: float) -> bool:
# destroy the artillery enemy (and with it art_component) well
# before this wait ends, so the condition below must not keep
# re-reading a property off a node that might already be freed.
stage5_wait = art_component.telegraph_time + (300.0 / 180.0) + 1.5
# No charge-up to wait out any more - just flight time plus the
# explosion visual.
stage5_wait = (300.0 / 180.0) + 1.5
elapsed = 0.0
stage = 5
return false