Is there any way to get one unit to path through, for example to only collide with structures, and another unit to only collide with doodads?
I'm trying to make a multiple floor building, and everything is working out just fine, but the second floor needs to have units colliding and pathing around the walls up there, not on the ground floor. If I have the same pathing algorithm for both floors, the unit will be bumping into walls that aren't even on that floor (they're on the floor above/below)!
Unfortunately, trying to have the 2nd story units use a flying mover didn't work - not only are the no fly zones annoying, but the units don't actually try to path anywhere; they just fly straight into obstacles and bounce around. This is the same case with placing tons of units to block fliers or burrow-movers (diggers), the whole no-pathing thing. I'm afraid it has to be an Avoid mover for the unit to use.
I really don't want to have to program a pathing algorithm myself for the second floor, >< !
So, if there is a way to make one unit Ignore doodads, but Collide with structures, and another unit Ignore structures and Collide with doodads, that's exactly what I'm looking for.
Did you try using fancy collision flags? Units should only collide with eachother if they share at least one collision flag. So pick an otherwise unused ground collision flag and make it the only collision flag for your unit and then give it as well to every kind of structure. Now that unit should collide only with structures since nothing else shares that collision flag. Do the same with a different unused flag for the other unit and the doodads or whatever.
The problem would be, that footprints do not support these collision flags, only units do. Since doodads only have collision, if they have a footprint, you would need to handle everything with units instead, probably spamming the map with invisible blocker units. If this can be applied for your map, it should not be problematic, the collision flags work nicely in this case.
Excellent point. If I understand correctly, footprints basically paint the pathing layer so no ground pathing whatsoever is allowed underneath them. So yes you will need to remove the footprints for the structures/doodads, or at least remove the pathing layer of the footprints they use.
The problem with making invisible units to create collision, and all those sorts of things, is the AI Pathing. When you use standard doodads and the like, units will plot paths to avoid obstacles in order to reach their destination, just like the example on the left. However....:
As you can see on the Right, when Invisible Units/ No Fly Zones are used, the unit No Longer plots a path, and instead just dumbly walks straight at the goal without any regard for what's in the way. The unit no longer thinks about how to get there, and instead just tries to get there. I am going to be making a few very hard to kill enemies on the second floor, but they have to be able to navigate out of a room. If the bottom floor is using standard doodads, then the second floor has to use something else that (hopefully exists) they can intelligently path though. Otherwise, I have to use Triggers to program an A* Pathing algorithm myself (which is going to be buggy for a long time and also clunky, because they're triggers).
I can make units colliding mutually exclusively, sure, but I'm not asking for collision. I'm asking for Pathing.
PS: There was a pathing footprint (1x1 Underground) that I saw in the Pathing Footprint list.. perhaps, if the 2nd story units are "burrowed", they will path around those objects with the 1x1 Underground footprint....
I think that the underground footprint simply forces units to be able to walk over it, even allowing burrowed units.
ie, it just overrides all normal collision.
Is there any way to get one unit to path through, for example to only collide with structures, and another unit to only collide with doodads?
I'm trying to make a multiple floor building, and everything is working out just fine, but the second floor needs to have units colliding and pathing around the walls up there, not on the ground floor. If I have the same pathing algorithm for both floors, the unit will be bumping into walls that aren't even on that floor (they're on the floor above/below)!
Unfortunately, trying to have the 2nd story units use a flying mover didn't work - not only are the no fly zones annoying, but the units don't actually try to path anywhere; they just fly straight into obstacles and bounce around. This is the same case with placing tons of units to block fliers or burrow-movers (diggers), the whole no-pathing thing. I'm afraid it has to be an Avoid mover for the unit to use.
I really don't want to have to program a pathing algorithm myself for the second floor, >< ! So, if there is a way to make one unit Ignore doodads, but Collide with structures, and another unit Ignore structures and Collide with doodads, that's exactly what I'm looking for.
@gerudobombshell: Go
Did you try using fancy collision flags? Units should only collide with eachother if they share at least one collision flag. So pick an otherwise unused ground collision flag and make it the only collision flag for your unit and then give it as well to every kind of structure. Now that unit should collide only with structures since nothing else shares that collision flag. Do the same with a different unused flag for the other unit and the doodads or whatever.
The problem would be, that footprints do not support these collision flags, only units do. Since doodads only have collision, if they have a footprint, you would need to handle everything with units instead, probably spamming the map with invisible blocker units. If this can be applied for your map, it should not be problematic, the collision flags work nicely in this case.
@Kueken531: Go
Excellent point. If I understand correctly, footprints basically paint the pathing layer so no ground pathing whatsoever is allowed underneath them. So yes you will need to remove the footprints for the structures/doodads, or at least remove the pathing layer of the footprints they use.
The problem with making invisible units to create collision, and all those sorts of things, is the AI Pathing. When you use standard doodads and the like, units will plot paths to avoid obstacles in order to reach their destination, just like the example on the left. However....:
As you can see on the Right, when Invisible Units/ No Fly Zones are used, the unit No Longer plots a path, and instead just dumbly walks straight at the goal without any regard for what's in the way. The unit no longer thinks about how to get there, and instead just tries to get there. I am going to be making a few very hard to kill enemies on the second floor, but they have to be able to navigate out of a room. If the bottom floor is using standard doodads, then the second floor has to use something else that (hopefully exists) they can intelligently path though. Otherwise, I have to use Triggers to program an A* Pathing algorithm myself (which is going to be buggy for a long time and also clunky, because they're triggers).
I can make units colliding mutually exclusively, sure, but I'm not asking for collision. I'm asking for Pathing.
PS: There was a pathing footprint (1x1 Underground) that I saw in the Pathing Footprint list.. perhaps, if the 2nd story units are "burrowed", they will path around those objects with the 1x1 Underground footprint....
@gerudobombshell: Go
2 things which I believe affect whether units try to path around other units:
1. Hold Position. If you give the blockers the move ability and order them to hold position (via trigger) units should path differently around them.
2. Push Priority. Setting the push priority of the blocker higher than the unit should affect pathing.
I tried these out and they didn't seem to help sufficiently =/
I think that the underground footprint simply forces units to be able to walk over it, even allowing burrowed units. ie, it just overrides all normal collision.