Welcome, Guest. Please Login or Register.
May 2nd, 2024, 11:15am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « Case-based bot »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   Case-based bot
« Previous topic | Next topic »
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Case-based bot  (Read 3390 times)
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Case-based bot
« on: Mar 11th, 2011, 12:15pm »
Quote Quote Modify Modify

Hi I am trying to make a bot using my own case-based code, which just needs the game position to be given. I noticed that the sample java bot provided by Jeff Bacher, which I intend to use, searches a game tree and I was wondering if it would be easy to change that behaviour to use my own code(which I haven't completed yet). Basically I need to be given a position(in the same format as the game logs Ee5, Ce6 etc) and then after I analyse it,  I want to return a move, such as Ee5n. Is that feasible?
IP Logged
Fritzlein
Forum Guru
*****



Arimaa player #706

   
Email

Gender: male
Posts: 5928
Re: Case-based bot
« Reply #1 on: Mar 11th, 2011, 12:22pm »
Quote Quote Modify Modify

Sure, it's feasible, but I'm not sure what you would be re-using from someone else's code except the interface to the game room to get a position and return a move.  You don't want a search tree, right?  In fact, it sounds like you don't even want to generate all possible moves, evaluate each resulting position, and pick the move with the highest evaluation, right?  Instead you want to look at the position and generate a move appropriate to that position?  For that you would be starting from scratch, because that's not how anyone else does it, as far as I know.
 
Or maybe I'm misreading your intention.  If what you want to do is evaluate positions in your own way, then I recall from looking at Don Dailey's sample bot it looked relatively easy to drop in an evaluation function and leave the search unchanged.
« Last Edit: Mar 11th, 2011, 12:24pm by Fritzlein » IP Logged

heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #2 on: Mar 11th, 2011, 12:47pm »
Quote Quote Modify Modify

on Mar 11th, 2011, 12:22pm, Fritzlein wrote:
Sure, it's feasible, but I'm not sure what you would be re-using from someone else's code except the interface to the game room to get a position and return a move.  You don't want a search tree, right?  In fact, it sounds like you don't even want to generate all possible moves, evaluate each resulting position, and pick the move with the highest evaluation, right?  Instead you want to look at the position and generate a move appropriate to that position?  For that you would be starting from scratch, because that's not how anyone else does it, as far as I know.
 
Or maybe I'm misreading your intention.  If what you want to do is evaluate positions in your own way, then I recall from looking at Don Dailey's sample bot it looked relatively easy to drop in an evaluation function and leave the search unchanged.

 
No you were correct, I pretty much just want to be given a position and return a move, I wasn't sure how much of the sample bot was required though. I am able to return the move I want to use when given a position by myself but I don't know how the interfacing to the game-room works. I don't generate all possible moves as you said, and as a bit of a coincidence you're the player my bot is supposed to be modelled after  Grin
IP Logged
Fritzlein
Forum Guru
*****



Arimaa player #706

   
Email

Gender: male
Posts: 5928
Re: Case-based bot
« Reply #3 on: Mar 11th, 2011, 12:53pm »
Quote Quote Modify Modify

Since all you need help with is the interface, I don't think you will need anyone's sample bot.  Unfortunately, I have never gotten a bot running, so I can't help you further, but anyone who has a bot could.  I look forward to playing against my doppleganger!
IP Logged

heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #4 on: Mar 25th, 2011, 9:56am »
Quote Quote Modify Modify

I've been trying to run the python scripts just to see what they do. gameroom.py gives back an error when I try to execute it as is, but I probably need to change things. I don't see how to get the aei to use stdio. Is it easy? It would be helpful if someone could just tell me what to do with the aei files. So far I think I should move the aei files to the same folder as my java bot and change the variables in it to reflect the name of my bot. Then run the gameroom.py script? Then how is the location of stdio specified? Confused Sad
IP Logged
rbarreira
Forum Guru
*****



Arimaa player #1621

   


Gender: male
Posts: 605
Re: Case-based bot
« Reply #5 on: Mar 25th, 2011, 10:29am »
Quote Quote Modify Modify

There is no location for stdio, it just means "standard input/output".
 
All this means is that to communicate with AEI, your bot should print out commands as if it were printing to the screen (console). To get commands from AEI, it should read as if it wanted to get input from the console.
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #6 on: Mar 25th, 2011, 12:12pm »
Quote Quote Modify Modify

Yeah I know, but then I would just run the python scripts and make my code respond to stdio. But I thought that was separate for different programs? As in how does the python script know to look for the stdio from my particular program? If that makes sense, I am probably wrong about stdio though. If so then just running executing gameroom.py without editing shouldn't give me an error right? I have the latest python version, should I go back to the one aei was written in? Even though I amn't sure what version that would be.
IP Logged
rbarreira
Forum Guru
*****



Arimaa player #1621

   


Gender: male
Posts: 605
Re: Case-based bot
« Reply #7 on: Mar 25th, 2011, 1:11pm »
Quote Quote Modify Modify

The python script starts your program, so it can capture output from it and give input to it.
 
What is the error that you are getting? You can post your gameroom.cfg file too.
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #8 on: Mar 25th, 2011, 4:00pm »
Quote Quote Modify Modify

Yep Smiley This is the error I get(I am a complete novice at python so I don't know how to fix the syntax myself)
 
File "gameroom.py", line 87except urllib2.URLError, err:^SyntaxError: invalid syntax
 
The config file is
 
Code:
[global]
# Url of gameroom to connect to
gameroom_url = http://arimaa.com/arimaa/gameroom
 
# Minimum time for a move so we don't flood the server
min_move_time = 5
 
# Time left on the clock when bot controller will try to force the bot to reply
min_time_left = 9
 
# Directory for files to keep track of running bots
run_dir = ./running
 
# Maximum number of bots that can be active at one time
max_bots = 1
 
# bot section to use
default_engine = bot_example
 
[Logging]
# directory to write the log files to
directory = ./logs
 
# overall log level
# Valid levels are (in order of most to least verbose):
#   Debug
#   Info
#   Warning
#   Error
level = Debug
 
# log to the console (stdout) or not
console = True
 
# console log level
console_level = Debug
 
# level to log network information at
# setting this to debug will log every network message to and from the gameroom
# this is a large amount of data
net_level = Info
 
# level to log messages from the bot engine
engine_level = Debug
 
# level to log aei communication messages
aei_level = Info
 
# log the current position after every move
log_position = True
 
[bot_example]
# gameroom username
username = bot_example
 
# gameroom password
password = botspassword
 
# Method of communicating with the bot, options are stdio and socket.
communication_method = stdio
 
# command to run bot
cmdline = ./bot_example
 
# Greeting to send at the beginning of a game
greeting = Hi. I'm just a bot so don't try chatting with me.
    My handler is example writer. If you encounter any problems please notify <email address>
    Thank you for playing me and enjoy the game.
 
# timecontrol to start games at
#timecontrol = 30s/3/100/5/8
timecontrol = 60s/5m/75/0/4h/4m
#timecontrol = 1d/60d/100/0/300d/21d
 
# start rated games
rated = True
 
# should the bot think on opponents turn
# should probably be set to False when playing at a fixed depth
ponder = True
 
# options starting with bot_ are sent to configure the bot before starting play
# Size in MB for transition table
bot_hash = 200
 
# Maximum depth to search; in steps.
# bot_depth = 8
 

 
Actually now the way you said it kinda made me realise what was wrong. The problem being that there is no bot called bot_example... I stupidly thought it was a default thing to test if it works. So I can just use my username/password and I should be able to access the gameroom and play against it?
IP Logged
dree12
Forum Senior Member
****



Arimaa player #4082

   


Gender: male
Posts: 27
Re: Case-based bot
« Reply #9 on: Mar 25th, 2011, 8:48pm »
Quote Quote Modify Modify

What python version are you using? I think that might have something to do with it.
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #10 on: Mar 26th, 2011, 7:46am »
Quote Quote Modify Modify

I'm using version 3.2, it's the latest one.
IP Logged
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: Case-based bot
« Reply #11 on: Mar 27th, 2011, 8:47am »
Quote Quote Modify Modify

Sorry, Python 3 is a new version of the language with several major backward incompatible changes. You'll need to use a Python 2 version for AEI, the most recent is 2.7.
 
Janzert
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #12 on: Mar 27th, 2011, 1:00pm »
Quote Quote Modify Modify

Ok it seems to be working now, thanks Smiley
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #13 on: Apr 5th, 2011, 5:49am »
Quote Quote Modify Modify

I decided to use the perl scripts provided instead so I only had to design the getMove program. I can't find it in the available bots section, but it is connecting to the gameroom and I can only find it through my bot's profile. When I click the sit link, it gives the following page:
 
 
Quote:
Temporarily Unavailable
 
Use the back button of your browser to return to the previous page.
 
Will be restored in a few minutes.
 
Temporarily Unavailable
 
Use the back button of your browser to return to the previous page.
 
Will be restored in a few minutes.
 
Temporarily Unavailable
 
Use the back button of your browser to return to the previous page.
 
Will be restored in a few minutes.
 
Expired Game
 
Use the back button of your browser to return to the previous page.
 
Cannot find the game id for this game.

 
This is the url of the popup page:
http://arimaa.com/arimaa/gameroom/opengamewin.cgi?client=1&gameid=un defined&role=undefined&side=undefined
 
Using the gameid the command line gives me and setting side=w, I can get into the game. It sometimes comes up on the command line that I have entered the game against my bot. Even though I am gold, I can't click start since it constantly says waiting. I can see the personalised message I told my bot to say at the start of each game. If I try to write back, it says I am not a player, yet if I look at the game from the outside it says heroicjanitor is playing vs bot_heroicjanitor. Any ideas as to what is wrong?
IP Logged
heroicjanitor
Forum Full Member
***



Arimaa player #6109

   


Gender: male
Posts: 14
Re: Case-based bot
« Reply #14 on: Apr 5th, 2011, 7:31am »
Quote Quote Modify Modify

UPDATE: I created a game myself and got the bot to join that. It was successful in joining me, I set up my pieces and on his turn he submitted an illegal move(no move) and the game ended. It seems to be a fluke since I can't get him to join again. Or do bots who submit illegal moves get banned?  
EDIT: Ok he joined again... I think I just needed to sign in again.
« Last Edit: Apr 5th, 2011, 7:34am by heroicjanitor » IP Logged
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.