Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Freeciv forgets moves after 'goto attack' (PR#887)
Home

[Freeciv-Dev] Re: Freeciv forgets moves after 'goto attack' (PR#887)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Freeciv forgets moves after 'goto attack' (PR#887)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Mon, 13 Aug 2001 14:31:10 +0100 (BST)

 --- Reinier Post <rp@xxxxxxxxxx> wrote: 
> On Sat, Aug 11, 2001 at 07:25:51AM -0700, mriser@xxxxxxx wrote:
> > Full_Name: Micha Riser
> > Version: 1.12.0
> > Distribution: Built from source
> > Client: Gtk+
> > OS: Linux
> > Submission from: (NULL) (217.162.108.65)
>
> True, the unit remains in goto mode even when it was put there to
> attack
> and the attack succeeded, but it won't use up all of its movement.
> 
> Is this really a bug?  Should the unit interpret its being on goto as
> an order to move onto the square it has just emptied?  Should it leave
> goto mode?

It is a bug IMO since the situation when a unit is in ACTIVITY_GOTO and
still has move points left is anomalous.  There are several options as to
what it should do:
1. Attack once and then become IDLE (i.e. available for orders).
2. Attack repeatedly while it has move points left and then move into the
square it has cleared.
3. Become IDLE when encountering enemy and before attacking.

Option 3 is what was done in CivII, I believe.
Option 2 is a bit stupid since the unit might be low on hitpoints after
the first attack and attacking again == suicide
Option 1 is Ok, but there is a slight problem:
  imagine a unit GOTOing to (X,Y) and, while it's on the way, an enemy   
  unit moving into (X,Y).  then your unit, when it finally arrives, will 
  attack the enemy, although it wasn't there when you gave the order.    
  this can be very unpleasant.
and another problem (I just realised):
  if unit arrives to it's target with less than 1 movepoints left
  it will still attack, although it might have only 1/3 of it's attack   
  power

NOTE: the above problems are present now as well.

To implement 1 or 2, the responsible bit of code is
http://www.freeciv.org/lxr/source/server/unittools.c?v=cvs#L3168

To implement 3, one should change code around
http://www.freeciv.org/lxr/source/server/unithand.c?v=cvs#L882

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


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