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: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Sun, 8 Dec 2002 19:56:24 +0100

On Sun, Dec 08, 2002 at 07:26:53PM +0100, Christian Knoke wrote:
> 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. :-(

Undo this:
   lsend_packet_generic_empty(&game.est_connections, PACKET_FREEZE_HINT);
   send_all_info(&game.game_connections);
+  show_map_to_all();
   lsend_packet_generic_empty(&game.est_connections, PACKET_THAW_HINT);

It was inserted to have a fair comparison with the server-AI. And also
to concentrate on one thing (city placement and settler production).

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

There is an exploring agent but nothing to explore. If you remove the
show_map_to_all the unit will also explore.

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

This is an bug.

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

This is one of the cases where not all state is saved. Basically don't
disconnect or load ;)

BTW: you can disable the whole AI and play a normal game with agents
(you can for example watch a trireme exploring the ocean) if you
comment the register_agent calls from master.c, tma.c and turn_done.c.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Of course, someone who knows more about this will correct me if I'm
  wrong, and someone who knows less will correct me if I'm right."
    -- David Palmer (palmer@xxxxxxxxxxxxxxxxxx)



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