Pathfinder and Yardmap Y [edited]

Pathfinder and Yardmap Y [edited]

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Pathfinder and Yardmap Y [edited]

Post by Argh »

Yardmap Y is not working quite right. The centroid of the Units is the problem.

For example, a Unit with yardmap "y" is still treated as blocking by a lot of Spring's code (including Factories determining whether to let things be built yet!) even though that Unit should be non-blocking entirely.

This also causes major issues with larger Units, which can become hung up on small Units if their centroids intersect.

[EDIT]The previous statements about pathfinding aren't strictly pertinent. The main issues are with Yardmap Y.[/EDIT]
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Pathfinder and Yardmap Y [edited]

Post by zwzsg »

Are you talking about: viewtopic.php?f=12&t=2393
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Pathfinder and Yardmap Y [edited]

Post by BrainDamage »

Argh wrote:Very simply, the pathfinder isn't taking the Yardmap of large objects into account properly. It treats large-footprint static Units as if they're mobile, and only A*'s around then when a collision is detected.

This can cause all sorts of silly problems. For example, a Unit with yardmap "y" is still treated as blocking by a lot of Spring's code (including Factories determining whether to let things be built yet!) even though that Unit should be non-blocking entirely. Units with large Yardmaps frequently cause clipping on other large Units with big sizeX sizes in their MoveType, because they don't recognize that that part of the map is blocked.

Meh. Just let me manipulate the map's accessibility (i.e., that flag which can currently only be set in the map's bitmaps, which can be set to "always blocked") and I can make a lot of this go away with Lua. But the central issue of yardmap "y" not truly removing the location from movement checks (because the local-move section of the pathfinder is too dumb to treat non-mobile Units differently than mobile Units) is a major problem, and can't be solved easily without engine changes. I've already dealt with making it possible for Units to knock down "trees" in WorldBuilder maps, which means that finally WorldBuilder is 100% feature-complete and matches or exceeds all of Spring's native features... but this is a major issue in terms of efficient pathfinding, and it needs to get looked at, imo.
The answer is here
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Pathfinder and Yardmap Y [edited]

Post by Argh »

Not entirely. And quit whining, I wasn't entirely done testing yet, it's harder to sort out what's happening than it might at first appear.

Support for "y" was added, and it works, in general. There's a specific bug in the pathfinder's collision-detection routine and in Factories, though, where it treats centroid collisions all the same, regardless of Yardmap state.
Last edited by Argh on 04 Mar 2009, 22:49, edited 1 time in total.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Pathfinder and Yardmap Y [edited]

Post by lurker »

You wrote all that mid-test, and finished the testing a couple minutes later?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Pathfinder and Yardmap Y [edited]

Post by Argh »

Pretty much, yes. Can't be helped, I'm in the middle of doing a bunch of stuff atm.

In the last testing session, we ran into a couple of show-stoppers involving roads (all yardmap y, of course) and small plants (single yardmap y) where they'd block Factories from even starting new Units, and where they could sometimes cause serious issues with pathfinding, because a collision is detected even though it shouldn't be.

I'm in the middle of fixing all of that. Fixing the collision issue is a major pain, I've done it but it involved some fairly hefty BOS work... and I've already explained what I'd like, so that nobody has to reinvent that particular wheel.

Fixing the factory issue, on the other hand, required a fairly ugly brute-force solution, i.e., just plain deleting any stuff under a newly-built Unit. It works, but it's ugly and I don't like to see a section of roadway disappear when I lay down a factory too close :P
Post Reply

Return to “Feature Requests”