Add comprehensive civilization evolution tests and enhance civilization state management
- Introduced a new test script for civilization evolution (`test_civilization_evolution.gd`) to validate the evolution mechanics, including population dynamics, ethical transitions, and war impacts. - Updated `README.md` to include instructions for running the new civilization evolution tests. - Modified `test_civilization_state.gd` to accommodate changes in civilization rules and ensure proper validation of ethical stages. - Enhanced `test_descriptions.gd` to check for accurate population counters and state validation. - Adjusted `test_life.gd` to reflect updates in life version management. - Improved `civilization_state.gd` to include habitat budget calculations and transition management. - Added `civilization_evolution.gd` to handle the logic for civilization evolution, including population drift, warfare, and colonization mechanics. - Updated `owniverse.gd` and `owniverse_entity.gd` to integrate new evolution logic and ensure proper initialization of entities.
This commit is contained in:
@@ -38,9 +38,9 @@ func dispose(world) -> void:
|
||||
func run() -> void:
|
||||
var world = fixture()
|
||||
var global: Node = root.get_node("Global")
|
||||
check(global.CivilizationRules.size() == 43, "Load all ethical civilization stages")
|
||||
check(global.CivilizationRules.size() == 44, "Load all ethical civilization stages")
|
||||
for row: Dictionary in global.CivilizationRules.values():
|
||||
check(row.ethics.size() == 6, "Every ethical stage has six rules")
|
||||
check(row.ethics.size() == 6 or row.span == 0.0, "Every ethical stage has six rules")
|
||||
world.state.amount.RD = 12.0
|
||||
world.state.amount["C0.2"] = 8.0
|
||||
world.state.binds.RD = {"C2.0": 12.0, "C1.9": 3.0}
|
||||
@@ -67,7 +67,10 @@ func run() -> void:
|
||||
dispose(world)
|
||||
world = fixture()
|
||||
world.state.amount.RD = 10.0
|
||||
world.entities["C1.9"].output_and = {"C2.0": 1.0}
|
||||
for row: Dictionary in global.CivilizationRules["C1.9"].ethics.values():
|
||||
row.progress = "1"
|
||||
row.degradation = "0"
|
||||
row.colonization = "0"
|
||||
world.state.binds.RD = {"C1.9": 10.0}
|
||||
world.state.batches["C1.9"] = [{"amount": 10.0, "start_year": 1.0, "end_year": 1.0}]
|
||||
world._evolve_batches(world.state, 1.0)
|
||||
@@ -107,6 +110,7 @@ func run() -> void:
|
||||
dispose(world)
|
||||
|
||||
world = fixture()
|
||||
world.state.amount.LGW = 20.0
|
||||
world.state.amount.SMBH = 2.0e22
|
||||
world.state.amount["C4.2"] = 3.0
|
||||
world.initialize_life_batches()
|
||||
@@ -117,7 +121,10 @@ func run() -> void:
|
||||
|
||||
world = fixture()
|
||||
world.state.amount.RD = 2.0
|
||||
world.entities["C1.9"].output_and = {"C2.0": 1.0}
|
||||
for row: Dictionary in global.CivilizationRules["C1.9"].ethics.values():
|
||||
row.progress = "1"
|
||||
row.degradation = "0"
|
||||
row.colonization = "0"
|
||||
world.state.binds.RD = {"C1.9": 5.0}
|
||||
world.state.batches["C1.9"] = [{"amount": 5.0, "start_year": 1.0, "end_year": 1.0}]
|
||||
world._evolve_batches(world.state, 1.0)
|
||||
|
||||
Reference in New Issue
Block a user