Is there any way for map/mod makers to assist pathfinding?

Is there any way for map/mod makers to assist pathfinding?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Is there any way for map/mod makers to assist pathfinding?

Post by Super Mario »

Or is this can only be obtain on the engine side?
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Is there any way for map/mod makers to assist pathfinding?

Post by SpliFF »

I'd say avoid narrow passes. Regardless of the quality of pathfinding you can only fit a certain number of units per second through any specific gap which means any excess units have to queue behind which leads to them turning around to find a new route and bouncing off other units. It's even worse if friendly units are trying to enter the gap from both sides. Since there is no code to say "stand aside and let the larger group pass" it means a single unit can block an entire army. You'd also want to avoid crossroads where columns of friendly units would regularly cross paths. Once again the code does not allow either group to wait for the other so the result is the groups entangle in the intersection.

Having said that, there are features in the engine like "heatmapping" which provide hints as to whether an area is "busy". Still, I wouldn't rely on that (especially since it can be turned off).
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: Is there any way for map/mod makers to assist pathfinding?

Post by Super Mario »

What about the units who have different speeds? I keep finding that the fast one somehow gets stuck behind the group of fast ones.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Is there any way for map/mod makers to assist pathfinding?

Post by BaNa »

Another thing I have learned is that however realistic adding some perlin noise to your "flat" areas is, it ruins pathing majorly. Try to keep all playable surfaces free of any high or mid frequency noise. A trick you can do is have 2 heightmaps, one that you use to render the texture (this can have all the noise you want) and one that is the ingame heightmap (strictly smooth surfaces).
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Is there any way for map/mod makers to assist pathfinding?

Post by knorke »

ingame select a unit and press F2. (i think first you have to type /cheat /globallos to see whole map)
Ideally passable (green) and unpassable areas (red) have clear borders.
If there are stray, noisy red fields or narrow green fields, pathing will become more problematic.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Is there any way for map/mod makers to assist pathfinding?

Post by zerver »

There is Lua pathfinding ofc, but in general I would say it is too slow. In the future we may have different engine-side pathfinders to choose from, because the interface is now clean enough to allow that.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Is there any way for map/mod makers to assist pathfinding?

Post by Anarchid »

There is Lua pathfinding ofc
How slow is that slow? And can it delegate to engine?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Is there any way for map/mod makers to assist pathfinding?

Post by Google_Frog »

There is some simple mod stuff.

Make sure your units are as big as they think they are with equal entries for footprint in movedefs and unitfefs.

Avoid large turn radius or low accelerations unless required.
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Is there any way for map/mod makers to assist pathfinding?

Post by KaiserJ »

make "flats" of maps completely flat

make "ramps" completely evenly graded with an even slope width throughout

make "cliff edges" an even slope throughout

frozen fortress paths near-perfectly, this was not by accident... just takes a fair amount of planning and testing
Post Reply

Return to “Engine”