Pathing... - Page 2

Pathing...

Requests for features in the spring code.

Moderator: Moderators

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Pathing...

Post by Pxtl »

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.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Pathing...

Post by Gota »

Wouldn't such a way of governing unit movement be simpler for the pathfinder?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Pathing...

Post by Pxtl »

Gota wrote:Wouldn't such a way of governing unit movement be simpler for the pathfinder?
You'd still want some minimal pathing to avoid utterly impassable barriers, which means doing the pathing all over again.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Pathing...

Post by Gota »

but suppose it was remade to ignore if a specific way is faster...wouldn't it make pathing faster?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Pathing...

Post by Argh »

wouldn't it make pathing faster?
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.
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.
It already prefers different terrain types and slopes. That's really not the issue.
You'd still want some minimal pathing to avoid utterly impassable barriers, which means doing the pathing all over again.
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.

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.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Pathing...

Post by Gota »

Well,i think units should try and move around unpassable terrain just like the do now but ignore anything else.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Pathing...

Post by Tobi »

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.)
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.
Uuuuuuuhm, no.

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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Pathing...

Post by Argh »

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.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Pathing...

Post by Gota »

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..
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Pathing...

Post by Tobi »

Yes.
Post Reply

Return to “Feature Requests”