ASPP / pelita_template

Default template to get started with the Pelita game.
3 stars 25 forks source link

README is missing a few useful things for students #12

Closed jennirinker closed 5 years ago

jennirinker commented 5 years ago

I'm going to leave this issue open and add things as I get frequently asked questions. I will add these details to the readme saturday.

  1. Is the noise distance manhattan or a square? How does the noise get added to the bot position?
  2. How do we find the food we want to eat?
otizonaizit commented 5 years ago
1. Is the noise distance manhattan or a square? How does the noise get added to the bot position?

I think this is explained already in the README in the section bot.enemy[0].is_noisy, no? And it is explained without referring to manhattan distance, which is something most people don't know. Do you think the wording there is not clear enough?

2. How do we find the food we want to eat?

That is a serious miss, damn! Maybe add it after bot.enemy and before bot.enemy[0].is_noisy? The relevant attribute is bot.enemy[0].food.

jennirinker commented 5 years ago

How do we play an entire game from a script without looking at the results?

A lot of students are coding their own tourney, and there's no demo on the GameMaster.

Is there a demo for a test with multiple moves?

Currently, the only demo test is next move, I believe. It would be cool if you could run through a certain number of rounds to see if your bot makes it to a specific location.

jennirinker commented 5 years ago

@otizonaizit I have ideas for changing the wording on the docs but can't think about it now because it's tournament day. I'll offer some suggestions later. :)

Debilski commented 5 years ago

Am 25.01.2019 um 23:14 schrieb Jenni Rinker notifications@github.com:

How do we play an entire game from a script without looking at the results?

from pelita.libpelita import call_pelita
call_pelita(['group0/group0', 'group1/group1'], rounds=None, filter=None, viewer='null', dump=None, seed=None)

Returns a tuple of (game_state, stdout, stdin). All args must be declared (None selects the default). rounds=30 gives a shorter match, viewer='null'disables the Tk viewer.

A lot of students are coding their own tourney, and there's no demo on the GameMaster.

Is there a demo for a test with multiple moves?

--stop-at 30 is not enough for you?

Currently, the only demo test is next move, I believe. It would be cool if you could run through a certain number of rounds to see if your bot makes it to a specific location.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ASPP/pelita_template/issues/12#issuecomment-457749925, or mute the thread https://github.com/notifications/unsubscribe-auth/AANMc807GHuyhDh9Y458lntphV1ZxgU2ks5vG4HFgaJpZM4aQNIr.

otizonaizit commented 5 years ago

How do we play an entire game from a script without looking at the results?

from pelita.libpelita import call_pelita call_pelita(['group0/group0', 'group1/group1'], rounds=None, filter=None, viewer='null', dump=None, seed=None) Returns a tuple of (game_state, stdout, stdin). All args must be declared (None selects the default). rounds=30 gives a shorter match, viewer='null'disables the Tk viewer.

OK, this one needs to become easier! @Debilski : can you open an issue on pelita so that we can track it for the sprint?

A lot of students are coding their own tourney, and there's no demo on the GameMaster. Is there a demo for a test with multiple moves?

--stop-at 30 is not enough for you?

What they mean is a way to create a unit test that spans multiple moves. This is actually done in some demo tests already (for example test_shortest_path in test_demo04_basic_attacker.py) But is is much less useful that it appears at first sight. If you don't have an opponent, what are you testing? I think in these cases it may be more effective to just repeat the game and, as @Debilski says, stop it at the right rodun to verify that it makes the move you want. As soon as the above way of running the game non-interactively from Python becomes useable, it could be used in a unit test too, I guess.

Debilski commented 5 years ago

The problem with this function is that it does not work on Windows which is why I have only told people how to use it when they were already trying to grep the output of pelitagame. But yeah, we can probably add a simpler version (which takes a specific layout and doesn’t try to guess one) and always has the viewer set to null or something.

Debilski commented 5 years ago

https://github.com/ASPP/pelita/issues/552

otizonaizit commented 5 years ago

This has been fixed with the introduction of run_game. See https://github.com/ASPP/pelita_template/blob/master/demo10_background_games.py