Complete.Org: Mailing Lists: Archives: freeciv-dev: September 1999:
Re: [Freeciv-Dev] railroad movement
Home

Re: [Freeciv-Dev] railroad movement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] railroad movement
From: Artur Biesiadowski <abies@xxxxxxxxx>
Date: Wed, 08 Sep 1999 11:25:41 +0200

Peter Schaefer wrote:

> Closing Sentence:
> If someone thinks this is a good idea, please go ahead and give us a patch 
> that
> changes all the "1 move=3 parts" code !

Not all, unfortunately, but some of it is included in this patch.
Missing:

entire server/gotohand.c
common/map.c:tile_move_cost_ai
some funs in ai/advmilitary.c
some funs in ai/advunit.c

I've added few /* MOVEFIXME */ comments in places where I wasn't sure of
meaning of code (3 or 4 places) - somebody should review this places
closely.

I've decided to use 30 instead of 3 as a base - 1/3 for road/river, 1/10
for rail. It would also allow C:CTP costs (1/2 for river, 1/3 for road,
1/5 for rail, 1/10 for maglev).

For now it is defined in unit.h 
#define SINGLE_MOVE 30
Also there are definitions for
#define MOVE_COST_RIVER 10
#define MOVE_COST_ROAD 10
#define MOVE_COST_RAIL 3

which should be later changed to be read from ruleset file. They are
used only in once place, so it should be easy for grep for them and
change (or even replace with
#define MOVE_COST_RIVER game.river_movement_cost
or anything).

Somebody has to work hard on goto code - there is way too much places
where magic numbers are used, which probably are dependent on 3. Also
warmap uses 255 as very large value - it is not longer so.

There is also a change in packets - now moves_left/move_rate is
transported in 16bit int, not 8bit.


Artur

Attachment: moves.diff.gz
Description: GNU Zip compressed data


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