On Sun, 2012-09-16 at 14:52 +0200, Matthias F. Brandstetter wrote:
> Hi Freeciv Team!
> 
> I am a PhD candidate at De Montfort University in UK, working on
> Computational Intelligence for Computer Games. 

you got the right name, AFAIK the (meta-)heuristic date back
like 15 years, where unit like fighter and stealth were not implemented.
In a time where connection was made with 14.4 kbps.

The game is design such that the lowest latency player win
(at least in combat). And receive commands can frooze the gui.
If you do not understand, then search "simulation time"
and increase the thing to like one seconde, and send 50 units,
everything will break loose. 

> For my current studies
> I am thinking of using Freeciv as test bed for my research on AI in
> games.

send me your progress.
Even more the library and scheme you intend to used.
Obviously, the CI will need to be put in a thread, and report when fast
enough.
In warciv, we used a custom island, to give same chance to every
players. the island is copy to to fit in the map.

designing fair map is also a challenge, when not using identical island.
Example, without using sea.  you should see the problematic, and how
computer intensive it is.

http://www.mapeditor.org/ can be some help for making map.
i find the isometric of no used for playing or analyzing strategy, you
may differ.

> On your web site I have seen that you are currently re-writing the AI
> code for v2.4.

i do not their intention/design, i am from warciv version.

>  Is there any document describing the "big picture" for
> custom AI's? I have skipped through the latest source code a bit, seen
> the AI stub and ai.* files in the "common" dir, but I am not sure
> about each of these functions in detail,m when they are called, etc.

i can not help there. Part of the AI is also CM(city Management).

> Also, I am new to Freeciv dev in general, have not worked on the code
> so far, only played the game in the past.

>  What would be the best way
> of debugging my own development? When writing a new AI for Freeciv, I
> of course want to see how it works bit for bit, so a debugging feature
> would be very handy!

recording/replaying would be very useful
- for testing
- for debugging

Since CI/AI is a client thing, it means gui(graphic user interface) is
in the way.
The easiest thing for debugging is to used two computers.
That is, you do not want input to mess up the gui event loop.

For the client, use gdb-server
==============================
you need a command like with IP of PC running "kgdb" for example
# gdbserver 192.168.0.3: 7000 client/civclient

which is added for me to a shell script, that is "civ-gdbserver" file
exec gdbserver 192.168.0.3:7000 $EXE ${1+"$@"}
where 7000 is the port that need to be open(if firewall), to connect
      to gdbserver
you will have message like
process prog created: pid = 1545
Listenning on port 7000

for the host, the one running graphic debugger like "ddd" "kdbg"
============
or gdb utility in cli(command line input)
# ddd
> file client/civclient   # need application to debug
in gdb window   we need to give command to connect to gdbserver, that is
> target remote 192.168.0.2:7000   #in gdb window, IP of PC wher playing

again i am using a shell script "civ-kdbg" file for starting
exec kdbg $EXE ${1+"$@"}
where macro EXE is from a line like
  [ -x $BUILDDIR/civclient ] && EXE=$BUILDDIR/civclient

graphic debugger will need another thing, --display=192.168.0.1

for debugging the application more easely, sockets should be put in a thread
or server will disconnect
...

why the the script and the BUILDDIR macro ?
because developper usely used build directory for different compiler options
make CFLAGS="-g -O0 -Wall -DNDEBUG"

from source, you should see client and server directory
$ mkdir BUILD
$ cd BUILD
$ ../configure 2>&1 | tee configure-july17.log
$ make CFLAGS="-g -O0 -Wall -DNDEBUG" 2>&1 | tee make-july17.log


the application is based on common/packets.def
those are the commands sent between server/client
server - acknowledge valid modifications
       - send modifications to authorized client
client - send wanted modifications
       - received valid modification
       - and make walt disney display of what is going on, that is gui part

it is not difficult to see other design
allieds are connecting to one head quarter
head quarter ask refere to validate changes(anticheating)
refere let other head quarters known about thing that they are allow to view.

simulation should/could be done without the gui(display).

AFAIK nobody has done memory management,
all memory allocation are OS call.



_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to