URL:
  <http://gna.org/patch/?3903>

                 Summary: Don't use UMT_SEA to assign unknown_MC cost
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Wed 08 May 2013 08:38:14 PM JST
                Category: ai
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 

    _______________________________________________________

Details:

    From what I can glean from incomplete archives of discussion surrounding
PR #6977 preceeding SVN revision 10719, the rationale behind the code that led
to the comment "Sailing units explore less" in pf_tools.c is that units that
don't respect terrain speed should have unknown_MC larger than their normal
move because they might try to go somewhere they can't go, so UMT_SEA units
should have unknown_MC of 2*SINGLE_MOVE and UMT_BOTH units should have
unknown_MC of SINGLE_MOVE.  This represents an assumption that all sailing
units are !UCF_TERRAIN_SPEED and an assumption that all UMT_BOTH units have
unrestricted nativity.

    The attached patch addresses those assumptions by iterating through the
terrains for the !UCF_TERRAIN_SPEED case, and only setting unknown_MC to
2*SINGLE_MOVE in the event some terrain is not native.  For classical units,
this represents no difference.  Specific differences for other units are:

1) UCF_TERRAIN_SPEED units that are UMT_SEA now are charged 2 * movement_cost
for the most awkward native terrain, rather than 2 * SINGLE_MOVE. 

2) units that are neither UCF_TERRAIN_SPEED nor UMT_SEA are now charged 2 *
SINGLE_MOVE if there exist any terrains not native to the unit, rather than
SINGLE_MOVE.

    In both cases, the value of unknown_MC should be larger than before, so
non-classical units with additional restrictions (e.g. seagoing units that
respect terrain speed or amphibious non-mountaineering units) may be less
likely to plot paths through unknown terrain.

    As mentioned in the original discussion, it might make sense to set values
for unknown_MC based on unit class *once*, and use these cached values when
constructing pathfinding maps, rather than recalculating the value every time
a parameter is defined.  These may even be interesting to ruleset authors, who
might want to express something like "Merchant units never find paths through
unknown tiles" or "Intercontinental Missiles care nothing about the underlying
surface".  That said, implementation of these is well beyond the scope of the
current patch.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 08 May 2013 08:38:14 PM JST  Name: native-unknown_MC.patch  Size:
2kB   By: persia

<http://gna.org/patch/download.php?file_id=17928>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3903>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to