|
||
Title: How to begin (the basics of working bots, etc.)? Post by chess123mate on Oct 6th, 2008, 2:32pm I'm very new here, and I'm having difficulty trying to figure out how to operate Arimaa bots, etc. My first problem is how to use the 'matchOffline' system. I think that's reasonably basic, so I'm hoping to try that first. I have no idea how to do anything :) I think I have to use the Command Prompt to do some of these things, or something else? That'd be great, except I have no idea how to use the Command Prompt ??? Also, I wish to know how to make my own bots. I've tried downloading the sample bots, but I still don't understand what I'm supposed to do. Any help would be greatly appreciated :) Thanks, chess123mate |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Fritzlein on Oct 6th, 2008, 7:25pm Are you using Windows? The command prompt can be accessed via Start -> Run. In the bar where you type the program name to run, type "cmd". That will open a window where you type white commands on a black background. Some basic commands you can type at the command prompt are "dir" to see what is in the directory; "cd xxxx" to move down to folder xxxx from the folder you are in; "cd .." (that's two periods) to move up one level from whatever folder you are in. I hope this helps get you started. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by The_Jeh on Oct 6th, 2008, 7:35pm I think chess123mate might also be referring to the need for his program to write to the command prompt. That is the problem I ran into when trying to figure out how I could make a bot using REALbasic. I never did figure that out. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 7th, 2008, 3:07am Awesome! Now I can use the command prompt :) [Yes, I have Windows Vista and access to an XP as well] Actually, The_Jeh, I'm still trying to figure out how to run a bot. I'm currently confused as to how all this networking is set up. I've been searching over all of Arimaa wiki, etc., but I couldn't find anything that helped. Specifically, I wish to try and start by running a 'matchOffline' with the sample bots. If anyone's managed to do this, a few quick step-by-step instructions would be greatly appreciated. Also, what file in the sample bots actually includes the uncompiled code (ex. in java)? I tried opening a few, but they were all gibberish or human comments that didn't help... Thanks again, chess123mate |
||
Title: Re: How to begin (the basics of working bots, etc. Post by 99of9 on Oct 7th, 2008, 3:14am In Don Dailey's sample bot written in C all the files which end in .c or .h are source code files that you can open with a text editor. Source code often does look like gibberish if you don't know any programming language. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 7th, 2008, 11:16am Thanks! Now I can find the C source files... :) I am familiar with the programming languages, fortunately. Otherwise I'd be really lost ;) When I said gibberish, I was looking at files such as 'position.pl', which, to me, appears to be in a semi-compiled state... either way, it's got characters that Windows doesn't recognize :) Now I've re-read the 'readme's and I still can't get matchOffline to run. The error said that the file wasn't a recognized batch file? I even tried this on an XP, but the same error occurred: C:\Arimaa\matchOffline>match r0 r0 'match' is not recognized as an internal or external command, operable program or batch file. What am I doing wrong? I looked at the README, it said to go recompile in bot_r0, which I did. Same error. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by aaaa on Oct 7th, 2008, 11:32am You'll have to install Perl, as .pl files here are Perl scripts (they could also be Prolog files, but that's not the case here). |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 7th, 2008, 12:39pm Uhh... anyone have a link? I tried installing it (or doing anything with it, actually). I found a .tar.tar file. I found out Windows has no idea what that is or how to open it, so I'm stuck. http://search.cpan.org/dist/perl/ That's where I got it from. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by aaaa on Oct 7th, 2008, 12:56pm http://www.activestate.com/Products/activeperl/index.mhtml |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 7th, 2008, 12:57pm Thanks! :D EDIT: I just got it installed. I am still unaware on how to run matchOffline... :( sorry if I'm asking questions with obvious answer ("stupid questions")... I'm sure it's obvious when you're used to it, but I've never done this sort of thing before |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Fritzlein on Oct 7th, 2008, 4:15pm One problem I had after installing Perl was that the executable was not in my path. That is to say, if I typed the command "perl xxxx.pl", instead of Perl executing the script xxxx.pl, Windows didn't know where to find "perl". People here will laugh at me for being so dumb that I didn't know how to change my path, but what I actually did was specify the exact location of Perl, i.e. "C:\Perl\bin\perl.exe xxxx.pl". Then it worked. I don't know if the path is your problem, but if so, this is one way around it. (Actually, you can type "path" at the command prompt and see whether C:\Perl\bin\perl is in it (or the equivalent) and if not, there's your trouble.) |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 8th, 2008, 3:12am Yep, that's probably my problem... and I am feeling like an idiot right now... :-/ Anyway, I'm now 1 step closer. Now I'm getting this error due to command: C:\Arimaa\matchOffline>c:\perl\bin\perl.exe match r0 r0 random seed is 682342 '.' is not recognized as an internal or external command, operable program or batch file. 1w no steps taken m=[] Also, I just tried "recompiling" the "makefile" in bot_r0, but it had a full screen of information about errors. In conclusion, it says "...Execution of makefile aborted due to compilation errors." So that doesn't work either :( |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Polyfractal on Oct 8th, 2008, 9:05pm Have you edited the match or position scripts at all? Is your bots config file in order? Do all the paths point to the correct locations? The error looks like the errors I get when my bot outputs an illegal move. I'm guessing the r0 bot isn't functioning correctly. I've been using a copy of Fairy for testing and it works fine. You can get a copy from Unic's server (see this post (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi?board=devTalk;action=display;num=1147968223)). It is included in his "playtest.exe" package, which may also be useful for you. Try fairy.exe instead of r0 (make sure you add fairy to your bots config file) and see if that works. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 9th, 2008, 3:11am Haven't edited a thing. As for a config file, I didn't know there was one! As I said, I still have no idea what syntax the bots are using, what they are inputting from or outputting to (other than a server of some sort...), and I have no idea if all the paths are in the right locations or not. I currently haven't made any bots. I have ideas for them, but I wanted to try and get existing bots running first, then figure out how they work, and finally make my own after that. Alright, thanks Polyfractal for the link. I downloaded it as directed, and now I need to know how to run it. It said to put the paths of the bots into the "bots" file? I looked at it and it was full of comments and maybe a few commands... I have no idea. What syntax am I supposed to use? I just tried that new program and used playtext.exe with the parameters 'r0 r0' and also 'fairy060518 fairy060518'. Both of them resulted in an error because a file could not be read. I found a file named moves.txt, but it had only an opening. So how do I add 'fairy.exe' to any bot's config file? And in what syntax? |
||
Title: Re: How to begin (the basics of working bots, etc. Post by jdb on Oct 9th, 2008, 6:12am I just downloaded the offline match player. The command "match r0 r0" works under Linux. The command "perl match r0 r0" does NOT work under windows. In order to get this to work under windows, the program in the bot_r0 directory needs to be recompiled for windows. Also because windows has a different path syntax than Linux, line 200 of the "match" file needs to be commented out. My recommendation would be to use the match player under Linux. I have got the match player running under windows in the past, but it was such a huge headache to get working. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Polyfractal on Oct 9th, 2008, 8:27am 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:
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 :) (putting quotes around the command variable, or something?) |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 9th, 2008, 12:40pm 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 :) 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 |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Janzert on Oct 9th, 2008, 12:59pm 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 |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 9th, 2008, 2:20pm Wow! It's amazing what I'm learning (and downloading XD) However, it still doesn't work... :( 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... :o 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. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Polyfractal on Oct 9th, 2008, 3:08pm Your slashes are the wrong direction. Linux uses forward slashes ("/") for directory structure, Windows uses backslashes ("\") It should read: fairy .\fairy060518.exe |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 9th, 2008, 4:02pm Actually, I've found that Windows doesn't care... However, I changed it and it still didn't work. :-/ |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 10th, 2008, 8:50am 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. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Polyfractal on Oct 10th, 2008, 9:05am on 10/09/08 at 14:20:53, chess123mate wrote:
-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 |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 10th, 2008, 10:13am 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 :) ) Otherwise, your steps have been followed. I am still getting the error 'no entry in bots for fairy'. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 11th, 2008, 4:46pm 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 |
||
Title: Re: How to begin (the basics of working bots, etc. Post by Janzert on Oct 11th, 2008, 6:18pm From the downloads page, the link under the match offline script is the sample java bot. Janzert |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 12th, 2008, 8:26am 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... :o [it's probably in some obvious location, too... :) ] |
||
Title: Re: How to begin (the basics of working bots, etc. Post by omar on Oct 15th, 2008, 3:16pm 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. |
||
Title: Re: How to begin (the basics of working bots, etc. Post by chess123mate on Oct 21st, 2008, 11:34am Well, I've downloaded cygwin... have no idea what to do with it, but I've got it downloaded :) Anyone familiar with cygwin who can point me in the right direction? Thanks, chess123mate |
||
Title: Re: How to begin (the basics of working bots, etc. Post by omar on Oct 21st, 2008, 8:29pm 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. |
||
Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1! YaBB © 2000-2003. All Rights Reserved. |