mpeterv / rgsimulator

Simulate situations to test your robotgame bot!
The Unlicense
20 stars 8 forks source link

Fix player reloading #17

Open mueslo opened 10 years ago

mueslo commented 10 years ago

When you show actions, the rg.game.Player state is modified. Currently, rgsimulator simply reinstantiates the bots (essentially wiping their memory). This is as if the game started on the turn where the actions are shown.

Two things can change when the actions are generated from the Player instance:

To account for the _module problem, my idea would be to attempt to find out which globals were set by the user and explicitly cache those.

mpeterv commented 10 years ago

So the problem is that rgsimulator can't be used for bots which record and use history of previous turns? It could be partially fixed by not reloading bots the first time actions are calculated, so that continuously simulating turns(pressing Return) would work even for history-eware bots. Adding robot caching looks like a great idea. Not sure how to implement global tracking...

mueslo commented 10 years ago

Yep, that's it. I actually have the solution you suggested implemented locally, but only because I haven't managed to cache players.