Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6935) AI sends transports with settlers off explor
Home

[Freeciv-Dev] Re: (PR#6935) AI sends transports with settlers off explor

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6935) AI sends transports with settlers off exploring
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 24 Nov 2003 03:55:57 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6935 >

On Sun, 23 Nov 2003, Per I. Mathisen wrote:

> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=6935 >
> 
> On Sun, 23 Nov 2003, Per I. Mathisen wrote:
> > Sometimes, instead of landing them somewhere, it takes them off for the
> > ride of their lives. This is bad.
> 
> For some reason, the AI believes that its ferries do not contain any
> passengers, when they do! This happens on the second ai_manage_unit() call
> of the journey.  They start out very determined, then forget that there is
> a passenger the turn after.
> 
> The problem seems to be the mysterious call to ai_clear_ferry() in
> ai_manage_unit(). Why is it there??
> 
> Removing it fixes the problem. Greg?

Don't.  

The reason for the clear_ferry is that the unit, when it's dealt with in
it's ai_manage_ function, can try to do lots of various things.  Most of
them do not involve the ferry that the unit has requested last turn.  So
we either have to trace every place where a unit changes its mind about
using a boat and free the boat there or, as I have done, free it
automatically and then make the unit re-request a boat if it needs one.

This works fine with military units because in ai_manage_military the unit 
thinks "I am in the middle of the ocean, to go killing I need a boat" and 
gets the boat back.  Unfortunately, the settlers are done is a weird way, 
all in the end of the turn (AI merely puts settlers in the auto-settler 
mode, see ai_manage_settler).

So I am not sure how to fix it.  Either (1) make AI settlers behave
normally (or at least like other AI units behave) and do something during
the AIs turn and not during a special auto-settler phase.  Or (2) not free
the boat for the settlers (dubious).  Or (3) not free the boat if we are
transported by it (then need to carefully free it when we disembark).

My preference is for (1), it makes debugging easier (everything is done in 
one place), but I can't see how it can be done quickly.  Maybe we should 
do (2) as a hack while the new settlers are in the making?

G.





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