Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run consecutive games without stopping process #52

Open
adakitesystems opened this issue Aug 8, 2018 · 2 comments
Open

Unable to run consecutive games without stopping process #52

adakitesystems opened this issue Aug 8, 2018 · 2 comments
Labels
bug Wrong behavior vs expected behavior. pending tests An issue seems to be fixed but requires testing before being closed.

Comments

@adakitesystems
Copy link
Collaborator

The bot will slowly degrade more and more if the bot process is not closed after each game.

@adakitesystems adakitesystems added the bug Wrong behavior vs expected behavior. label Aug 8, 2018
@adakitesystems
Copy link
Collaborator Author

After more testing, I believe this is an issue with the actual bot and not BWAPI4J.

@adakitesystems adakitesystems removed the bug Wrong behavior vs expected behavior. label Aug 10, 2018
@adakitesystems adakitesystems added bug Wrong behavior vs expected behavior. pending tests An issue seems to be fixed but requires testing before being closed. labels Oct 16, 2018
@adakitesystems
Copy link
Collaborator Author

Thanks to @Jabbo16 for providing more details and testing with his bot with which he is currently experiencing degrading effects when running consecutive games.

I'm re-opening this issue for documentation and discussion purposes. BWAPI4J clears three containers before initializing types for consecutive games:

this.players.clear();
this.units.clear();
this.bullets.clear();

This may not be enough to get a completely cleared state. In addition, I do not like manually clearing containers to "reset" the state. In my opinion, this is a dubious approach. Since BWAPI4J does not have any static members or singletons, I would like to be able to just create a new BW object for each new game instead of reusing the same object and manually "clearing" members.

I still believe closing both the BW process and Java bot process is the best way to run games. However, it should be decided upon if BWAPI4J will support consecutive games. If yes and there is an evident consecutive game bug with BWAPI4J, the bug should obviously be fixed. If BWAPI4J decides not to support consecutive games, code should be modified to end the process after each game.

adakitesystems added a commit to adakitesystems/BWAPI4J that referenced this issue Oct 17, 2018
- Helps with Issue OpenBW#52: "Unable to run consecutive games without
stopping process"
- It would be better to create an entirely new "BW" object instead
of manually resetting members.
adakitesystems added a commit to adakitesystems/BWAPI4J that referenced this issue Oct 17, 2018
- Helps with Issue OpenBW#52: "Unable to run consecutive games without
stopping process"
- It would be better to create an entirely new "BW" object instead
of manually resetting members.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Wrong behavior vs expected behavior. pending tests An issue seems to be fixed but requires testing before being closed.
Projects
None yet
Development

No branches or pull requests

1 participant