Author |
Topic: gamestate file (Read 1117 times) |
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
gamestate file
« on: Feb 20th, 2010, 6:47am » |
Quote Modify
|
I added simple logging to Badger and "game metadata" to help correspond log entries with actual games. I have two questions about contents of game state file: - 'wplayer' and 'bplayer' seem to start with an asterisk ('*'), what does that mean? - neither 'tableId' nor 'gameId' seem to give the ID used on the site e.g. when viewing the game; for instance, Badger logged "Game 166532, move 1; playing against * bot_ArimaaScoreP1", but the link in its recent games is http://arimaa.com/arimaa/games/jsShowGame.cgi?gid=135363&s=b, with a completely different ID. How do I find it so that logs are more useful?
|
|
IP Logged |
|
|
|
Janzert
Forum Guru
Arimaa player #247
Gender:
Posts: 1016
|
|
Re: gamestate file
« Reply #1 on: Feb 20th, 2010, 9:00am » |
Quote Modify
|
The game id during the game is temporary, you can see this when playing as a human too. The permanent id isn't assigned until after the game has finished. I don't believe the permanent id is ever available with the getmove interface so the best you can probably do is the time and date, etc.. AEI's interface will get and write the permanent ID to the AEI log after the end of the game. The ability to even query this is something that was added fairly recently and wouldn't be available until after the last time the getmove interface starts the bot. The players names are given an asterisk when the server believes they are connected to (seated at?) the game. This isn't completely reliable though. Janzert
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: gamestate file
« Reply #2 on: Feb 20th, 2010, 9:18am » |
Quote Modify
|
Thanks. It's a pity there is no way to know "real" game ID, sounds like something server could certainly manage to do (i.e. just assign it when a game starts) without problems... About '*' I think I'll just strip it if it's there then. I'm going to use AEI after this championship, just don't want to do that now. However, that won't replace GTP for me, I'll better write another bridge script ;) GTP just serves a different (broader scope) function.
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: gamestate file
« Reply #4 on: Feb 20th, 2010, 2:43pm » |
Quote Modify
|
on Feb 20th, 2010, 2:01pm, omar wrote:I've started recording the temporary id with the finished games, so you can get to the finished game using a URL like this with the tempid. |
| Thanks, that would help. However, maybe it would be possible to just get away with tempid and make it equal with real ID? I mean for newly created games, of course. With implemented improvement it is now easy to find game on the server from the logs, but it is still difficult to find log entries if you have game ID.
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: gamestate file
« Reply #5 on: Feb 20th, 2010, 2:45pm » |
Quote Modify
|
And while we are at it, is it possible to set up some automated way of retrieving any per-bot files from the server? For instance, if I want to investigate some game during WCC, will I be able to have a look at 'badger.log'? File name doesn't matter for me, I can tell Badger to log message to a different file. But in principle?
|
|
IP Logged |
|
|
|
omar
Forum Guru
Arimaa player #2
Gender:
Posts: 1003
|
|
Re: gamestate file
« Reply #6 on: Mar 3rd, 2010, 11:31am » |
Quote Modify
|
on Feb 20th, 2010, 2:43pm, doublep wrote: Thanks, that would help. However, maybe it would be possible to just get away with tempid and make it equal with real ID? I mean for newly created games, of course. With implemented improvement it is now easy to find game on the server from the logs, but it is still difficult to find log entries if you have game ID. |
| When initially designing the site, I decided to have a table for games that are in progress and a separate table for games that have finished. Each table has it's own auto increment id. It looked like a good decision at the time and still does have many pros, but I didn't see that mapping between the two ids could become a problem. Storing the tempid in the permanent game table has helped. I'll start also showing the tempid on the game comments page. This should make it easier to find the log entries.
|
|
IP Logged |
|
|
|
omar
Forum Guru
Arimaa player #2
Gender:
Posts: 1003
|
|
Re: gamestate file
« Reply #7 on: Mar 3rd, 2010, 11:39am » |
Quote Modify
|
on Feb 20th, 2010, 2:45pm, doublep wrote:And while we are at it, is it possible to set up some automated way of retrieving any per-bot files from the server? For instance, if I want to investigate some game during WCC, will I be able to have a look at 'badger.log'? File name doesn't matter for me, I can tell Badger to log message to a different file. But in principle? |
| Each bot has a logs directory which is accessible from the web. If the bot writes a file to this directory you should be able to view it during the WCC. http://gold.arimaa.com/~badger/logs/ It is the same directory even if you use the silver.arimaa.com server since the bot home directories are shared between the servers.
|
|
IP Logged |
|
|
|
doublep
Forum Guru
Badger author
Gender:
Posts: 82
|
|
Re: gamestate file
« Reply #8 on: Mar 3rd, 2010, 11:49am » |
Quote Modify
|
on Mar 3rd, 2010, 11:31am, omar wrote: When initially designing the site, I decided to have a table for games that are in progress and a separate table for games that have finished. Each table has it's own auto increment id. It looked like a good decision at the time and still does have many pros, but I didn't see that mapping between the two ids could become a problem. Storing the tempid in the permanent game table has helped. I'll start also showing the tempid on the game comments page. This should make it easier to find the log entries. |
| Maybe it is possible to insert an empty row in finished game table when starting a new game? Then you'd have a real ID from the start. Of course, such empty rows would have to be filtered out in all places, with difficulty probably depending on how many such places there are. Or maybe you could insert an empty row and then immediately delete it, so that ID is generated but invalid rows don't mess things in other places. Then, when a game finishes, you could insert in the finished game table with previously generated ID. About logs: thanks, I was told this already in the chat, as I remember by Janzert. Badger's log file is in that directory now, so if something goes wrong in WCC you can always check it.
|
|
IP Logged |
|
|
|
|