"Smart" movement

Stan Shebs shebs@shebs.cnchost.com
Mon Jul 10 06:32:00 GMT 2000


Keir Novik wrote:
> 
> On the subject of unit movement, I notice that units are reluctant to move
> into a destination cell which contains other units.  Giving an order to
> move to an adjacent cell does not show this behaviour, and I don't think
> cells along a units route are treated this way.

At first I thought "no way", but now after experimenting with a crowd of
armor on the steppes, I saw it - the unit won't take the last step into
its destination if somebody else is there.

So I go to look at task.c:do_move_to_task, and whaddya know, the code is
designed that way!  The move-to task will fail if the final destination
cell has a unit that cannot be attacked (if enemy) or entered.  Alas,
there is no comment explaining why, although there may be some bizarre
case where you really want the unit to wake up and make the player
decide explicitly what to do.  But I don't see why ordinary stacking
would need this, especially since the key decision might be whether to
enter another unit, and it always does that automatically now.

Stan


More information about the Xconq7 mailing list