Since it seems that the pathfinding works based on A* and cost values related to the map's slope, I propose that we implement a system of overlays for the costs. Suppose I wanted units to avoid a certain valley, I could hilight the valley with some shortcut key and it would create an overlay, increasing the cost of movement in that area. The same tactic could be applied for telling units to seek a particular route by creating an overlay to decrease the cost of movement.
I think that the pathfinding component of this idea would be relatively straightforward. The nice thing is that it only requires subtle changes in the algorithm to accommodate a vast array of strategic possibilities. The overlays could be created in non-cardinally oriented ways by simply rotating the camera before creating them. They could be displayed as some sort of graphic overlay on the terrain like the LOS stuff.
PS: I'm too busy w/ finals atm to get this done, but I'd love if someone could expand on this idea and implement it. I think it would add a new dimension to the gameplay.
Movement cost overlays
Moderator: Moderators
When I have a lot of units, the pathfinding is quite laggy. Sometimes there is a lock for as much as 0.5 seconds when I have a lot of units moving around. I would rather that they improve this myself.
(Although, I run it in Linux, so its possible that the problem lies from using a binary loader to run it. I doubt it though.)
(Although, I run it in Linux, so its possible that the problem lies from using a binary loader to run it. I doubt it though.)
Last edited by Ace07 on 05 May 2005, 22:22, edited 1 time in total.
The current spring pathfinding system does a lot of precalculations about the map (which is updated on the fly when the map changes) and letting the user create overlays on the map would force us to branch these calculations for each team which could be expensive.
I have thought about the same sort of thing but I havent found a good/cheap way to do it with how the spring pathfinding currently works.
I have thought about the same sort of thing but I havent found a good/cheap way to do it with how the spring pathfinding currently works.
I think that the pathfinding efficiency could be dramatically increased if you were to implement per unit 'behaviors'. That way, a group movement command could be implemented as a single path (per unit movement ability). Units would then be given a steering behavior to follow that path. Maybe the pathfinder max iterations should be more dynamic too.
I'm still doing research about that, but the following looks like a nice library we could use or at least get inspiration from:
http://opensteer.sourceforge.net/
http://opensteer.sourceforge.net/
Same opinion here, given a n number of units being moved at the same time to the same place, just calculate one "long range path", let the units be automatically grouped(unless the user states they should not mix). Then calculate several "short range paths" so they units remain in the same formation while going over minor obstacles.b1ind wrote:I think that the pathfinding efficiency could be dramatically increased if you were to implement per unit 'behaviors'. That way, a group movement command could be implemented as a single path (per unit movement ability). Units would then be given a steering behavior to follow that path. Maybe the pathfinder max iterations should be more dynamic too.
Nice findings b1ind and Gabba

And my favorite reading about pathfinding in games:
http://www.moonpod.com/board/viewtopic.php?p=6958#6958
I just realized a problem with my idea of creating a single path for group movement. The problem is that of determining an origin. If you click CTL-A for example (all units) and tell them to move to point B, they will all start from very different locations. How would you even get units to the path? That I don't know, but maybe some compromise can be made for units that are within a certain radius.
What about pre-definition of paths? Sorta of a waypoints style.
It could come with the map, implemented specially in areas like roads.
Also it could be stored dynamically, as the units go through the map, they leave waypoints stored in the player's computer, so other units going at it would use the data.
Well, or you get CPU heavy, memory heavy(primary or secondary memories) or a mid-term.
It could come with the map, implemented specially in areas like roads.
Also it could be stored dynamically, as the units go through the map, they leave waypoints stored in the player's computer, so other units going at it would use the data.
Well, or you get CPU heavy, memory heavy(primary or secondary memories) or a mid-term.