all building only cost rocks, you can introduce other resources for some building, make the cost meaningful depending on how far they are in the skill tree. same for skill, other resources can be used #138

Closed
opened 2026-08-28 13:14:32 +00:00 by metaheavens · 1 comment
Owner
No description provided.
Author
Owner

Done in 1ece202.

Both halves, 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 that the way product_costs() already did, so there is one question with one answer whatever is being bought, and every payment path goes through spend_resources instead of spend.

Structures (7 of 10 now want more than rocks):

depth price
mothership 0 20 ore
ship crafter 0 12 ore
extractor 1 25 ore
command center 1 15 ore, 6 gas
ship lab 1 30 ore, 18 gas
outpost 2 30 ore, 16 gas
transport hub 2 28 ore, 20 gas
planning center 2 50 ore, 30 gas
gas burner 3 40 ore, 22 gas
spacial workshop 4 50 ore, 28 gas, 18 energy

Doctrines (13 of 17): gas from Vessel Science onward, energy from depth 4 (Armada, Field Engineering, Drone Bays, Battlegroup), and dark matter once - on Grand Fleet, the deepest node in the game. Totals by depth: 15 / 30 / 73 / 96 / 143 / 258 / 530.

The constraint that actually shaped the table is reachability, and it is why some prices stayed rocks-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. The extractor stays rocks-only despite its depth allowing gas, because the quest chain (#133) reaches it before it has sent the player for any.

tests/test_progressive_costs.gd checks all of that as properties rather than transcribed numbers, so rebalancing a price costs nothing while breaking the shape fails: nothing priced in a resource unreachable at its own depth, averages rising with depth for structures and doctrines alike, the ore field agreeing with the dictionary, and the quest chain never asking for a structure it has not funded. It also spends for real - Freight Handling takes its gas, and Power Systems is refused with rocks to spare but no gas, taking nothing on the way out. That last case is exactly what would have passed silently before, when only the ore was ever checked.

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 - precisely what drifts once a price gains a resource. (TRANSPORT_HUB_COST was already stale against the new table before I removed it.)
  • research_for_building() returns a display name, while the id-keyed half of the tree wants an id. The mix-up is silent: skill_depth() of a name finds no node and answers 0, so a deep structure reads as ungated - which is how the first draft of the test let an unreachable price through. research_node_for_building() is the id now, and the name is expressed from it.

Also worth noting: the ore figure and the dictionary's ore entry must agree, and the test pins it. Repair costs are quoted from the ore figure alone, because a repair drone carries ore and nothing else.

Suite: 145/145.

Done in `1ece202`. Both halves, 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 that the way `product_costs()` already did, so there is one question with one answer whatever is being bought, and every payment path goes through `spend_resources` instead of `spend`. **Structures** (7 of 10 now want more than rocks): | | depth | price | |---|---|---| | mothership | 0 | 20 ore | | ship crafter | 0 | 12 ore | | extractor | 1 | 25 ore | | command center | 1 | 15 ore, 6 gas | | ship lab | 1 | 30 ore, 18 gas | | outpost | 2 | 30 ore, 16 gas | | transport hub | 2 | 28 ore, 20 gas | | planning center | 2 | 50 ore, 30 gas | | gas burner | 3 | 40 ore, 22 gas | | spacial workshop | 4 | 50 ore, 28 gas, 18 energy | **Doctrines** (13 of 17): gas from Vessel Science onward, energy from depth 4 (Armada, Field Engineering, Drone Bays, Battlegroup), and dark matter once - on Grand Fleet, the deepest node in the game. Totals by depth: 15 / 30 / 73 / 96 / 143 / 258 / 530. The constraint that actually shaped the table is **reachability**, and it is why some prices stayed rocks-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. The extractor stays rocks-only despite its depth allowing gas, because the quest chain (#133) reaches it *before* it has sent the player for any. `tests/test_progressive_costs.gd` checks all of that as properties rather than transcribed numbers, so rebalancing a price costs nothing while breaking the shape fails: nothing priced in a resource unreachable at its own depth, averages rising with depth for structures and doctrines alike, the ore field agreeing with the dictionary, and the quest chain never asking for a structure it has not funded. It also spends for real - Freight Handling takes its gas, and Power Systems is refused with rocks to spare but no gas, taking nothing on the way out. That last case is exactly what would have passed silently before, when only the ore was ever checked. 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 - precisely what drifts once a price gains a resource. (`TRANSPORT_HUB_COST` was already stale against the new table before I removed it.) - `research_for_building()` returns a display **name**, while the id-keyed half of the tree wants an **id**. The mix-up is silent: `skill_depth()` of a name finds no node and answers 0, so a deep structure reads as ungated - which is how the first draft of the test let an unreachable price through. `research_node_for_building()` is the id now, and the name is expressed from it. Also worth noting: the ore figure and the dictionary's ore entry must agree, and the test pins it. Repair costs are quoted from the ore figure alone, because a repair drone carries ore and nothing else. Suite: 145/145.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#138
No description provided.