spaceship/buildings
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Loïc Wisniewski 1ece202731 #138: structures and doctrines cost more than rocks, and more the deeper they are
Both halves of the ticket, in the shape vessels have used since gas bombers
and laser ships: a definition carries an ore figure and, when it wants more
than ore, a dictionary that IS the price. `building_costs()` and
`skill_costs()` answer it the way `product_costs()` already did, so there is
one question with one answer whatever is being bought, and every payment
path now goes through `spend_resources` rather than `spend`.

Seven of ten structures and thirteen of seventeen doctrines now want gas,
energy or dark matter alongside their rocks, and the totals climb with tree
depth - structures 16/31/58/62/96 by depth, doctrines 15/30/73/96/143/258/530.

The constraint that shaped the table is REACHABILITY, and it is the reason
some prices stayed ore-only. Energy exists only where a gas burner stands,
and a gas burner needs Power Systems - so nothing at or before that depth
may be priced in energy, or it is a wall with no way through. Dark matter is
rarer still and appears once, on the deepest node in the game. The extractor
stays rocks-only despite its depth allowing gas, because the quest chain
reaches it before it has sent the player for any.

test_progressive_costs checks those as properties rather than transcribing
the numbers, so rebalancing a price costs nothing while breaking the shape
fails: nothing unreachable at its own depth, prices rising with depth, the
ore field agreeing with the dictionary (repairs quote the field alone, since
a repair drone carries ore and nothing else), and the quest chain never
asking for a structure it has not funded.

Two things cleaned up on the way:

- The per-building cost constants in GameState are gone. Nothing but tests
  used them, and they were a second copy of a number the definitions already
  hold - exactly what would drift once a price gained a resource.
- research_for_building() returns a display NAME, and the id-keyed half of
  the tree wants an id. That mix-up is silent - skill_depth() of a name finds
  no node and answers 0, so a deep structure reads as an ungated one, which
  is how the first draft of the test let an unreachable price through.
  research_node_for_building() is the id, and the name is expressed from it.

PriceTag no longer rebuilds its labels when re-told the same price; it
refreshes the held figures instead. The craft menu re-states prices every
frame and the build menu now does too, so that was a dozen Labels being torn
down and rebuilt sixty times a second.
2026-08-28 15:30:30 +02:00
..
Building.gd #99 (#97a): buildings have health, and can be destroyed 2026-08-23 13:37:40 +02:00
Building.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
Building.tscn #101 (#97c): waves attack buildings 2026-08-23 13:53:17 +02:00
BuildingActionProvider.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingActionProvider.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingDefinition.gd #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
BuildingDefinition.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingDefinitions.gd #116: the Spacial Workshop, and the drones that mend what waves break 2026-08-23 21:59:51 +02:00
BuildingDefinitions.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingField.gd #99 (#97a): buildings have health, and can be destroyed 2026-08-23 13:37:40 +02:00
BuildingField.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingHitbox.gd #101 (#97c): waves attack buildings 2026-08-23 13:53:17 +02:00
BuildingHitbox.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00
BuildingLogisticsProfile.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingLogisticsProfile.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
BuildingVisualBase.gd #117: the crafter and the lab animate only while they are working 2026-08-23 21:58:59 +02:00
BuildingVisualBase.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
CommandBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
CommandBuildingVisual.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
CommandBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
CommandBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
CrafterBuildingDefinition.tres #99 (#97a): buildings have health, and can be destroyed 2026-08-23 13:37:40 +02:00
CrafterBuildingVisual.gd #117: the crafter and the lab animate only while they are working 2026-08-23 21:58:59 +02:00
CrafterBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
CrafterBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ExtractorBuildingDefinition.tres #99 (#97a): buildings have health, and can be destroyed 2026-08-23 13:37:40 +02:00
GasBurnerBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
GasBurnerBuildingVisual.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
GasBurnerBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
GasBurnerBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
MothershipBuildingDefinition.tres #99 (#97a): buildings have health, and can be destroyed 2026-08-23 13:37:40 +02:00
MothershipBuildingVisual.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
MothershipBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
MothershipBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
OutpostBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
OutpostBuildingVisual.gd #102/#103 (#97d/#97e): the outpost, and the garrison you compose for it 2026-08-23 14:02:20 +02:00
OutpostBuildingVisual.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00
OutpostBuildingVisual.tscn #102/#103 (#97d/#97e): the outpost, and the garrison you compose for it 2026-08-23 14:02:20 +02:00
PlanningBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
PlanningBuildingVisual.gd #106/#107 (#98a/#98b): the Planning Center 2026-08-23 14:21:52 +02:00
PlanningBuildingVisual.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00
PlanningBuildingVisual.tscn #106/#107 (#98a/#98b): the Planning Center 2026-08-23 14:21:52 +02:00
ShipLabBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
ShipLabBuildingVisual.gd #117: the crafter and the lab animate only while they are working 2026-08-23 21:58:59 +02:00
ShipLabBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ShipLabBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
TransportHubBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
TransportHubBuildingVisual.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
TransportHubBuildingVisual.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
TransportHubBuildingVisual.tscn #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
WorkshopBuildingDefinition.tres #138: structures and doctrines cost more than rocks, and more the deeper they are 2026-08-28 15:30:30 +02:00
WorkshopBuildingVisual.gd #116: the Spacial Workshop, and the drones that mend what waves break 2026-08-23 21:59:51 +02:00
WorkshopBuildingVisual.gd.uid Add the .uid files Godot generated for the newest scripts 2026-08-24 12:10:41 +02:00
WorkshopBuildingVisual.tscn #116: the Spacial Workshop, and the drones that mend what waves break 2026-08-23 21:59:51 +02:00