Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: [RFC][Patch] Unit agents
Home

[Freeciv-Dev] Re: [RFC][Patch] Unit agents

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC][Patch] Unit agents
From: Christian Knoke <chrisk@xxxxxxxx>
Date: Sun, 8 Dec 2002 19:26:53 +0100

On Sun, Dec 08, 2002 at 04:37:24PM +0100, Raimar Falke wrote:
> On Tue, Jul 09, 2002 at 08:29:04PM +0200, Raimar Falke wrote:
> > 
> > The attached patch is a snapshot of a tree which consists of the
> > following parts:
> >  - path_finding13
> >  - map decoration
> >  - goto agent (GA)
> >  - exploring agent (EA)
> >  - settler management agent (SMA)
> >  - and lot of other changes
> > 
> > You may notice that you will see both paths (one calculated by the old
> > code and the other by the new path_finding) if you goto a unit. The
> > execution of the goto will be done by the goto agent. You cen see the
> > path which is executed by pressing the middle mouse button. If you
> > press shift together with the middle mouse button the popup will be
> > smaller (I haven't been able to remove it altogether).
> > 
> > EA and SMA should be easy to use. Since they also use the GA you also
> > see the paths which the units follow with the middle mouse button.
> > 
> > If you press shift-x you can see all tiles which the current unit may
> > attack.
> > 
> > This is work in progress. Missing are mostly user interfaces (you
> > currently have to change the code in control.c by hand) for the
> > parameters. Also some parameters are missing (the exploring agent for
> > example should have a parameter controlling hut behaviour and one for
> > empty cities). It may also happen that the client may core dump any
> > time ;)
> 
> Attached is another snapshot. Changes to the previous version are:
>  - town management agents (TMA), this agent has currently only hack
>  status. It will check if there is work for an extra settler and will
>  build one as fast as possible using CMA.
>  - master, it will set the cities under TMA and the units under SMA or
>  EA. 
>  - turn done agent. It will press the turn done button 50 turns and so
>  give a continuous game play.
> 
> This snapshot does the step from a helpers-only human-supporting to a
> very small and stupid but self-contained AI.

Funny to watch how an empire is build in 80 turns and then being destroyed
by 2 bands of barbarians in 20 turns :-]

Why can I see the whole map and all units? Does this mean you hacked
the server to give agents omniscence? I don't think this is the way
to go with client side AI. :-(

The explorer is idle the whole game, no exploring agent?

When the empire is destroyed, the last city builds settlers on
an on, which are standing idle in the city, doing nothing.

Another assert occurs after disconnect from a lost game, reconnect to
a new server and "start". Backtrace follows, core file available.

Christian

2: SMA-101: control
2: SMA-101: handle_unit()
2: SMA-101: current phase=4; -2 turns since start of this phase
2: SMA-101: finished
2: SMA-101: WARNING: action took shorter than planned
civclient: sma.c:194: deallocate_action: Zusicherung »len ==
sizeof(tile_actions)« nicht erfüllt.
Abgebrochen (core dumped)

(gdb) bt
#0  0x4035f861 in kill () from /lib/libc.so.6
#1  0x4035f665 in raise () from /lib/libc.so.6
#2  0x40360c81 in abort () from /lib/libc.so.6
#3  0x40359a52 in Letext () from /lib/libc.so.6
#4  0x080de445 in deallocate_action (id=101, plan=0xbffff1e4) at sma.c:194
#5  0x080e1614 in unit_changed (id=101) at sma.c:1635
#6  0x080d93f5 in execute_call (call=0x8674b10) at agents.c:181
#7  0x080d944e in call_handle_methods () at agents.c:215
#8  0x080d98f8 in agents_unit_new (punit=0x86b0420) at agents.c:534
#9  0x080745ca in handle_unit_info (packet=0x86b03b0) at packhand.c:1020
#10 0x08065129 in handle_packet_input (packet=0x86b03b0, type=5) at
civclient.c:282
#11 0x08069373 in input_from_server (fd=6) at clinet.c:326
#12 0x08098c02 in get_net_input (data=0x0, fid=6, condition=GDK_INPUT_READ)
    at gui_main.c:1164
#13 0x40194934 in gdk_io_invoke () from /usr/lib/libgdk-1.2.so.0
#14 0x401c63b0 in g_io_unix_dispatch () from /usr/lib/libglib-1.2.so.0
#15 0x401c7c46 in g_main_dispatch () from /usr/lib/libglib-1.2.so.0
#16 0x401c8273 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#17 0x401c843c in g_main_run () from /usr/lib/libglib-1.2.so.0
#18 0x400e076c in gtk_main () from /usr/lib/libgtk-1.2.so.0
#19 0x0809877e in ui_main (argc=1, argv=0xbffff624) at gui_main.c:998
#20 0x0806509f in main (argc=5, argv=0xbffff624) at civclient.c:247
#21 0x4034e7ee in __libc_start_main () from /lib/libc.so.6

-- 
Christian Knoke     * * *      http://www.enter.de/~c.knoke/
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.


[Prev in Thread] Current Thread [Next in Thread]