Welcome, Guest. Please Login or Register.
May 16th, 2024, 3:10pm

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « How to begin (the basics of working bots, etc.)? »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   How to begin (the basics of working bots, etc.)?
« Previous topic | Next topic »
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: How to begin (the basics of working bots, etc.)?  (Read 2726 times)
Polyfractal
Forum Senior Member
****



Arimaa player #3241

   


Gender: male
Posts: 27
Re: How to begin (the basics of working bots, etc.
« Reply #15 on: Oct 9th, 2008, 8:27am »
Quote Quote Modify Modify

It probably would be easier to get things running under Linux.  The Arimaa scripts and most bots were designed to play nice under Linux rather than Windows.  If you have a Linux box and rudimentary knowledge of *nix in general, it would probably save you a lot of headache.  That said, Windows is doable.  You already have the hard part done (getting perl configured).
 
For now, ignore everything in the "playtest.exe" package other than the Fairy executable.  Playtest.exe is merely a program to automate playing matches, which it does through the matchOffline script.
 
My bot config file has paths that look like this:
Code:

# Sample bot written in Perl
fairy  .\fairy060518.exe
dna  .\getMove.exe

 
DNA is my bot, Fairy is obviously Fairy.  Both executables are in the same directory as the match script, hence the ".\" before the exe name (".\" means "starting in this directory").  If the executable is elsewhere you'll have to adjust the path, but I would recommend keeping the directories the same until you get everything else sorted out.
 
Once you edited your config, try a "perl match fairy fairy" command like before.  
 
Jdb:  I haven't had to edit the match script at all, it works fine without commenting out that line.  That said, I don't know perl well and am not quite sure what that line does Smiley  (putting quotes around the command variable, or something?)
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #16 on: Oct 9th, 2008, 12:40pm »
Quote Quote Modify Modify

Hmm... just to be clear, all I did was click "download Perl". I haven't actually done anything else with it...
 
I do not have access to a Linux computer, so unfortunately going the easy way is out of the question.
 
At least now I know why there are a whole bunch of files with no extension Smiley
That also explains why there are no line-returns in the files, making it difficult to read instructions XD
That might explain why none of it works... unfortunately, it's ambiguous to one who hasn't seen the file in its original state as to where the line returns are supposed to be.
 
[later]
 
Thanks! Now I'm 1 step closer to getting a game running.
 
While fooling around with it, trying to get fairy to work, I managed to get it to try and run something, but it keeps on getting stuck after the setup, and it won't run fairy at all. Currently I've commented everything out except for
fairy ./fairy060518.exe
Which used to run, but no longer is working. The command line now reads:
 
{my command here as you instructed}
random seed is 990783
no entry in bots for fairy
 
Also, I managed to get it to say
 
{my command, same as before}
random seed is 434692
directory ./fairy060518.exe not found
directory not found: ./fairy060518
 
 
 
My 'bots' file currently looks like:
(more comments above)
#     The <bot command> is the command needed to run the bot.
 
#  The bot command should be relative to the <bot directory>.
 
#  If the bot command contains the string [seed], then this
 
#  string is substituted with a number to be used by the bot  
 
#  program to seed the random number generator.
 
 
 
fairy ./fairy050618.exe
 
#bomb2004CC /home/arimaa/web/arimaa/bots/bot_Bomb2004CC  
#getMove
bomb2005CC /home/arimaa/web/arimaa/bots/bot_Bomb2005CC  
#getMove
 
 
 
 
# pure random bot
 
(everything below commented)
 
Yet it won't recognize 'fairy'. Fairy.exe is currently in C:\Arimaa\matchOffline\fairy060518.exe
Perl is somewhere, but I don't know where... somewhere in C:\Perl\.......
Do I move something somewhere? What do I try next?
 
Thanks (we're getting progress!!),
chess123mate
IP Logged
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: How to begin (the basics of working bots, etc.
« Reply #17 on: Oct 9th, 2008, 12:59pm »
Quote Quote Modify Modify

You can use wordpad instead of notepad to open unix line ending text files under windows. If you are going to do much programming/editing of these files though you're probably better off getting a decent text editor of some sort. Scite is a fairly decent one to start with (http://www.scintilla.org/SciTE.html).
 
Janzert
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #18 on: Oct 9th, 2008, 2:20pm »
Quote Quote Modify Modify

Wow! It's amazing what I'm learning (and downloading XD)
 
However, it still doesn't work... Sad I tried again, but the same results. "no entry in bots for fairy"
 
How do I do it again? Apparently my line doesn't work...  Shocked
 
Hmm... I just tried adding a space between "./" and "fairy060518.exe" and it registered, but then came back and said './' isn't a command -_-
 
And now here's my current status:
 
C:\Arimaa\matchOffline>c:\perl\bin\perl.exe match fairy fairy
random seed is 683838
can't execute command: ./fairy050618.exe getMove in directory: ./fairy1
 
I put the .exe in a folder named 'fairy1' in the same directory to keep with the other formats. The above is the result. I tried it without the 'getMove' as well; same error.
IP Logged
Polyfractal
Forum Senior Member
****



Arimaa player #3241

   


Gender: male
Posts: 27
Re: How to begin (the basics of working bots, etc.
« Reply #19 on: Oct 9th, 2008, 3:08pm »
Quote Quote Modify Modify

Your slashes are the wrong direction.  Linux uses forward slashes ("/") for directory structure, Windows uses backslashes ("\")
 
It should read: fairy .\fairy060518.exe
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #20 on: Oct 9th, 2008, 4:02pm »
Quote Quote Modify Modify

Actually, I've found that Windows doesn't care...
However, I changed it and it still didn't work.  Undecided
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #21 on: Oct 10th, 2008, 8:50am »
Quote Quote Modify Modify

I hate to pester everybody, but I do hope to get this working. Surely I'm missing something; an essential comment, a certain syntax, a perl congfiguration, anything! ...
Also, thanks for everyone's patience.
IP Logged
Polyfractal
Forum Senior Member
****



Arimaa player #3241

   


Gender: male
Posts: 27
Re: How to begin (the basics of working bots, etc.
« Reply #22 on: Oct 10th, 2008, 9:05am »
Quote Quote Modify Modify

on Oct 9th, 2008, 2:20pm, chess123mate wrote:

 
C:\Arimaa\matchOffline>c:\perl\bin\perl.exe match fairy fairy
random seed is 683838
can't execute command: ./fairy050618.exe getMove in directory: ./fairy1
 
I put the .exe in a folder named 'fairy1' in the same directory to keep with the other formats. The above is the result. I tried it without the 'getMove' as well; same error.

 
 
-Move fairy050618.exe into the same folder as the match script.  No extra folder named fairy1
 
-Make sure your bot path is exactly this: ".\fairy050618.exe"
 
-Do not append "getMove", fairy doesn't use a getMove executable
 
-I'm not positive but I'm pretty sure you have to actually install Perl.  You should make sure it is installed if you haven't already.
 
If that doesn't work, I'll zip up my working directory and you can try that instead.  If there are still problems, it is an issue with your Perl installation or computer in general
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #23 on: Oct 10th, 2008, 10:13am »
Quote Quote Modify Modify

I'm pretty sure I've got perl installed... it seems to use it.
 
Ex. I can click on 'perl.exe', and it opens up a command-window. I have no idea what to put in it, but occasionally I can get it to tell me I'm doing something wrong. Anyone know how to exit that? (Not that I need to know, it's just out of interest Smiley )
 
Otherwise, your steps have been followed. I am still getting the error 'no entry in bots for fairy'.
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #24 on: Oct 11th, 2008, 4:46pm »
Quote Quote Modify Modify

Now, thanks to aaaa, I can get a sample perl bot working. However, perhaps due to the fact I'm on Windows, bots like r0 will not run. The sample perl bot will, however it has an annoying error that says "The system cannot find the path specified."
 
Now I have 2 things I want to do:
1. Take the moves from the output and put them in a game. How do I do this?
2. Say I want to start programming a java bot. Is there some source code I could look at, please?
 
Thanks,
chess123mate
IP Logged
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: How to begin (the basics of working bots, etc.
« Reply #25 on: Oct 11th, 2008, 6:18pm »
Quote Quote Modify Modify

From the downloads page, the link under the match offline script is the sample java bot.
 
Janzert
IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #26 on: Oct 12th, 2008, 8:26am »
Quote Quote Modify Modify

That's weird, the first time I downloaded that it didn't give me what it's giving me now... anyone know where the actual source code is in that? The thing is massive...  Shocked [it's probably in some obvious location, too... Smiley ]
IP Logged
omar
Forum Guru
*****



Arimaa player #2

   


Gender: male
Posts: 1003
Re: How to begin (the basics of working bots, etc.
« Reply #27 on: Oct 15th, 2008, 3:16pm »
Quote Quote Modify Modify

I've never really tried using this directly under Windows. As jdb mentioned it could be made to work, but would probably be a lot of pain.
 
You might want to try setting up a local Linux environment and running it under that. My two favorite options are Ubuntu.com and Cygwin.com. Ubuntu is great if you want a complete Linux environment; it can easily be installed to select either Windows or Linux during bootup. Cygwin provides a Linux like environment under Windows; this is the easiest way to get started with Linux.
 
The Linux environments include C and C++ compilers so it makes development easier.
« Last Edit: Oct 15th, 2008, 3:33pm by omar » IP Logged
chess123mate
Forum Senior Member
****



Arimaa player #3547

   


Gender: male
Posts: 29
Re: How to begin (the basics of working bots, etc.
« Reply #28 on: Oct 21st, 2008, 11:34am »
Quote Quote Modify Modify

Well, I've downloaded cygwin... have no idea what to do with it, but I've got it downloaded Smiley
 
Anyone familiar with cygwin who can point me in the right direction?
Thanks,
chess123mate
IP Logged
omar
Forum Guru
*****



Arimaa player #2

   


Gender: male
Posts: 1003
Re: How to begin (the basics of working bots, etc.
« Reply #29 on: Oct 21st, 2008, 8:29pm »
Quote Quote Modify Modify

Hope you were able to get it installed OK. If not check this for help:
http://www.physionet.org/physiotools/cygwin/
Be sure to install all the development packages.
 
After you have it installed you should be able to open a Cygwin Shell window and do everything from there. Cygwin includes a lot of networking and development tools.
 
To download the matchOffline program open a Cygwin Shell and type:
  wget 'http://arimaa.com/arimaa/download/matchOffline/matchOffline.tgz'
 
To unpack it type:
  tar xzpf matchOffline.tgz
 
Then you should be able to go into the bot directories and recompile them using gcc. Once you've recompiled the bots you should be able to type './match firstBot secondBot' to run the match script.
 
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.