Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] (PR#7169) Path finding modification
Home

[Freeciv-Dev] (PR#7169) Path finding modification

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7169) Path finding modification
From: "Arnstein Lindgard" <a-l@xxxxxxx>
Date: Sun, 28 Dec 2003 13:47:15 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7169 >

I want to propose a modification to the path finding module:

I think I want to change the boolean "is_dangerous" into a bitvector
that indicates which turns the tile is dangerous on. The "turn" is
like the relative turn in "pf_position->turn". When all bits are set,
the tile is always dangerous, as with triremes and non-coastal tiles.

I could use this to good effect for the Battlegroups patch, where
many gotos are planned at the same time, for a group of units.

Already, the path finding's concept of dangerous tiles, in
combination with the ability to "wait" (opting to not expend all
movement points, while retaining the goto state) is very useful for
anti-stacking group movement. In fact, it makes army groups of
Musketeers work like it was intended to in the war client.

However, I currently mark all tiles that any unit intends to end it's
turn on, as "dangerous", regardless of _which_ turn. This causes the
group to become paranoid, believing that most of the tiles are
dangerous all the time. Members will make artful manouvers, detours
to avoid wrongly percieved dangerous tiles.

When horsing around with large battlegroups, I get this error a lot:

civclient: path_finding.c:740: create_danger_segment: Assertion
`!pf_map->d_lattice[index].is_dangerous' failed.

and it looks like the reason is that too many tiles are dangerous.
(It is the nature of battlegroups to concentrate in a small area.)
This could also be a stand alone bug.

The path finding is quite complex, but I think I could make the
modification without actually groking the Dijkstra system.

Maybe an alternative solution is to pass the is_pos_dangerous()
callback information about the current node, by expanding the
pf_parameter. Maybe it's also neccessary to turn off the caching? I'm
also not sure if this would be a violation of the author's (Gregory?
I guess he's away now) idea of a clean module - not allowing the user
to read internal variables.

Any ideas?


Arnstein




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7169) Path finding modification, Arnstein Lindgard <=