Author |
Topic: Arimaa Engine Interface (AEI) (Read 22127 times) |
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #60 on: Sep 19th, 2010, 2:12pm » |
Quote Modify
|
yeah, gameroom.py corresponds to the 'bot' script in the original bot interface so it doesn't have any facilities for running multiple games. Here's the simple python script I use to keep it running forever (forums are destroying the indentation so it's here on pastebin). I suppose I could easily add this to the AEI package if desired. Janzert
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #61 on: Sep 19th, 2010, 3:18pm » |
Quote Modify
|
Please add that to the package. While it is pretty trivial to use a shell-script around that (even a oneliner directly from command line), I'd like to be able to control e.g. whether it continues to play if the bot crashes or loses on time, things like that. Because in such situations bot probably needs to be stopped and fixed, while otherwise (normal losses etc.) it should keep playing.
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #62 on: Sep 21st, 2010, 3:22pm » |
Quote Modify
|
It seems AEI doesn't provide a lot of information about the game to the engine. As far as I understand, everything comes through 'setoption' command. Some things I miss: * game identifier; * move number; usually this would be possible to reconstruct counting 'makemove' (I think, didn't try), but this would be broken if 'setposition' is issued, e.g. if resuming a game; * own name; not important for Badger, but I imagine some engines may choose to behave differently depending on their current nickname.
|
|
IP Logged |
|
|
|
rbarreira
Forum Guru
Arimaa player #1621
Gender:
Posts: 605
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #63 on: Sep 21st, 2010, 4:34pm » |
Quote Modify
|
Resuming a game with the current scripts is done with makemove commands if I understood correctly (which are necessary for reconstructing the repetition history anyway). In my bot I don't support the setposition command, and I'm not planning to unless there's some advantage to it. I guess it could be useful if a GUI used it.
|
« Last Edit: Sep 21st, 2010, 4:35pm by rbarreira » |
IP Logged |
|
|
|
lavalamp
Forum Newbie
Arimaa player #5986
Gender:
Posts: 1
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #64 on: Dec 15th, 2010, 1:07pm » |
Quote Modify
|
I'm playing around with making a bot and I found a bug in roundrobin.py-- Due to a bug in my code, my bot tried to play 4 steps for itself and one for its opponent-- and roundrobin.py is perfectly happy to let it do so!
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #65 on: Dec 15th, 2010, 4:41pm » |
Quote Modify
|
Heh, yep looks like the legality checking doesn't make sure you stop at the end of your turn. If you want to try out a quick fix, in the file pyrimaa/board.py in the do_move method after line 659 "pos = self" add the following lines: Code:if len(steps) > 4: raise IllegalMove("Too many steps in move") |
| That should catch a bot trying to extend control beyond its turn. Janzert
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #66 on: Jan 29th, 2011, 8:24am » |
Quote Modify
|
Ping @reply 62. Can gameroom.py be improved to provide at least some of that information?
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #67 on: Jan 30th, 2011, 11:06am » |
Quote Modify
|
Code: No error given, yet no game is started. In the logs I see: ERROR:gameroom:Could not find game against b with side ''. It is not appropriate when a program fails without any message.
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #68 on: Jan 30th, 2011, 12:51pm » |
Quote Modify
|
on Jan 30th, 2011, 11:06am, doublep wrote: Code: No error given, yet no game is started. In the logs I see: ERROR:gameroom:Could not find game against b with side ''. It is not appropriate when a program fails without any message. |
| Hmm, here I get: Code:D:\MyStuff\Arimaa\aei_work>gameroom.py play b Setting aei protocol to version 1 Setting bot option hash = 800 Setting bot option threads = 4 Could not find game against b with side '' |
| Janzert
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #69 on: Jan 30th, 2011, 12:58pm » |
Quote Modify
|
I guess it depends on logging settings. I have this: http://pastebin.com/4LzQjww0
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #70 on: Jan 30th, 2011, 1:14pm » |
Quote Modify
|
on Sep 21st, 2010, 3:22pm, doublep wrote:It seems AEI doesn't provide a lot of information about the game to the engine. As far as I understand, everything comes through 'setoption' command. Some things I miss: * game identifier; |
| There is no permanent game identifier to give during the game. After the game is finished it does try and retrieve the game id and write it to the file but this doesn't seem to be completely dependable either. What are you wanting it for? I think any database updating or learning should be done by a separate program, or at least run, rather than having the engine do it at the end of the game. Quote:* move number; usually this would be possible to reconstruct counting 'makemove' (I think, didn't try), but this would be broken if 'setposition' is issued, e.g. if resuming a game; |
| Yes, the correct way with the current protocol is to count the moves given to the engine. Even when resuming a game if there is a move history for the bot to take into account it will be caught up to the current position by having all the moves replayed to it. In a future version of the protocol I could see changing the makemove command to including the move number and side information (e.g. 25s). I'm not completely convinced it should but I suppose it does provide an extra check that the controller and engine both have the same idea on the state of the game. Along that same line I could see adding a command for use in debugging to have the engine reply with what it thinks the current position is. Quote:* own name; not important for Badger, but I imagine some engines may choose to behave differently depending on their current nickname. |
| Since you can arbitrarily give a bot any option it wants to accept, I believe that is a better way to go about doing this. The options included in the protocol should just be a very basic set that every engine can handle. For sure one of the things that will be added in a future version of the protocol is a way for engines to let the controller know what (additional?) options it will accept. This is probably primarily useful for GUI controllers though. Janzert
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #71 on: Jan 30th, 2011, 1:22pm » |
Quote Modify
|
on Jan 30th, 2011, 12:58pm, doublep wrote: I haven't looked at that code in quite a long time, but I would guess it is because you have the console logging (which I'm pretty sure is really console output) disabled. Try something like "console = True" and "console_level = Warn" (or Error). Completely disabling it is probably only useful when having gameroom.py run from another script and you don't want it writing to stdout at all. One thing that should be improved is that I don't think it sets any error code in its exit status. Janzert
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #72 on: Jan 31st, 2011, 1:50pm » |
Quote Modify
|
on Jan 30th, 2011, 1:14pm, Janzert wrote:There is no permanent game identifier to give during the game. After the game is finished it does try and retrieve the game id and write it to the file but this doesn't seem to be completely dependable either. What are you wanting it for? |
| For matching the logs created by the bot with game records on the server. Quote:Yes, the correct way with the current protocol is to count the moves given to the engine. |
| Can't AEI's gameroom just do this for me and send result as another 'setoption'? I mean, it's just another not-strictly-needed information like opponent's name, so 'setoption' seems like a good candidate for it. It could be used independently of number of 'makemove's (i.e. the real move number) to ask an engine to think as if it's late game already etc. Quote:Try something like "console = True" and "console_level = Warn" (or Error). Completely disabling it is probably only useful when having gameroom.py run from another script and you don't want it writing to stdout at all. |
| Sorry, but a logging level ought to have no effect on such things. It should not matter whether I disabled console output or not --- on such fatal errors the script should write to stderr unconditionally. I generally have problems with AEI in that it tries to shoehorn engines into logging through it. This is absolutely not needed for communication with the server. I have some logging code in Badger and prefer to keep that rather than switching to AEI logging --- that's why I have console output from 'gameroom.py' turned off.
|
|
IP Logged |
|
|
|
rbarreira
Forum Guru
Arimaa player #1621
Gender:
Posts: 605
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #73 on: Feb 1st, 2011, 4:07am » |
Quote Modify
|
If a program has options for explicitly setting the console warning/error level, it seems pointless to argue that it's not outputting the errors you want to the console (unless of course you have set it to output errors and it's not doing so).
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: Arimaa Engine Interface (AEI)
« Reply #74 on: Feb 2nd, 2011, 10:00pm » |
Quote Modify
|
on Jan 31st, 2011, 1:50pm, doublep wrote:I generally have problems with AEI in that it tries to shoehorn engines into logging through it. This is absolutely not needed for communication with the server. I have some logging code in Badger and prefer to keep that rather than switching to AEI logging --- that's why I have console output from 'gameroom.py' turned off. |
| AEI isn't meant just (or even necessarily primarily) for engines to communicate with the arimaa.com server. I hope someday that more developers will distribute their engines publically so that using desktop clients players can directly play those engines, use them for analysis, etc.. For this I think it would be quite frowned upon to log outside of the protocol. So in that sense yes for sure the AEI philosophy is for all engine output to be contained in the protocol. But given the simplistic state of the current package scripts I can understand that people want to do their own logging. I'd rather not change the protocol to encourage it though. Much better would be to improve the current handling. Janzert
|
|
IP Logged |
|
|
|
|