Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2002:
[Freeciv-Dev] Re: movement

[Freeciv-Dev] Re: movement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: movement
From: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Aug 2002 17:41:32 -0500

Christian Knoke wrote:

Yes. - I've had the same idea like Brandon, with the goto. Implicit
goto for the last (incompleted) move. Only needs to save to MP rest
with the goto route. No need for extra grafic IMHO. Uhm, but we want
to remove that server goto, right?

I don't think an implicit GOTO is necessary. I.e. the game should not FORCE you to move in that direction at the start of the next turn. However, you should only get the bonus movement points if you do move in that direction. I would think adding something like

  int move_points;
  enum direction8 move_dir;

to struct unit would be a good start. This just stores the movement points the unit has left over from the previous move, and in which direction they apply. This then needs to be updated every time the unit moves (reset to 0 on a successful move; set to the appropriate values on an incomplete move).

(But, I don't know how the server and client interface one this. Someone more knowledgeable would have to write this code. Also there's a problem if you #include map.h (with enum direction8) from unit.h, since map.h #includes unit.h as well.)


The inverse system seems a little more fair, actually. In that system (from Ben Mazur's e-mail) if you don't have enough move points to move from A to B, you get to make the move but lose the points from your next move. This is more fair for the opponents of the player moving, since the "extra" move comes in at the end of this turn (when you're just moving from tile to tile) rather than the next turn (when you could actually move further than you normally would, *and attack*).

The question is, how does this apply to a unit moving onto a tile that requires more movement points than it's total? If a musketeers (movement 3) moves onto mountains (movement 9), does it lose 6 movement points from its next turn? If it does, do 3 of those carry over (so that it, in effect, takes 3 turns to make the move)? Obviously, having this happen would be a major change to the game rules.


Note that all of these systems could use the above data structures for storage, and could all be dealt with by the AI. So it would be feasible to have this be a ruleset/server variable:

0 - Unused movement points get saved for next turn
1 - Moves that take too many movement points are not completed, but the
    movement points will carry over for the same move next turn
2 - A move that takes too many movement points will be completed, but
    the extra movement points will be taken from the next turn's moves.
    A unit may still make any move so long as it has full movement.
3 - A move that takes too many movement points will be completed, but
    the extra movement points will be taken from the next turn's moves.

Note also that it would probably be a *major pain* to have the AI deal with all these systems. But perhaps it would be productive to implement them all so that players could try them out and decide what's best. Actually implementing them should be pretty easy - it's getting the AI (specifically warmap/pathfinding code) to work with all of them that would be tricky (probably very ugly).


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