Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Mysterious artefacts
Home

[Freeciv-Dev] Mysterious artefacts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Subject: [Freeciv-Dev] Mysterious artefacts
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 25 Sep 2001 18:34:46 +0100 (BST)

There are some places in the code that puzzle me a lot.  Maybe somebody
with deeper or more historical knowledge of freeciv can explain me the
intuition behind it.

1. Warmaps for units ignoring terrain (alpine, partisan, explorer):
instead of having each move cost MOVE_COST_ROAD(=1) they somehow get
SINGLE_MOVE(=3): in really_generate_warmap
  http://www.freeciv.org/lxr/source/server/gotohand.c?v=cvs#L322
in the comment above it Syela says that it should be so.  Thue asks why.
Does anybody know the answer?
See also: in client/goto.c IGTER units get MOVE_COST_ROAD (it was
probably written by Thue later)
in server/gotohand.c IGTER units get MOVE_COST_ROAD for disembarking
(also later addition -- and in conflict with the code below)

2. Why "wrong" type initialization in generate_warmap
  http://www.freeciv.org/lxr/source/server/gotohand.c?v=cvs#L394
the correct type initialization is later done in really_generate_warmap.
I tried removing lines 394 and 391 altogether -- savegames don't change.
See also: FIXME comment just before generate_warmap

3. What is the reason for feeding city AND unit into generate warmap in
the cases when you clearly want a warmap for a unit only?  For example:
  http://www.freeciv.org/lxr/source/ai/aiunit.c?v=cvs#L209
and in most other cases, even when it is clear that there is no city
under the unit!  Not only it calls map_get_city so many extra times, it
obscures the code too.
See also: when non-NULL unit is passed to generate_warmap it by default
overrides the city argument:
  http://www.freeciv.org/lxr/source/server/gotohand.c?v=cvs#L383

4. What is the difference between warmap for a city and for a unit?
Why this averaging in:
  http://www.freeciv.org/lxr/source/server/gotohand.c?v=cvs#L327


I hope somebody can help,
G.

____________________________________________________________
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]