Re: [pio-develop] New AI for Pioneers
Roland Clobus <rclobus <at> users.sourceforge.net>
2013-04-05 18:07:13 GMT
Hello Rodrigo,
On Fri, 2013-04-05 at 18:50 +0200, Rodrigo Espiga Gómez wrote:
> First, thanks for the fast reply. Your information is very helpful. It
> would great if you could send me that file you talk about.
> Thanks again!
I'll create the file client/ai/genetic.c.
In the meantime, could you send me your account name on SourceForge?
I'll need that in order to be able to grant you write access to the
repository so that you'll be able to post your progress.
I've set the reply to this mail to the mailing list.
With kind regards,
Roland Clobus
---
> From: rclobus <at> users.sourceforge.net
> To: pio-develop <at> lists.sourceforge.net
> Date: Thu, 4 Apr 2013 21:42:33 +0200
> Subject: Re: [pio-develop] New AI for Pioneers
>
> Hello Rodrigo,
>
> On do, 2013-04-04 at 20:02 +0200, Rodrigo Espiga Gómez wrote:
> > HI, MY NAME IS RODRIGO ESPIGA, A COMPUTERS DEGREE STUDENT FROM SPAIN,
> > AND I NEED TO MAKE A PROJECT FOR MY DEGREE ADDING A NEW AI FOR YOUR
> > GAME. THIS AI SHOULD USE GENETIC ALGORITHMS TRYING TO FIND AN OPTIMAL
> > PLAYING STRATEGY.
>
> Thank you for choosing Pioneers for your project.
>
> > I WOULD BE VERY THANKFUL IF YOU COULD BE SO KIND TO GIVE ME SOME
> > ADVISE OF WHERE TO START AND WHAT IS THE BEST WAY TO ADD THAT NEW AI
> > TO YOUR GAME. RIGHT NOW IM STRUGGLING WITH THE SOURCES TRYING TO FIND
> > OUT WHAT DOES WHAT. I CAN SEE IN THE SOURCES THAT THE CURRENT AI IS IN
> > A FILE CALLED GREEDY.C THAT DEFINES THE FUNCTIONS THAT ARE PASSED TO
> > THE CALLBACKS STRUCT (DEFINED IN CALLBACKS.H), BUT ONLY SETS 20 OF THE
> > APROXIMATELY 60 DEFINED IN THAT STRUCT. I SEE ALSO THAT SOME OF THEM
> > ARE ALSO SET INSIDE AI.C.
> > WHAT FUNCTIONS SHOULD A NEW AI DEFINE?
>
> I would suggest that you write the behaviour of your computer player in
> a separate C-file, I can set one up for you. It could be called
> genetic.c, if the behaviour is based on genetic algorithms.
> Please say so, it you would like that. (It is better to implement the
> new functionality in a separate file, instead of modifying greedy.c).
>
> I can also grant you access to the svn repository, so that you'll be
> able to push your code in smaller steps instead of pushing only the
> final result. I'll need the name of your SourceForge account for that.
>
> You can use greedy.c as an example. The callbacks struct is a C
> equivalent of a virtual function in C++. When you need to implement some
> behaviour you can add your function in the *_init() function. It will be
> called when the corresponding situation occurs in the game. (That means
> that you don't need to worry about the actual protocol).
> The very minimum would be: setup (during the setup phase), turn (during
> a regular turn), discard_add (when a seven was rolled) game_over (at the
> end of the game). It you want to react to trade requests, you'll need to
> add relevant functions too. (I'll provide hint when you need that).
>
> > IT WILL ALSO BE VERY HELPFUL FOR ME TO BE ABLE TO RUN THE PROGRAM
> > WITHOUT THE GRAPHICAL INTERFACE, BECAUSE THE AI HAS TO PLAY LOTS (I
> > REALLY MEAN IT, LOTS) OF GAMES AGAINST ITSELF AND THE GREEDY PLAYER TO
> > EVOLVE, AND THAT WOULD BE FASTER.
>
> Pioneers can be run without the graphical interface.
>
> You can run the console server:
> $ pioneers-server-console --port [portnumber] --auto-quit
> --fixed-seating-order --game-title "Default" --players 4
>
> Then you can add greedy computer players:
> $ pioneersai --server localhost --port [portnumber] --name
> [GreedyPlayer#] -t 0 --chat-free --algorithm=greedy
> Or your own computer player (when I've set it up):
> $ pioneersai --server localhost --port [portnumber] --name
> [GeneticPlayer#] -t 0 --chat-free --algorithm=genetic
>
> (You can add --debug for more information about the gameplay, but that
> reduces the speed)
>
> > WHERE CAN I GET A SOURCE THAT I CAN COMPILE WITH KDEVELOP IN UBUNTU?
>
> I would recommend that you use trunk in the subversion repository, that
> is the most recent code.
> See: http://sourceforge.net/p/pio/code/
>
> In Ubuntu, you'll need at least the following packages:
> debhelper (>= 8.1.0~), libgnome2-dev, scrollkeeper, gnome-common,
> librsvg2-bin, netpbm, libgtk2.0-dev, automake, autoconf, po-debconf,
> intltool, libtool, libavahi-glib-dev, libavahi-client-dev, gob2,
> libnotify-dev, xfonts-scalable
>
> I would recommend the following actions:
> - Install the packages
> - Get the source from the repository
> - Run './autogen.sh --enable-warnings'
> - Run 'make all'
> - As root: run 'make install'
> - When you are testing: use './pioneersai' instead of 'pioneersai'
> - I have not used KDevelop in a while, but you'll probably only need to
> open 'genetic.c' and use the make command. Perhaps you'll also need a
> simple script to run a game with the computer players, with the command
> lines as mentioned earlier.
>
> Don't hesitate to write to this list for more help.
>
> With kind regards,
> Roland Clobus
> Developer for Pioneers
>
>
>
> ------------------------------------------------------------------------------ Minimize
network downtime and maximize team effectiveness. Reduce network management and security costs.Learn
how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________ Pio-develop mailing
> list Pio-develop <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pio-develop
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop