Opened 6 years ago

Closed 6 years ago

#5016 closed defect (fixed)

Games with "-autostart-nonvisual" do not end nor generate a replay.

Reported by: gentz Owned by:
Priority: Should Have Milestone: Alpha 23
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by gentz)

Games started with "-autostart-nonvisual" never end. They also never generate a replay.

Tested with the following command with a22 for 72 thousand turns:

0ad \
	-mod=public \
	-autostart="$MapDir" \
	-autostart-nonvisual \
	-autostart-seed=-1 \
	-autostart-size=192 \
	-autostart-players=2 \
	-autostart-aiseed=-1 \
	-autostart-ai=1:petra \
	-autostart-ai=2:petra \
	-autostart-aidiff=1:5 \
	-autostart-aidiff=2:5 \

Testing with the following command on r21096 for 50 thousand turns.

binaries/system/pyrogenesis \
	-mod=public \
	-autostart="$MapDir" \
	-autostart-nonvisual \
	-autostart-seed=-1 \
	-autostart-size=192 \
	-autostart-players=2 \
	-autostart-aiseed=-1 \
	-autostart-ai=1:petra \
	-autostart-ai=2:petra \
	-autostart-aidiff=1:5 \
	-autostart-aidiff=2:5 \

Edit: MapDir is "random/mainland". I've just tested with ai two with difficulty 0 and the game still isnt ending.

Attachments (2)

pyrologs.7z (29.6 KB ) - added by gentz 6 years ago.
fix-autostart-victory.patch (599 bytes ) - added by mimo 6 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 by gentz, 6 years ago

Description: modified (diff)

comment:2 by gentz, 6 years ago

Here are the logs for the difficulty zero game: http://termbin.com/945m

(gotten from running "tail -vn +1 /home/gentz/.config/0ad/logs/* | nc termbin.com 9999")

comment:3 by elexis, 6 years ago

Feature was introduced in r19645 / #4577 / Phab:D379

comment:4 by Sacha Vrand, 6 years ago

Hello, did you set some victory conditions ?

-autostart-victory=SCRIPTNAME sets the victory conditions with SCRIPTNAME located in simulation/data/settings/victory_conditions/

-autostart-victoryduration=NUM sets the victory duration NUM for specific victory conditions

If I remember correctly and it hasn't changed, there are no victory conditions by default.

comment:5 by mimo, 6 years ago

and concerning the other point "nor generate a replay": that's expected as such a replay would be empty because no commands are sent (only some computed ones from the ai).

comment:6 by elexis, 6 years ago

One (who likely isn't me) might want to see that game visually or debug using a replay, but one can restart the same match with the same commands with visual autostart? If the replays were written, maybe it were better optional, as this is supposed to be used in batch-mode? To solve the originally reported confusion, one could make the victory condition mandatory. Don't know how needed these things are.

in reply to:  4 comment:7 by gentz, 6 years ago

Replying to Sacha Vrand:

Hello, did you set some victory conditions ?

-autostart-victory=SCRIPTNAME sets the victory conditions with SCRIPTNAME located in simulation/data/settings/victory_conditions/

-autostart-victoryduration=NUM sets the victory duration NUM for specific victory conditions

If I remember correctly and it hasn't changed, there are no victory conditions by default.

I've redone it with these options and the game ends at ~13000:

./binaries/system/pyrogenesis \
	-autostart='skirmishes/Acropolis Bay (2)' \
	-autostart-ai=1:petra \
	-autostart-ai=2:petra \
	-autostart-aidiff=1:5 \
	-autostart-aidiff=2:5 \
	-autostart-nonvisual \
	-autostart-victory="conquest"

However doing this doesn't end (I let it reach 175k turns):

./binaries/system/pyrogenesis \
	-autostart='random/mainland' \
	-autostart-ai=1:petra \
	-autostart-ai=2:petra \
	-autostart-aidiff=1:5 \
	-autostart-aidiff=2:5 \
	-autostart-nonvisual \
	-autostart-victory="conquest"

However if you remove "-autostart-nonvisual \" it will end roughly 40mins in (~13000 turns)

in reply to:  5 comment:8 by gentz, 6 years ago

Replying to mimo:

and concerning the other point "nor generate a replay": that's expected as such a replay would be empty because no commands are sent (only some computed ones from the ai).

Non visual games appear to have different behaviors on "random/mainland" (and maybe others too.) Replays would certainly help with debugging.

I tried getting replays to be made by making CGame's secound parameter true however the made replays are empty for games inturupted with ctrl-c (files aren't getting flushed for some reasons?) and are only one line for the games which do finish:

cat ~/.local/share/0ad/replays/0.0.23/2018-02-01_0022/commands.txt
start {"mapType":"skirmish","map":"maps/skirmishes/Acropolis Bay (2)","settings":{"CircularMap":true,"Description":"Each player starts the match atop a large flat plateau, otherwise known as an acropolis.\n\nTo the East lies a large bay with fishing opportunities. To the West is a rugged hinterland with an unclaimed acropolis commanding the valley below.","GameType":"conquest","Keywords":[],"LockTeams":false,"Name":"Acropolis Bay (2)","PlayerData":[{"Name":"Player 1","AI":"petra","AIDiff":5,"AIBehavior":"balanced"},{"Name":"Player 2","AI":"petra","AIDiff":5,"AIBehavior":"balanced"}],"Preview":"acropolis_bay.png","RevealMap":false,"mapType":"skirmish","CheatsEnabled":true,"Seed":0,"AISeed":0,"TriggerScripts":["scripts/NonVisualTrigger.js","scripts/TriggerHelper.js","scripts/ConquestCommon.js","scripts/Conquest.js"]},"timestamp":1517552824,"engine_version":"0.0.23","mods":["mod","public"]}
Last edited 6 years ago by gentz (previous) (diff)

comment:9 by gentz, 6 years ago

I've just ran all the "random" maps and only fortress came to an end after 20k turns. I did this by executing my maptest.sh script, logs and the two scripts attached above.

Edit: 20k turns should be around 66 minutes. Normaly games end in like 40, the fact only one managed to end in 66 mins shows something is broken.

Edit2: Fortress only ended because it never started, lol.

Last edited 6 years ago by gentz (previous) (diff)

by gentz, 6 years ago

Attachment: pyrologs.7z added

by mimo, 6 years ago

Attachment: fix-autostart-victory.patch added

comment:10 by mimo, 6 years ago

Can you try again with the attached patch (needs recompiling). If that works, it will need to be improved to default to conquest when no victory is given.

in reply to:  10 comment:11 by gentz, 6 years ago

Replying to mimo:

Can you try again with the attached patch (needs recompiling). If that works, it will need to be improved to default to conquest when no victory is given.

That patch works, thank you.

comment:12 by mimo, 6 years ago

Milestone: BacklogAlpha 23
Resolution: fixed
Status: newclosed

Fixed in r21108 (phab:D1278) Thanks for the tests

Note: See TracTickets for help on using tickets.