Welcome, Guest. Please Login or Register.
Dec 4th, 2024, 9:41am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « Arimaa Client for AEI »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   Arimaa Client for AEI
« Previous topic | Next topic »
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Arimaa Client for AEI  (Read 9764 times)
rabbits
Forum Guru
*****




Arimaa player #1337

   
WWW

Gender: male
Posts: 108
Re: Arimaa Client for AEI
« Reply #15 on: May 20th, 2010, 6:30am »
Quote Quote Modify Modify

The client is meant to be fetched with the Bazaar http://bazaar.canonical.com revision control system.  Bazaar is multi-platform.  Once you have it installed, run the command
Code:
bzr branch lp:arimaa-client
to get a copy of the Arimaa client code.
 
You will have to have a copy of AEI to use the client.
 
The client itself should work fine on every OS too, but I am not sure if anyone has tried it in Windows yet.  Does anyone know for sure if it works in Windows?
IP Logged

rbarreira
Forum Guru
*****



Arimaa player #1621

   


Gender: male
Posts: 605
Re: Arimaa Client for AEI
« Reply #16 on: May 22nd, 2010, 3:51am »
Quote Quote Modify Modify

I keep getting errors like these on startup and every time I click:
 
Quote:
Number of rounds:  100
At timecontrol 3s/30s/100/60s/10m
Giving these settings to all bots:
hash: 50
Traceback (most recent call last):
  File "./gui.py", line 349, in OnPaint
    self.DoDrawing(dc)
  File "./gui.py", line 367, in DoDrawing
    piece = self.pieceAt(row, col)
  File "./gui.py", line 488, in pieceAt
    return self.position.piece_at(1 << (8*row+col))
AttributeError: 'Position' object has no attribute 'piece_at'
Traceback (most recent call last):
  File "./gui.py", line 275, in OnTimer
    if event.GetEventObject() == self.aeiTimer:     self.checkAEI()
  File "./gui.py", line 655, in checkAEI
    self.newgame()
  File "./gui.py", line 557, in newgame
    self.DoDrawing()
  File "./gui.py", line 367, in DoDrawing
    piece = self.pieceAt(row, col)
  File "./gui.py", line 488, in pieceAt
    return self.position.piece_at(1 << (8*row+col))
AttributeError: 'Position' object has no attribute 'piece_at'
IP Logged
rabbits
Forum Guru
*****




Arimaa player #1337

   
WWW

Gender: male
Posts: 108
Re: Arimaa Client for AEI
« Reply #17 on: May 23rd, 2010, 1:24pm »
Quote Quote Modify Modify

I haven't double checked, but I think that your problem comes from using an older version of AEI.  If you pull the latest AEI code, this error should go away.
IP Logged

rbarreira
Forum Guru
*****



Arimaa player #1621

   


Gender: male
Posts: 605
Re: Arimaa Client for AEI
« Reply #18 on: Aug 1st, 2010, 7:31am »
Quote Quote Modify Modify

After upgrading to AEI 1.1 it works indeed. Very nice!
 
The proxy feature is great, to watch the games while running tests between bots.
« Last Edit: Aug 1st, 2010, 7:35am by rbarreira » IP Logged
moretti
Forum Junior Member
**



Arimaa player #6472

   


Gender: male
Posts: 6
Re: Arimaa Client for AEI
« Reply #19 on: Sep 9th, 2011, 5:05pm »
Quote Quote Modify Modify

I didn't want to start a new thread for this simple thing, but I created a ~30 lines of code add on for those using the Arimaa Client to play without an internet connection.
 

 
It basically starts roundrobin.py and opens a new tk window to let you select your opponent. This way you only create roundrobin.cfg once, and just use the selector to choose from the valid bots to play when you want a quick match and you don't have an internet connection.  
 
It's a quick hack for those who like things simple and fast.
 
so:
just add all your bots to the global bots section in roundrobing.cfg
ie:
Code:
bots = human akimot OpFor2008 OpFor2009 OpFor2010 occam threaded_sample

(remember to add the arimaa-client as human in the bot list)
 
then modify roundrobin.py and find this line:
Code:
       else:
            print "Did not find a bot section for %s" % (bname)
            return 1
 
    start_time = time.time()

 
Change them to call to our selector window
 
Code:
       else:
            print "Did not find a bot section for %s" % (bname)
            return 1
 
    bots = human_match(bots)
 
    start_time = time.time()

 
and then, define human_match function (place it at the top of the file)
Code:
def human_match(bots):
    import Tkinter as tk
    import tkMessageBox as mBox
    master =tk.Tk()
    master.title('dc740')
    master.minsize(200,20)
 
    master.v = tk.StringVar()
    master.om = tk.OptionMenu ( master, master.v, [] )
    
    
    for bot in bots:
        if (bot['name'].lower() == 'human'):
            human = bot
        else:
            def myF(bot):
                master.selectedBot = bot
                master.v.set(bot['name'])
            master.om["menu"].add_command(label=bot['name'], command= lambda temp = bot: myF(temp) )
    
    def ok():
        if (master.v.get() != ""):
            bots = [ human , master.selectedBot ]
          master.retVal = bots
            master.quit()
            master.destroy()
        else:
            mBox.showerror("Bot selection error.", "Select a valid bot!")
 
    master.om["menu"].delete(0) # delete first element (basically the empty list used to create the optionMenu)
 
    
    label = tk.Label(master, text="Select a valid bot from the list:")
    button = tk.Button(master, text="OK", command=ok)
 
    label.pack()
    master.om.pack()
    button.pack()
 
    master.mainloop()
 
    return master.retVal

 
I've uploaded the full script and a sample configuration here:
http://www.multiupload.com/FE68Y44GCL
« Last Edit: Sep 9th, 2011, 5:17pm by moretti » IP Logged
Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: Arimaa Client for AEI
« Reply #20 on: Mar 6th, 2012, 1:18am »
Quote Quote Modify Modify

on Sep 9th, 2011, 5:05pm, moretti wrote:

I've uploaded the full script and a sample configuration here:
http://www.multiupload.com/FE68Y44GCL

 
Seems the link vanished.
 
I am fighting with ON_KEY_* events ... whenever I press a key with opened client, the client freezes. I were afraid it was caused by my code modification, but seems it was an issue of the original code.
 
Do anybody else have this problem or it's my local one?
 
It is particulary annoying when you add chat feature, but pressing a key frozes the client ... . I have problems with the layout as well. When I put the original "layout" into a panel, it stops receiving events. This is why I am stuck with vertical layout so far. I will post the code hoping someone familiar with wx and python is able to proceed.
« Last Edit: Mar 6th, 2012, 1:30am by Hippo » IP Logged

Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: Arimaa Client for AEI
« Reply #21 on: Mar 6th, 2012, 1:32am »
Quote Quote Modify Modify

on Aug 1st, 2010, 7:31am, rbarreira wrote:
After upgrading to AEI 1.1 it works indeed. Very nice!
 
The proxy feature is great, to watch the games while running tests between bots.

 
Wow, seems I have missed it ... you could run two bots and proxy to watch them play? How is it achieved?
IP Logged

rabbits
Forum Guru
*****




Arimaa player #1337

   
WWW

Gender: male
Posts: 108
Re: Arimaa Client for AEI
« Reply #22 on: Mar 6th, 2012, 2:36pm »
Quote Quote Modify Modify

You can play a bot through the proxy by setting it up something like this in your roundrobin.cfg:
Code:
[BotHippoProxy]
cmdline = python ../arimaa-client/gui.py --proxy BotHippo

I'm not sure why your client freezes with ON_KEY events.. Is the code you're running posted anywhere?
IP Logged

Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: Arimaa Client for AEI
« Reply #23 on: Mar 6th, 2012, 5:25pm »
Quote Quote Modify Modify

Wow proxy works fine Smiley ... I was thinking why it parses the roundrobin.cfg Smiley.
 
I have put the modified ... buggy version here:
http://hrosi.dyndns.org/arimaa/gui.py
 
compared to  
http://hrosi.dyndns.org/arimaa/gui_ori.py
 
I have put chatting roundrobin here as well:
http://hrosi.dyndns.org/arimaa/roundrobin.py
 
As chatting gameroom aei:
http://hrosi.dyndns.org/arimaa/gameroom.py
 
Next time I will provide it with the directory listing Wink
« Last Edit: Mar 6th, 2012, 5:25pm by Hippo » IP Logged

rabbits
Forum Guru
*****




Arimaa player #1337

   
WWW

Gender: male
Posts: 108
Re: Arimaa Client for AEI
« Reply #24 on: Feb 26th, 2014, 12:20pm »
Quote Quote Modify Modify

I just moved the repository to BitBucket: https://bitbucket.org/Rabbits/arimaa-client
 
I originally chose LaunchPad to align with AEI.  Now that AEI is hosted on Github, well, I guess I could put this code there... but it's on BitBucket for now.
 
I intend to incorporate code in this thread (moretti's code and Hippo's fix) into the repository... Or someone else could do that for me...!  I'll accept pull requests or even grant write access if someone wants it.
IP Logged

abstractius
Forum Newbie
*



Arimaa player #6093

   


Gender: male
Posts: 2
Re: Arimaa Client for AEI
« Reply #25 on: Apr 13th, 2014, 8:42am »
Quote Quote Modify Modify

I am getting python gui.py  
Traceback (most recent call last):
  File "gui.py", line 37, in <module>
    class ArimaaClient(wx.Frame):
  File "gui.py", line 38, in ArimaaClient
    GOLD_COLOR   = wx.Color(200, 175, 100)
AttributeError: 'module' object has no attribute 'Color'
 
It should be nothing serious Smiley
IP Logged
harvestsnow
Forum Guru
*****





   


Gender: male
Posts: 88
Re: Arimaa Client for AEI
« Reply #26 on: Apr 15th, 2014, 3:44am »
Quote Quote Modify Modify

on Apr 13th, 2014, 8:42am, abstractius wrote:
I am getting python gui.py  
Traceback (most recent call last):
  File "gui.py", line 37, in <module>
    class ArimaaClient(wx.Frame):
  File "gui.py", line 38, in ArimaaClient
    GOLD_COLOR   = wx.Color(200, 175, 100)
AttributeError: 'module' object has no attribute 'Color'
 
It should be nothing serious Smiley

 
In gui.py, try adding after the license:
Code:

import wxversion
wxversion.select('2.8')

 
 
... or maybe after the imports:
Code:
wx.Color = wx.Colour
.
They changed the class name between two versions.
« Last Edit: Apr 15th, 2014, 10:37am by harvestsnow » 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.