Closed duyminh1998 closed 9 months ago
Two possible causes:
VP_SetTimeCompression(...)
line in the Export observation initially
event.It seems likely that our Export observation initially
event is not firing upon scenario load (or it is not firing consistently). This is because we also observe that we are not correctly writing out that the scenario has not ended (it has been restarted).
If the Export observation initially
event sometimes does not fire, then there are two potential solutions:
Export observation initially
action again.Can be tested by modifying the Export observation initially
action in-game with the lines
ScenEdit_RunScript('pycmo_lib.lua', true)
ScenEdit_ExportScenarioToXML()
if math.random() > 0.3 then
VP_SetTimeCompression(3)
ScenarioHasEnded(false)
end
to simulate the scenario sometimes not loading properly
Potential bug noticed while testing: If the *_scen_has_ended.inst
file does not have the entry "Comments": "true"
when we restart the scenario and we do not load the scenario properly (i.e. the Export observation initially
event does not fire), then we will run into a bug where the environment thinks that everything is okay and will proceed to run. This is because the way we check that the scenario has not loaded properly is by checking whether "Comments": "false"
exists in the *_scen_has_ended.inst
file after we restart. This is because we only record "Comments": "true"
in the *_scen_has_ended.inst
file when we end the scenario. Solutions are to record this scenario at the beginning of a run, or to make the check for the scenario not loading properly more comprehensive (e.g. check that the time compression is also not set properly).
Summary
Sometimes when we restart the scenario through
pyCMO
, the time compression is not correctly set, or it resets to x1 timeSteps to reproduce
floridistan/restart_demo.py
script and notice that sometimes when the scenario restarts and loads, the time compression is reset to x1 instead of the correct x15.What is the current bug behavior?
The time compression is reset after the scenario restarts and loads
What is the expected correct behavior?
The time compression is correctly set to whatever was specified in the
Export observation initially
event in the game when the scenario restarts and loads.Relevant logs and/or screenshots