Enhance civilization flow mechanics and adaptive quality control

- Implemented runtime-only adaptive quality controller to optimize simulation performance based on CPU time.
- Added adaptive quality thresholds and recovery cycles to dynamically adjust simulation fidelity.
- Introduced single-step solving method for civilization transitions to improve performance under high loads.
- Updated benchmark scripts to include speed parameter for testing various simulation speeds.
- Added tests for adaptive quality adjustments and their effects on civilization flow calculations.
- Documented results of optimization attempts and their impact on performance metrics.
This commit is contained in:
Kirill
2026-10-08 22:05:08 +03:00
parent 459fbb2a4d
commit 02c9843e1b
11 changed files with 891 additions and 14 deletions
+6 -2
View File
@@ -18,7 +18,7 @@ func restore_json_integers(value):
func run():
var args = OS.get_cmdline_user_args()
if args.is_empty():
print("Usage: --script tests/benchmark_civilization_flows.gd -- /path/to/save.adventure.json [delta_seconds] [profile] [cycles=100]")
print("Usage: --script tests/benchmark_civilization_flows.gd -- /path/to/save.adventure.json [delta_seconds] [profile] [cycles=100] [speed=1..6]")
quit(1)
return
var data = JSON.parse_string(FileAccess.get_file_as_string(args[0]))
@@ -33,7 +33,11 @@ func run():
if not is_finite(delta) or delta <= 0:
quit(1)
return
for speed in [6]:
var selected_speed: int = 6
for arg in args:
if arg.begins_with("speed="):
selected_speed = clampi(arg.trim_prefix("speed=").to_int(), 1, root.get_node("Global").SPEED_LIMIT)
for speed in [selected_speed]:
var world = load("res://world/owniverse/owniverse.gd").new()
world.catalog.load_definitions(root.get_node("Global").OwniverseEntities)
world.state = initial.duplicate(true)