Commit graph spaceship/BuildController.gd
Author SHA1 Message Date
Loïc Wisniewski
3f3a22227d Add research lab planets and research points (#63) 2026-08-16 20:14:29 +02:00
Loïc Wisniewski
116e0f97d3 Add space-time distorder vessel and fleet speed fader (#59)
GameState.fleet_speed_multiplier (1.0-3.0) is applied at the point of
use - Fleet's cruise anchor and Ship's own max_speed/acceleration -
rather than baked into stored stats, so a stat upgrade researched
mid-boost can't corrupt the base value and the fader takes effect
immediately with no re-apply step.

Ship.arrive_radius is scaled by the same multiplier: at higher speeds
each physics tick covers a proportionally larger step, and once that
step outgrows a fixed arrive_radius the ship can overshoot its
snap-to-target zone every tick while chasing a target that's now also
receding faster - visible as the fleet stretching apart under boost.
Scaling it preserves the same "snaps onto its slot" tightness at any
boost level that 1.0x already has.

SpeedFader.gd is a self-contained vertical drag control (TouchJoystick's
raw-touch idiom, not _gui_input) that writes straight to the autoload
rather than reporting a value for something else to apply. It also
resets the multiplier to 1.0 the instant fleet.has_capability("distorder")
goes false, so a fleet can never be left permanently boosted by a vessel
it no longer has.

VesselDistorderComponent carries no per-shot behaviour (energy drain
while boosted is #62) - its presence is what matters. Registered in
VesselDefinitions, wired into the crafter/hangar/ship-lab menus per
#57's note (5/5/6 -> 6/6/7 columns).
2026-08-16 17:59:04 +02:00
Loïc Wisniewski
ed46cd77e6 Add laser ship vessel and its skill shot (#58)
A manually aimed instant beam, modelled on the gas bomber's press-drag-
release aiming (GasBombController/VesselGasBomberComponent) but firing
the moment the touch releases - no projectile travel time. Damage,
beam_range and cooldown are resolved per ship from base_stats/upgrades
(VesselLaserComponent.apply_stats(), the same pattern
VesselWeaponComponent uses) rather than hardcoded in the controller, so
the new damage/range/cooldown ship-lab upgrades actually reach them.
Cooldown lives on the component (per ship), not the controller (per
fleet) - two laser ships give two shots, the exact bug already fixed
for bombers in eb79efd.

LaserController.gd is reused unmodified by both Main.tscn and
PlanetSurface.tscn (relative ../Fleet, ../Camera2D, ../UI/LaserButton
paths, matching GasBombController), so it works identically in space
and on a landed surface. Wired into GameController's touch/drag
first-refusal chain alongside the bomb controller.

The crafter, hangar and ship-lab menus were already generic over
VesselDefinitions.fleet()/.all() - only the per-vessel Main.tscn nodes
are hand-placed, not the logic - so this repacks those rows to
5/5/6 columns and extends BuildController's onready arrays. No new
signal handlers were needed. Also fixes test_vessel_composition.gd's
hardcoded fleet-catalog size again (4 -> 5) now that laser is a fifth
fleet-eligible vessel.

Note for later tickets: a brand-new class_name script (LaserController)
resolves fine as a static type when its own file is the godot -s entry
point, but the identical type hint fails to parse ("Could not find
type") when the script holding it is only reached indirectly - e.g.
Main.tscn loaded from inside a _screenshot_tool.gd preview. Untyped
Node + duck-typed calls sidesteps it; GameController.gd's
laser_controller field documents this in place.
2026-08-16 17:29:53 +02:00
Loïc Wisniewski
bbb1d4b0c5 Add carrier vessel (#57)
An unarmed hauler with no weapon component - only VesselCargoComponent,
so it structurally cannot fire, the same pattern that already made the
shield vessel weaponless after #35. Its cargo_capacity (120, six
interceptors' worth) makes it the first real payoff for #56's fleet
hold cap.

Wired into the crafter, hangar and ship lab menus, all of which were
already generic over VesselDefinitions.fleet()/.all() - only the
per-vessel UI *nodes* are hand-placed (Main.tscn), not the logic, so
this repacks those three button rows to 4/4/5 columns and extends
BuildController's matching onready arrays. No new signal handlers were
needed.

Also fixes test_vessel_composition.gd's hardcoded fleet-catalog size
(3 -> 4) now that a fourth vessel is fleet-eligible.
2026-08-16 16:20:39 +02:00
Loïc Wisniewski
097e17f7aa Gas burner building and the energy resource (#54)
A new building that consumes gas to produce energy, a new resource
stored and moved exactly like ore and gas.

The resource: EnergyResourceGlyph (a cell/bolt mark) + energy's own
warm yellow-green ResourceDefinition, registered in
ResourceDefinitions.ORDER/DEFINITIONS and GameState.RESOURCE_ENERGY.
Inventory/ResourceBar/ResourceTransferList needed no changes - #49
already made them resource-agnostic, confirmed structurally in the
test rather than touched.

The building: GasBurnerBuildingVisual (a hexagonal chamber with intake
vents in gas's colour and output ports in energy's, so the silhouette
itself reads "gas in, energy out"), GasBurnerBuildingDefinition
(capabilities=["gas_burner"], its own build-menu icon appended to
IconButton.Icon rather than inserted, per the ticket's own warning
about renumbering stored scene values), and the matching
UI/BuildMenu/GasBurner* nodes in Main.tscn. Gated behind a new
"Power Systems" skill-tree node, mirroring how "freight" unlocks the
transport hub.

Conversion: _advance_gas_burners(), simulated in GameState alongside
_advance_production/extractor mining so it keeps running while the
player is elsewhere. Withdraws gas and deposits energy in the
building's OWN inventory only - never the bank - so it stalls with no
local gas exactly like a lab waiting on materials.

Logistics: a gas burner's ongoing gas deficit is folded into the
existing queued-building-supply dispatch path (same "needs resource X"
loop production/research orders already use, extended with
gas_burner_gas_deficit()), and a new TO_BUILDING_PICKUP/
TO_MOTHERSHIP_FROM_BUILDING transporter state pair collects its energy
to the bank, mirroring the extractor pickup path per the ticket. The
existing f5c60f8 priority (queued deliveries outrank collection) holds:
the pickup dispatch loop runs last.

Tests: new tests/test_gas_burner.gd (resource genericity, stall
semantics, research gate, and full delivery+pickup logistics via a
real hub), run_tests transporter/resource regressions, and screenshots
of the build menu (all 7 buildings) and transfer menu (all 3
resources). Full suite: 81/81.

Two real bugs found and fixed along the way, neither gas-burner-
specific:
- _transporter_inbound_to() matched ANY non-idle transporter with a
  matching target_id, regardless of purpose. Once pickup states shared
  target_id with delivery states (both address a building, not an
  extractor), a transporter delivering gas made the SAME building look
  "busy" to the unrelated energy-pickup dispatch, starving it even
  with a second, genuinely free transporter sitting idle at the hub.
  Split into _transporter_inbound_to() (delivery states only) and a
  new _transporter_inbound_for_pickup() (pickup states only).
- The build menu's 3-row/6-slot layout (MENU_ROW_TOPS + row content
  sizing) had no room for a 7th building - despite the ticket's own
  note that no layout changes should be needed. A naive 4th row ran
  off the bottom of a 720x1280 viewport; fitting one meant both adding
  a 4th row top AND shrinking the shared button/label/cost sizing so
  each row's content no longer taller than the compressed row spacing.
  Caught only by actually screenshotting it - a real build menu, not
  headless, since --headless renders nothing.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 12:10:31 +02:00
Loïc Wisniewski
a1ad6cc844 Add planet conquest state and gate extractor placement (#41)
Planets now need every capture point held before an extractor can go
up there: GameState tracks per-planet capture progress keyed by the
same stable planet_id as extractors, and BuildController's four
extractor placement checks (menu enable, status text, info popup,
confirm) all re-check conquest, not just proximity/duplication.

Part of the #40 conquest-mechanic breakdown.
2026-08-15 14:41:19 +02:00
Loïc Wisniewski
1d9afcbc2e Add gas bomber skill-shot vessel 2026-08-15 04:45:15 +02:00
Loïc Wisniewski
d0a9f5b971 Provision transporters with hubs 2026-08-15 00:09:10 +02:00
Loïc Wisniewski
663648d949 Refine context actions and preserve fleet landings 2026-08-14 23:15:12 +02:00
Loïc Wisniewski
db0e6a0ec2 Add manual extractor resource transfers 2026-08-14 22:21:01 +02:00
Loïc Wisniewski
e2d4297ee5 Key extractors by stable planet identity 2026-08-14 22:16:40 +02:00
Loïc Wisniewski
14081ad230 Compose vessels from definitions and capabilities 2026-08-14 22:12:57 +02:00
Loïc Wisniewski
0504b24d8d Compose buildings from definitions and capabilities 2026-08-14 21:44:28 +02:00
Loïc Wisniewski
8231e165ff Refactor multi-resource UI and transfers 2026-08-14 11:54:31 +02:00
Loïc Wisniewski
ac5b5415f5 Correct gas HUD and transfer rows 2026-08-13 23:25:46 +02:00
Loïc Wisniewski
7d05042f51 Redesign resource transfer interface 2026-08-13 23:02:09 +02:00
Loïc Wisniewski
4c82155cf3 Support gas cargo transfers 2026-08-13 22:17:24 +02:00
Loïc Wisniewski
e9acca569e Queue lab research from local stock 2026-08-13 22:04:21 +02:00
Loïc Wisniewski
fc68c4e8cf Add gas giant resource system 2026-08-13 21:07:35 +02:00
Loïc Wisniewski
8f7b58f2a8 Highlight selected ship lab cards 2026-08-13 20:56:24 +02:00
Loïc Wisniewski
d20a62a26f Expand contextual actions horizontally 2026-08-13 20:54:22 +02:00
Loïc Wisniewski
d79c756d5b Collapse contextual building actions 2026-08-13 20:49:15 +02:00
Loïc Wisniewski
1c9ac62e8c Differentiate ship lab upgrade icons 2026-08-13 20:13:32 +02:00
Loïc Wisniewski
8219893cda Improve ship lab upgrade selection 2026-08-13 16:45:08 +02:00
Loïc Wisniewski
13492a52e2 Make research tree vertically scrollable 2026-08-13 16:25:41 +02:00
Loïc Wisniewski
06081c41b0 Improve ship crafter and hangar controls 2026-08-12 23:08:43 +02:00
Loïc Wisniewski
82552464d2 Add timed craft queue and hangar 2026-08-12 22:47:46 +02:00
Loïc Wisniewski
b6427b080d Remove the one-way ore API superseded by the transfer menu
The loose end from #24. withdraw_to_fleet, unload_into_building and
deliver_cargo were the old one-way moves behind "Load ore" and "Store
ore here"; every one of them is a special case of transfer_to_building /
transfer_to_fleet, and none had a caller left outside tests. The
cargo_delivered signal had no listeners at all.

Not just tidying: unload_into_building routed through
deposit_to_building, which does NOT special-case the mothership - it
writes b.stock, while building_holdings() returns `rocks` for a
mothership and ignores stock entirely. So unload_into_building(
mothership_id) would have parked ore in a field nothing reads, with no
error. Nothing called it that way, but it is a plausibly-named function
sitting there to be reached for later. transfer_to_building handles it.

CARGO_LOAD_BATCH stays - the transfer menu's batch buttons use it; only
its role as withdraw_to_fleet's default argument is gone.

The #24 note expected folding these in to be costly for
test_cargo_readout, which places no buildings. It is not: the transfer
primitives work off GameState records rather than spawned nodes, so a
single add_building() in setup is enough and it stays a display test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 13:07:52 +02:00
Loïc Wisniewski
fe1c721d64 Restore the crafter binding lost in an over-wide edit
This is the actual cause of "the build a ship menu buttons do nothing",
reported four times. Opening the crafter panel stopped recording WHICH
crafter: when the auto-unload was replaced with an explicit store button,
the replaced block reached one line further up than intended and took
`craft_building_id = current_building.building_id` with it. Every handler
in the panel then bailed out at its `if craft_building_id == 0` guard,
while the panel itself still opened and Close still worked - because
Close is the only button that does not need the binding.

The silent `return` on that guard is what let it pass unnoticed, so it
now says so instead.

The test was complicit: it set craft_building_id by hand, which skipped
the exact step that was broken. It now parks the fleet on the crafter,
waits for the action button to debounce in, and presses it - the way the
game does. Verified against the broken code: it fails with
"opening the panel did not record which crafter".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 23:55:12 +02:00
Loïc Wisniewski
ee9d6ad9c6 Fix every button being permanently blocked after closing the build menu
The real cause of "the crafter buttons do nothing", reported three
times. IconButton._blocked_by_modal tested `menu.visible`, but hiding a
parent leaves a child's own `visible` flag true - and the build menu's
info popup is itself one of the modal panels. So opening any building's
info popup and then closing the build menu with the X left an invisible
popup still claiming to be open, and from that moment EVERY button in
the game was blocked, with no way for a player to get out of it.

It tests is_visible_in_tree() now, and closing the build menu also
closes its popup rather than leaving it half-open.

My earlier attempts kept missing it because the probes called the
handlers directly - they exercised the crafter logic, which was fine all
along, and never the input path in that state. The regression test
reproduces the exact sequence: open the build menu, show a building's
info, hide the menu, then check an unrelated button still fires.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 23:41:00 +02:00
Loïc Wisniewski
1cbae8ff70 Ship Lab: per-vessel research, and the shield vessel
Forgejo #5. A new building gated behind a "Vessel Science" research
node. Its own screen upgrades each vessel type - weapon, movement,
shield and freight - and unlocks the shield vessel, which the ship
crafter can then build.

Vessel research is deliberately NOT more nodes in the mothership tree:
that tree gates what may be built at all and is a strategic spine, while
these are repeatable tuning on vessels already owned. Levels cost
base * (level + 1), so the third point in something is not the price of
the first. Upgrades are read live rather than baked in at build time, so
researching one improves the ships already flying.

The shield is personal, not a bubble: it absorbs a hit that would
destroy the vessel - ships have no health, contact kills - and is then
down until it cycles. Its ring is a NeonPiece child toggled with
`visible` per #10, not a redraw of the hull.

The build menu now holds six entries across three rows, which the #21
repacking already handles.

Enemies still have no weapon, so "blocks shots" has nothing to block
yet; that is filed separately rather than widened into this ticket.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 23:31:49 +02:00
Loïc Wisniewski
19ac758da1 Typed owed vessels, ship lab building type, shield vessel gate
Groundwork for #5. vessels_owed carries the VESSEL TYPE rather than a
bare count, so a shield vessel finishing while the player is on a planet
comes back as a shield vessel. Fleet.add_ship takes a type, and vessels
already flying are re-statted when an upgrade is researched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 23:10:07 +02:00
Loïc Wisniewski
004808f067 Repair a broken working tree, and make every crafter press report
The crafter buttons doing nothing was not the crafter: Ship.gd was left
mid-edit and failed to parse (undeclared SHIELD_COLOR/SHIELD_RADIUS, and
a spawn() that only exists on the concrete VFX subclass). A script that
does not compile takes Main.tscn's whole node tree with it, so every
button in the game was dead. The project directory is the one being
played from, so an unfinished edit there is a broken build - finish or
revert before stopping.

With that fixed, the real gap underneath: an order the crafter cannot
pay for is ACCEPTED and queued (#16), which is indistinguishable from a
dead button. Ordering now reports either "building now" or "queued - N
more ore must be delivered here", and the transient message is rendered
LAST so it is the first line read rather than buried under the standing
fleet-capacity note.

test_crafter_feedback covers all three presses and asserts the message
survives the per-frame refresh, which is the specific way this looked
broken before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 22:50:09 +02:00
Loïc Wisniewski
0e071877e2 Fix the stop stutter, and hide unresearched buildings from the menu
Forgejo #13: releasing the stick paused, then moved again before
settling. stop() aims each ship at a braking point ahead of it, but the
ship's own velocity was ~0 - the anchor had been carrying it - so it
started from REST, accelerated into its own stopping distance, and
halted a second time. Measured: 0 -> 45 -> 90 -> 135 -> 180 -> brake.
stop() now hands the fleet's motion to the ship, so the release is one
continuous decelerating coast (222 -> 0) to the identical endpoint.
test_joystick_control now asserts the speed one frame after release is a
real fraction of cruise, and never rises afterwards.

Forgejo #21: unresearched structures are no longer listed greyed out.
They are hidden, and the menu repacks around what is left - a fixed grid
with entries hidden would otherwise leave holes where they used to be.
An entry alone on its row is centred rather than hanging in the left
column. Researched-but-not-usable is still shown greyed: an extractor
with no planet under the fleet is "not now", not "not yet".

This reverses a documented decision (the old comment argued that always
listing everything stops the player wondering whether the game has it at
all), so test_skill_tree's matching assertion was updated from
greyed-but-listed to hidden. The gate itself is unchanged and still
refuses a build forced past the menu.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 21:38:17 +02:00
Loïc Wisniewski
da8f6a81ea Block input behind open panels; keep craft-menu messages on screen
Three play-testing reports.

1. Buttons behind an open panel were still clickable. There are two
   input paths and both leaked. GUI clicks: the research and formation
   panels cannot block with mouse_filter = STOP, because their contents
   are driven from raw _unhandled_input and a Control consuming touches
   through the GUI system swallows them first - so the panels stay
   transparent and IconButton now checks whether it is behind one, via a
   "modal_menus" group. Raw input: a touch landing on the research panel
   but missing a node was left unhandled, so it fell through to
   GameController - which sits on the ROOT node and sees whatever its
   children ignore - and moved the fleet or pinch-zoomed the world.

2. "Store ore here" looked dead. It was working: the confirmation was
   overwritten one frame later by the per-frame status refresh added in
   #16, so it flashed for a single frame. Craft-panel messages now
   outlive a refresh (3s), and the button stays ENABLED with an empty
   hold so pressing it can say why - a greyed button that cannot explain
   itself is the same dead-button problem.

3. The mothership's description could overlap the button below it. The
   description block was positioned from the TOP while the buttons were
   anchored to the BOTTOM, so the gap between them was whatever the
   screen height left over - overlapping at 1280 and separating at 960.
   It is one bottom-anchored stack now, checked at both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 20:17:58 +02:00
Loïc Wisniewski
f19807618a Transporter capacity per hub, and research to raise it
Forgejo #20, part 7 of #12 and the last of it. A hub stations
BASE_HUB_CAPACITY (2) transporters. Total berths are hubs x per-hub
capacity, so building another hub or researching "Freight Yards" both
raise it - which is the choice #12 asks the player to make.

Capacity follows the same shape as max_fleet_size() (sum a bonus over
`unlocked`) rather than being a second mechanism doing the same job, so
research applies to hubs already built, not only to ones placed
afterwards.

A queued-but-unbuilt transporter holds its berth. Without that a player
could order ten against two berths and only discover the problem when
they refused to appear. Ordering past the cap is refused outright, and
the two refusals - no hub at all, versus every berth taken - say which,
because "nothing happened" is exactly the bug reported against the
craft button.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 19:43:55 +02:00
Loïc Wisniewski
d41128bc43 Transporter vessels, an explicit store button, and bottom-anchored menus
Forgejo #19, part 6 of #12. Transporters are built at the ship crafter,
fly themselves to the nearest hub and wait there. When a building is
short of what its queue needs, the nearest idle transporter runs
hub -> mothership -> building -> hub. Ore leaves the bank when it is
loaded and lands in the building's stock on arrival, so what is drawn
and what happens are the same event - the extractor hauler's rule.

Production orders are now TYPED (interceptor / transporter) rather than
a bare count, since the crafter builds two different things. One at a
time is dispatched per building: without that, every idle transporter
chases the same shortfall and they all arrive carrying ore nobody needs.

Three fixes from play-testing feedback:

- Storing ore into a building is now a deliberate button press, not a
  side effect of opening the menu.
- The mothership's load-ore controls were positioned from the TOP of the
  screen, so on any viewport shorter than ~1300px the label fell off the
  bottom. They are anchored to the bottom edge now, and the label had no
  explicit font size so it inherited the theme's 78px and wrapped off
  screen. Checked at 720x960 and 720x1280.
- The craft button looked live and did nothing. It was not the transport
  work: BASE_FLEET_SIZE is 5 and a new game starts with exactly 5 ships,
  so the fleet is at its cap from the first frame and every interceptor
  order was refused. The button is now visibly disabled and says why.
  The underlying balance (crafter useless until Wing Doctrine) is left
  alone - that is a design call, not a bug to quietly change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 19:14:27 +02:00
Loïc Wisniewski
823828f3b3 Transport Hub building
Forgejo #18, part 5 of #12. The building only - the vessels that do the
hauling are #19. Placeable, costed at 30, gated behind a new "Freight
Handling" research node hanging off Logistics, with its own info popup,
build-menu glyph and map marker.

Drawn as an octagonal dock ring with berth arms and a squared-off freight
core: deliberately radial-but-flat so it does not read as a small
mothership, which is the only structure with swept arms. Its stationed
transports are NeonPiece children of one rotating holder, per #10 - the
geometry is rasterised once and only the holder's rotation changes, so
the traffic costs no redraws.

Building._draw()'s match has a catch-all that renders anything
unrecognised as a ship crafter, so a missing case is silent and looks
almost right. The test checks for the hub's own _hub_traffic holder
rather than trusting that something plausible appeared - which caught
exactly that: a _ready() patch had silently not applied and the hub was
rendering through the crafter branch.

The build menu grew a third row. Every button, label and price moved:
the old row occupied 332px against a 372px pitch, and three of those do
not fit above a 1280px screen. Rows are now shorter (128px buttons, 40px
price digits) at a 290px pitch, ending at y=1176. Rendered and looked at
- the first attempt tightened the pitch alone and left every price
overlapping the row beneath it, which no headless test would have seen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 17:45:07 +02:00
Loïc Wisniewski
ff162faef5 Supply a building by hand: withdraw at the mothership, unload on arrival
Forgejo #17, part 4 of #12. #16 lets an order queue waiting for ore, so
something has to be able to fulfil one. Until transporters exist (#19)
this is the only route, which is why it lands before them rather than
after: otherwise a player with a queued order and no Transport Hub is
stuck forever.

A "Load ore" button at the mothership moves a batch from the bank into
the fleet's hold, and opening a building hands it whatever the fleet is
carrying.

Delivery at the mothership is now EDGE triggered on arrival rather than
running every frame the fleet is parked there. Continuous delivery made
withdrawing impossible - ore loaded into the hold was banked again on the
very next frame, so the button would have looked broken. A batch rather
than the whole bank, because the hold is the part that can be lost and
emptying the bank in one tap would also strand research, which still
spends from it.

Both new logistics tests now clear existing asteroids: disabling
AsteroidField only stops new chunks spawning, and a drifting rock
destroying a parked ship changed the fleet size the tests assert on.
That was a real intermittent failure, seen once in a full run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 16:36:11 +02:00
Loïc Wisniewski
3573ccf44f Buildings produce from their own stock, and queue orders until supplied
Forgejo #16, part 3 of #12. BuildController deducted the cost from the
bank at the moment of purchase and refused outright with "Not enough
rocks", so nothing ever had to be delivered anywhere. Each building now
carries its own stock, and an order it cannot pay for yet is QUEUED and
completes by itself once ore arrives.

Records get an `id` because a building has to be referable across the
space <-> planet-surface scene swap, when every Building NODE has been
destroyed and rebuilt. Position would nearly work and then fail on two
buildings placed on the same spot.

Production advances in the GameState autoload, the same way extractor
haulers already do, so an order can complete while the player is down a
gravity well. A finished vessel becomes `ships_owed` rather than being
handed straight to a Fleet that may not exist, and the fleet claims what
it is owed when it next has room.

The craft menu remembers which crafter it was opened for: _process()
clears current_building while any menu is open, so by the next frame the
menu would no longer know. It shows the ore delivered HERE rather than
the bank, since showing the bank would promise something the crafter
cannot actually build.

Ship crafting cannot be supplied until #17 lands - nothing yet moves ore
into a building.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 16:18:44 +02:00
Loïc Wisniewski
b641fa5891 Skill tree, node-based building animation, bigger UI, and a 19x faster test suite
Gameplay and UI
- Research tree at the mothership gates which structures can be built and
  grants permanent fleet-capacity upgrades (GameState.SKILL_TREE,
  SkillTreeView). Node depth is derived from prerequisites, so the layout
  cannot drift out of step with the dependencies.
- Building info popup before committing to a build, with per-building cost
  and description.
- Ship crafter redrawn as a space factory with an assembly animation;
  mothership redrawn as a radial flagship; command centre as a plotting hub.
- Keyboard and mouse support (WASD, Q/E pivot, wheel zoom) for the web build.
- UI and font scaled up for phone use, via a custom Theme resource -
  gui/theme/default_font_size does not reach the default theme.
- Asteroids no longer spawn on top of the fleet's start position.
- Fleet formation origin derived from the layout's own offsets rather than
  the centroid, fixing the lurch when a lopsided formation started moving.
- Fleet.stop() brakes from the ship's TRUE motion (velocity +
  fleet_velocity). Ship zeroes its velocity when seated in its slot even
  while the anchor drags that slot forward, so braking from velocity alone
  stopped the fleet dead instead of coasting - and whether it did depended
  on the frame rate.

Animation architecture (issue #10)
- Buildings, projectiles and explosion VFX no longer animate by redrawing.
  Static geometry is rasterised once in _draw(); moving parts are NeonPiece
  children animated through node properties, which reuse the cached
  geometry. Every NeonDraw call expands into four antialiased polylines, so
  redrawing to move something re-tessellated all of it.

Test suite (issue #8): 1075s -> ~55s
- Runs from a copy on Termux's own filesystem. The project lives on
  Android's FUSE bridge, read through proot, where load("res://Main.tscn")
  alone cost 8.5s per test against ~2s natively - and nearly every test
  loads it.
- Runs 6 tests at a time, in a single proot-distro login, with output
  buffered per test and printed only on failure.
- --fixed-fps 60 pins delta instead of measuring the wall clock, so a test's
  result no longer depends on how busy the machine is. Without it,
  parallelism made two tests fail on 2 of 3 runs.
- A test passes only if it both exits 0 and prints ": PASS".
- 38 tests, green on three consecutive runs.

Bundles Carrois Gothic SC (Apache 2.0) with its licence text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 15:00:41 +02:00
Loïc Wisniewski
85814ce88c Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded
infinite world: tap/joystick steering, pinch zoom, formation pivoting,
planet landings, an ore economy with extractors and haulers, and player
built structures (mothership, ship crafter, command centre).

All art is hand-drawn with draw_* calls rather than textures, and the
backgrounds are camera-relative shaders so they stay precise at large
world coordinates.

Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot
tooling that renders real frames through Xvfb and Mesa softpipe, since
--headless has no GPU.

Excluded from version control: .godot/ (import cache, and it holds
export credentials), builds/, android/build/ and packaged APKs - all
regenerable, and ~325 MB combined.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 18:41:58 +02:00