Add core simulation modules for owniverse mechanics

- Introduced `life_evolution.gd` to manage life evolution processes.
- Implemented `manual_production.gd` for handling production mechanics, including resource management and production steps.
- Created `object_batches.gd` to manage batches of objects, including scaling and appending batches.
- Developed `object_ledger.gd` for tracking physical amounts, available resources, and binding ownerships.
- Added `simulation_module.gd` as a base class for simulation modules, providing a weak reference to the world.
- Established `stellar_rules.gd` for managing stellar evolution and destruction mechanics.
- Introduced `universe_environment.gd` to calculate environmental parameters based on the current state of the universe.
This commit is contained in:
Kirill
2026-09-29 20:23:20 +03:00
parent da03ba11c0
commit f2111a376a
42 changed files with 1681 additions and 1704 deletions
+8 -8
View File
@@ -17,21 +17,21 @@ func fixture():
var global: Node = root.get_node("Global")
for id in global.OwniverseEntities:
var entity = load("res://world/owniverse/owniverse_entity.gd").new(global.OwniverseEntities[id])
world.entities[id] = entity
world.catalog.entities[id] = entity
world.state.amount[id] = 0.0
world.state.stats.total_amount[id] = 0.0
if entity.group_as != "":
world.state.amount[entity.group_as] = 0.0
world.state.stats.total_amount[entity.group_as] = 0.0
world.entities["N"].life_product = {}
world.entities["N"].product_per_year_type = "H"
world.entities["N"].product_per_year_amount = 10.0
world.entities["N"].auto = 0.0
world.catalog.entities["N"].life_product = {}
world.catalog.entities["N"].product_per_year_type = "H"
world.catalog.entities["N"].product_per_year_amount = 10.0
world.catalog.entities["N"].auto = 0.0
world.state.amount.N = 1.0
return world
func dispose(world) -> void:
for entity in world.entities.values():
for entity in world.catalog.entities.values():
entity.free()
world.free()
@@ -65,11 +65,11 @@ func run() -> void:
world.state.amount.EON1 = 2.0
world.state.binds.G.EON2 = 3.0
var saved_state: Dictionary = world.state.duplicate(true)
var counters: Dictionary = world.get_item_amounts()
var counters: Dictionary = world.presentation.amounts(world.state, world.catalog)
check(counters.HP == 7.0 and counters.LP == 5.0 and counters.Planet == 12.0, "Planet counters include bound objects and aggregate eons")
check(counters.RD == 2.0, "Star counters retain available quantity")
check(world.state == saved_state, "Reading counters does not mutate simulation")
check(world.get_item_amounts(true).HP == 0.0, "Produced counters remain independent of current population")
check(world.presentation.amounts(world.state, world.catalog, true).HP == 0.0, "Produced counters remain independent of current population")
values = description.variables(world, global, "RD", 2.0)
check(values.amount.contains("#40cc40") and values.amount.contains("+2.0"), "Increase green")
var stage_script = load("res://stage/stage.gd")