Games-and-Simulations / sc-docker

Multi-platform Version of StarCraft: Brood War in a Docker Container, ready to use for bot play simulations.
MIT License
230 stars 41 forks source link

Cleanup files from previous run #52

Closed kant2002 closed 6 years ago

kant2002 commented 6 years ago

expected behavior

There two possibility

actual behavior

Second game is immediately quits and it is appears that bot is crashing.

See #34 for example how long it take to troubleshoot such issues

steps to reproduce

Run game with same name twice

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test 
scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test 
kant2002 commented 6 years ago

@michalsustr Please take a look. I could implement this, but what to discuss with you first, so my work could fall into your understanding of the product. I actually want to implement first option, since then second option could be implemented by the user themselves as part of their testing environment

michalsustr commented 6 years ago

At the moment the code does "Clean files from previous game run, print message about that and proceed with game." implemented here:

https://github.com/Games-and-Simulations/sc-docker/blob/master/scbw/docker_utils.py#L390

My take on that is that if you specify the name of the game (it is not randomly generated) it should be run without interruption.

michalsustr commented 6 years ago

I updated to check whether the folder exists also in CLI and exit if the user doesn't agree.

https://github.com/Games-and-Simulations/sc-docker/blob/master/scbw/cli.py#L179