Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities
Home

[Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#725) Order of end/new-turn activities
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 3 Jul 2003 14:26:29 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 3 Jul 2003, Jason Short wrote:
> > Why should AI get special treatment here?
>
> Exactly - if a human player does GOTO, the goto is immediately executed.
> For the AI it should be as well, but apparently it isn't - so we get the
> oft-seen "enemy comes out of nowhere to capture my city" bug.

The AI does not use the same kind of goto as human players. Let the AI do
_everything_, including its own gotos, in its own encapsulated step at end
of turn. Problem goes away.

(PS Note that for the AI, gotos _are_ immediately executed. The problem is
that the AI activates units both in beginning and end of turn. Usually
this is not a problem, since it often moves everything but settlers in the
beginning of the turn, making it consistent. However, when you have units
on board a ship, for example, it might move the ship in the beginning of
the turn, then land some units from it at the end of the turn, then attack
with those units at the beginning of next turn before players can react,
hence the 'double-move'.)

(PPS Note that we still have some AI-governed gotos left in the client.
These will represent a conceptual, although not a big actual, problem
since we'll have to call the AI goto routines on them in the beginning of
the turn along with the path execution routines.)

  - Per




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