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
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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()andskill_costs()answer that the wayproduct_costs()already did, so there is one question with one answer whatever is being bought, and every payment path goes throughspend_resourcesinstead ofspend.Structures (7 of 10 now want more than rocks):
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.gdchecks 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:
GameStateare 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_COSTwas 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.