Pathing...
Moderator: Moderators
Re: Pathing...
It would probably double the pathfinder's work, but yes, an order-option that says "don't consider what path is the _best_ just what is the shortest possible path" would be nice.
Re: Pathing...
Wouldn't such a way of governing unit movement be simpler for the pathfinder?
Re: Pathing...
You'd still want some minimal pathing to avoid utterly impassable barriers, which means doing the pathing all over again.Gota wrote:Wouldn't such a way of governing unit movement be simpler for the pathfinder?
Re: Pathing...
but suppose it was remade to ignore if a specific way is faster...wouldn't it make pathing faster?
Re: Pathing...
Absolutely yes, doing a "go from X,Y to A,B" is pretty simple. That said, it wouldn't be "pathing" as we currently know it.wouldn't it make pathing faster?
It already prefers different terrain types and slopes. That's really not the issue.Without knowing how the pathfinder is implemented saying what we want is all just shots in the dark... so I'm gunna fire a few bullets to! I'd guess just giving units and/or movement classes preferability multipliers for the different terrain types/slope ranges to modify the path costs would be a viable and possibly effective (maybe requiring heavy testing on modder's part) solution.
Not really. We're talking about a forced-move here, where it'll just bork if the conditions aren't right. I suppose it wouldn't kill it to A* around truly impassible stuff, but that will lead to some badness (forever trying to get around large obstacles such as bodies of water, because a user gave it a command to reach a point on the opposite side, for example)... so it would probably be better to simply make it halt, if it hits something impassible, unless it's on Patrol perhaps.You'd still want some minimal pathing to avoid utterly impassable barriers, which means doing the pathing all over again.
I mean, this isn't something I really expect people to use a lot manually. Sometimes, dealing with hills and other areas where the current pathfinder borks, maybe.
Re: Pathing...
Well,i think units should try and move around unpassable terrain just like the do now but ignore anything else.
Re: Pathing...
It's A*.
Change the cost function to a boolean passable or not passable and you have a pathfinder that doesn't take terrain into account but still doesn't try to move through impassable terrain. (But it will move over a very slow path if that happens to be the shortest path of course.)
The real work would be in finding where this function is defined and implementing the change as an option (a modifier to unit commands?) throughout the stack GUI -> Network -> Sim -> Pathfinder. (EDIT: oh, and making it work nice with path precomputation.)
The A* algorithm is a pathFINDER, so if there is any path around the water it will find it. (the A* algorithm is complete, it will always find a solution if there is one)
Besides that the groundmovetype would kill the movement anyway if it would get stuck on anything, just like now.
Change the cost function to a boolean passable or not passable and you have a pathfinder that doesn't take terrain into account but still doesn't try to move through impassable terrain. (But it will move over a very slow path if that happens to be the shortest path of course.)
The real work would be in finding where this function is defined and implementing the change as an option (a modifier to unit commands?) throughout the stack GUI -> Network -> Sim -> Pathfinder. (EDIT: oh, and making it work nice with path precomputation.)
Uuuuuuuhm, no.Argh wrote:I suppose it wouldn't kill it to A* around truly impassible stuff, but that will lead to some badness (forever trying to get around large obstacles such as bodies of water, because a user gave it a command to reach a point on the opposite side, for example)... so it would probably be better to simply make it halt, if it hits something impassible, unless it's on Patrol perhaps.
The A* algorithm is a pathFINDER, so if there is any path around the water it will find it. (the A* algorithm is complete, it will always find a solution if there is one)
Besides that the groundmovetype would kill the movement anyway if it would get stuck on anything, just like now.
Re: Pathing...
Fair enough. That seems like it'd work. I don't have time to poke at the pathfinder code ATM, I'll see if I can get to it after the release of RC4.
Re: Pathing...
Would it be possible to make it so that it could be applied to an entire game/mod?not as a special command given to units..