Update of bug #16383 (project freeciv):
Priority: 1 - Later => 5 - Normal
Status: Need Info => In Progress
Assigned to: None => jtn
Release: => 2.3.0
Operating System: None => Any
Planned Release: => 2.4.0
Summary: Should RiverNative units be able to move diagonally
/ cross-continent, as currently? => Option to forbid RiverNative units moving
diagonally / cross-continent
Follow-up Comment #7:
Attached my work in progress trunk patch for this.
It's testable. If anyone can help with the remaining pathfinding glitches,
that would be great, as I'm not too familiar with pathfinding.
Patch is in two forms: all-in-one diff, and mbox containing split out steps
(with pathfinding changes separate from the rest).
It does two main things:
* Optionally, prevents non-cardinal movement of RiverNative units along
rivers (point 1).
** Moves between non-river to river tiles (transiting the mouth of a river)
must be cardinal too; I vaguely wanted not to do that, but there were some
awkward corner cases.
** Moves from river to a tile with a transporter should be unrestricted, as
for other dis/embarkation (but I haven't tried creating a trireme-transporter
to test this).
** I've created a new ruleset parameter "rivernative_move_mode" to control
this, rather than using river_move_mode, so that modders can disable land unit
river move bonuses entirely while retaining this new behaviour for boats.
** The patch enables this for the experimental ruleset.
** I've apparently-successfully taught the pathfinding about this
restriction, and I've seen an AI successfully move a unit along a river.
* Cities must be on a river to build and host RiverNative units (point 2).
** This isn't optional, since I didn't think it that controversial. It could
be made optional if required.
** This required noticeable work to remove assumptions that cities are always
safe havens for any kinds of unit. Beware bugs here.
* Pathfinding doesn't yet know about the city restriction; it thinks it can
move into a city next to a river (and even do so diagonally). It can't, so
"orders aborted because of failed move". I think I've seen an AI Trireme get
stuck because of this.
* There are pre-existing difficulties with RiverNative units attacking, which
is hampering work on the PF, as many of the PF algorithms take possible
attacks into account, so I need to know what *should* work:
** It's not possible to have a sea RiverNative unit (such as experimental
Triremes) which can do shore bombardments, even if NoLandAttacks isn't set.
This is because such units have to be move_type "Both" (otherwise the game
complains on loading), and can_attack_from_non_native() only allows UMT_SEA
** Conversely, experimental Triremes can attack land units on river squares,
even if NoLandAttacks is set. This is understandable, but not ideal.
** Ignoring that, for the legitimate case of ship-to-ship bombardments on
rivers, it would be nice if non-cardinal attacks could be disallowed, but I'm
not sure it's practical.
(Wrt my original point 3: I wouldn't try to apply this patch to a stable
(file #14026, file #14027)
Additional Item Attachment:
File name: trunk-rivernative-cardinal-wip.diff Size:24 KB
File name: trunk-rivernative-cardinal-wip.mbox Size:27 KB
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list