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:
Kirill
2026-09-16 19:54:47 +03:00
parent 5ea65a7e9b
commit 26347fca30
14 changed files with 607 additions and 20 deletions
+11 -1
View File
@@ -190,8 +190,18 @@ func validate_data(data: Variant) -> String:
for ethic in saved.ethics[id]:
if ethic not in ["m", "l", "w", "d", "c", "b"]:
return "invalid ethic " + str(ethic)
if saved.has("life_version") and saved.life_version not in [1, 2]:
if saved.has("life_version") and saved.life_version not in [1, 2, 3]:
return "invalid state.life_version"
if saved.has("civilization_remainders") and not _number_map(saved.civilization_remainders, false, false):
return "invalid state.civilization_remainders"
if saved.has("civilization_stats") and not _number_map(saved.civilization_stats):
return "invalid state.civilization_stats"
if saved.has("civilization_homes"):
if not saved.civilization_homes is Dictionary:
return "invalid state.civilization_homes"
for id in saved.civilization_homes:
if not _number_map(saved.civilization_homes[id], true):
return "invalid civilization homes"
if saved.has("life_remainders") and not _number_map(saved.life_remainders, false, false):
return "invalid state.life_remainders"
if saved.has("resource_remainders"):