feat(scenes): ✨ Add timestamp tracking to auto-play test results for debugging and performance analysis
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
0a42ddde44
commit
ff574318a5
1 changed files with 8 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ var _last_army_pos: Vector2i = Vector2i(-1, -1)
|
|||
var _seed: int = 0
|
||||
var _seed_set: bool = false
|
||||
var _start_time: float = 0.0
|
||||
var _start_stamp: String = ""
|
||||
var _victory_winner: int = -1
|
||||
var _victory_type: String = ""
|
||||
var _outcome: String = "in_progress"
|
||||
|
|
@ -51,7 +52,12 @@ func _ready() -> void:
|
|||
_seed_set = true
|
||||
seed(_seed)
|
||||
GameState.game_settings["seed"] = _seed
|
||||
print("AutoPlay: seed=%d" % _seed)
|
||||
var now: Dictionary = Time.get_datetime_dict_from_system(true)
|
||||
_start_stamp = "%04d%02d%02dT%02d%02d%02dZ" % [
|
||||
now["year"], now["month"], now["day"],
|
||||
now["hour"], now["minute"], now["second"],
|
||||
]
|
||||
print("AutoPlay: seed=%d stamp=%s" % [_seed, _start_stamp])
|
||||
|
||||
_start_time = Time.get_unix_time_from_system()
|
||||
EventBus.victory_achieved.connect(_on_victory)
|
||||
|
|
@ -1092,7 +1098,7 @@ func _write_result() -> void:
|
|||
"invariant_violations": _violations,
|
||||
}
|
||||
DirAccess.make_dir_recursive_absolute(_output_dir)
|
||||
var path: String = _output_dir.path_join("result_%d.json" % _seed)
|
||||
var path: String = _output_dir.path_join("result_%s_seed%d.json" % [_start_stamp, _seed])
|
||||
var file: FileAccess = FileAccess.open(path, FileAccess.WRITE)
|
||||
if file == null:
|
||||
push_error("AutoPlay: cannot open %s for writing" % path)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue