This one thing I have been trying for ages is to find a 100% working anti-blocking method for my map. My terrain is not linear/straight, and the units can take multiple paths around unless I force them to take a straight one by blocking another root off. I don't want them to take the long way around the platform. I want them to have a linear path, but if someone is blocking the units will automatically take the long route. I NEED to prevent this somehow. I've tried a few systems and non of them seem to work at all/well enough. Here is the terrain for my map;
X = Units spawn here and move to the location opposite them on the other side of the lane.
T = Units who move in here will teleport across to the other side and then move to their end point.
Each red line represents the paths from each spawn the units should be taking. (It's always going to be a linear line). The central paths units teleport across the gap making it an exceptionally small lane. (and thus harder than normal)
I want to force my units to go one direction and never take the long way around etc. There shouldn't be any blockage anywhere, at any time in any of the maps lanes. Now I made a trigger here, but so far it doesn't work properly. Take a look:
Basically I check the path they should be taking by blocking off the other lanes and then using the 'points connected by pathing' condition. A second variation I did of this made use of a unit that would be spawned and then would run through the path really quickly (set his speed to max aka 160) and then Id wait for a second or two game time and if he isn't in the end location then it means he was blocked by something. Since this would execute for any building it would(or should) make sure there isn't any blocking going on.
But the trigger I'm showing you doesn't work. I'll attach a stripped down version of my map below so you guys can see what I'm talking about and have a better idea of my predicament. Hopefully someone can help me think of a new system or make my current one work...
OK maybe I didn't get it to well, but why are you trying to remove your problem by using triggers?
Can't you just change the "collision type" of your units to none or something like that?
Another thing is to change the "radius" a unit interacts with another, so they just walk like ghosts (like Casper) through them-selfs.
Third way: Make spawning units flying on 0 high and change the "air blocking-radius".
You supposed to make a maze. If they just walked right through then definitely no one would ever win. I need them to follow the path and stay along a linear route. No one can wall, every lane is used.
Nah they only teleport if they're in the middle lanes, because their is a gap and thats how it worked in the original. The rest have to move around the platform in a linear fashion without and walling going on. If someone could tell me how to disable units smart pathing so they dont automatically know the path they're taking is blocked when someone walls it off and they keep going until they do find it is walled off that would also help.
You order the spawning units directly to move to the opposite X point ( regarding a normal and not a middle line) , right?
So your terrain setup doesn't allow to completly seperate the lines like you could do in a standard maze td.
What I can think of would be do create some sub-targets for the units. So the units spawned in the bottom left corner are issued to move to a point between the bottom left and the middle left platform. Then the shortest path the game engine finds should always be through the platform and not completly around the map (aka "the long way"). Or would this require too many changes in your current setup of triggers?
Ah ok, now I see that it's not only about moving, but also about checking if a linear lane was blocked...
Hm, an unelegant solution could be to create an invisible block-checking unit which spawns periodically and is issued to move to the target. If this unit attempts to walk the long way, then the linear way would be blocked.
Ok, another idea: Isn't there a function which returns the movement cost between two points (PointPathingCost() )? So you could use this to check if this is higher than a fixed value which you will need to find out. Maze a platform compeletly out, so that it would require the unit to move the longest way possible, use this function to check for the value (all other non-linear paths should be totally blocked for testing). Maybe add +10% in case a player finds an even better maze :D . And now, whenever the movement cost between spawn and target point is higher than this value, the linear path is blocked. But I guess you will need to use some sub-points between the platforms too here!
Ok, another idea: Isn't there a function which returns the movement cost between two points (PointPathingCost() )? So you could use this to check if this is higher than a fixed value which you will need to find out. Maze a platform compeletly out, so that it would require the unit to move the longest way possible, use this function to check for the value (all other non-linear paths should be totally blocked for testing). Maybe add +10% in case a player finds an even better maze :D . And now, whenever the movement cost between spawn and target point is higher than this value, the linear path is blocked. But I guess you will need to use some sub-points between the platforms too here!
This wouldn't work if a player uses such a complicated maze that navigating the maze would take longer than going "the long way". Personally, I think the invisible blocker checker would be the best solution.
Have 8 unique blockers and 6 regions, each corresponding to a lane. (Have the regions overlap the lanes a bit in case people decide to broaden their horizons a bit wide.) Then before each wave spit out the blockers and have them move FAST through everyone's maze. If any unit leaves a region in a way it's not supposed to, the lane is blocked.
On a side note if you feel like experimenting, I'm not sure that Blizzard's path-finding is so intelligent that it will find an alternate path from A to B if the shortest path is six steps and the alternate path is six thousand. You might try messing around to see where the threshold is.
Maybe you can use Rushhour's idea of calculating the pathing distance, but instead of doing it from end to end, do it from end to midpoint between bases. This way, it's much less likely that a ridiculously intricate maze will have a longer value than the long way around, and you can also determine who is blocking.
Alright I tinkered with it. And the units are now intially ordered to halfway between the bases as you guys suggested, and then ordered to their end points from there. The pathing cost condition your thinking of also excludes all units when it checks, so it's never going to work. There is another one similar to it but instead of 'region -> region' it is 'unit -> region.' Here's the trigger I set up to test it a slightly different way and it doesn't work;
Thing doesn't work whatsoever. So I'm going to either have to resort to something else or go ahead with this and see if it will work. Anyone know how I can get the pathing cost to the points I need? Just save it in a integer variable and recite it back to the user in a text message or something?
This one thing I have been trying for ages is to find a 100% working anti-blocking method for my map. My terrain is not linear/straight, and the units can take multiple paths around unless I force them to take a straight one by blocking another root off. I don't want them to take the long way around the platform. I want them to have a linear path, but if someone is blocking the units will automatically take the long route. I NEED to prevent this somehow. I've tried a few systems and non of them seem to work at all/well enough. Here is the terrain for my map;
X = Units spawn here and move to the location opposite them on the other side of the lane.
T = Units who move in here will teleport across to the other side and then move to their end point.
Each red line represents the paths from each spawn the units should be taking. (It's always going to be a linear line). The central paths units teleport across the gap making it an exceptionally small lane. (and thus harder than normal)
I want to force my units to go one direction and never take the long way around etc. There shouldn't be any blockage anywhere, at any time in any of the maps lanes. Now I made a trigger here, but so far it doesn't work properly. Take a look:
Basically I check the path they should be taking by blocking off the other lanes and then using the 'points connected by pathing' condition. A second variation I did of this made use of a unit that would be spawned and then would run through the path really quickly (set his speed to max aka 160) and then Id wait for a second or two game time and if he isn't in the end location then it means he was blocked by something. Since this would execute for any building it would(or should) make sure there isn't any blocking going on.
But the trigger I'm showing you doesn't work. I'll attach a stripped down version of my map below so you guys can see what I'm talking about and have a better idea of my predicament. Hopefully someone can help me think of a new system or make my current one work...
- Thanks!
OK maybe I didn't get it to well, but why are you trying to remove your problem by using triggers?
Can't you just change the "collision type" of your units to none or something like that?
Another thing is to change the "radius" a unit interacts with another, so they just walk like ghosts (like Casper) through them-selfs.
Third way: Make spawning units flying on 0 high and change the "air blocking-radius".
-h34dl4g
@h34dl4g: Go
You supposed to make a maze. If they just walked right through then definitely no one would ever win. I need them to follow the path and stay along a linear route. No one can wall, every lane is used.
Try odering them to the point of the teleporters rather then ordering them to the end point?
@SouLCarveRR: Go
Nah they only teleport if they're in the middle lanes, because their is a gap and thats how it worked in the original. The rest have to move around the platform in a linear fashion without and walling going on. If someone could tell me how to disable units smart pathing so they dont automatically know the path they're taking is blocked when someone walls it off and they keep going until they do find it is walled off that would also help.
Ok, I think I understand your problem.
You order the spawning units directly to move to the opposite X point ( regarding a normal and not a middle line) , right?
So your terrain setup doesn't allow to completly seperate the lines like you could do in a standard maze td.
What I can think of would be do create some sub-targets for the units. So the units spawned in the bottom left corner are issued to move to a point between the bottom left and the middle left platform. Then the shortest path the game engine finds should always be through the platform and not completly around the map (aka "the long way"). Or would this require too many changes in your current setup of triggers?
Ah ok, now I see that it's not only about moving, but also about checking if a linear lane was blocked...
Hm, an unelegant solution could be to create an invisible block-checking unit which spawns periodically and is issued to move to the target. If this unit attempts to walk the long way, then the linear way would be blocked.
Ok, another idea: Isn't there a function which returns the movement cost between two points (PointPathingCost() )? So you could use this to check if this is higher than a fixed value which you will need to find out. Maze a platform compeletly out, so that it would require the unit to move the longest way possible, use this function to check for the value (all other non-linear paths should be totally blocked for testing). Maybe add +10% in case a player finds an even better maze :D . And now, whenever the movement cost between spawn and target point is higher than this value, the linear path is blocked. But I guess you will need to use some sub-points between the platforms too here!
greetz
This wouldn't work if a player uses such a complicated maze that navigating the maze would take longer than going "the long way". Personally, I think the invisible blocker checker would be the best solution.
Have 8 unique blockers and 6 regions, each corresponding to a lane. (Have the regions overlap the lanes a bit in case people decide to broaden their horizons a bit wide.) Then before each wave spit out the blockers and have them move FAST through everyone's maze. If any unit leaves a region in a way it's not supposed to, the lane is blocked.
On a side note if you feel like experimenting, I'm not sure that Blizzard's path-finding is so intelligent that it will find an alternate path from A to B if the shortest path is six steps and the alternate path is six thousand. You might try messing around to see where the threshold is.
Maybe you can use Rushhour's idea of calculating the pathing distance, but instead of doing it from end to end, do it from end to midpoint between bases. This way, it's much less likely that a ridiculously intricate maze will have a longer value than the long way around, and you can also determine who is blocking.
@Abion47: Go
Alright I tinkered with it. And the units are now intially ordered to halfway between the bases as you guys suggested, and then ordered to their end points from there. The pathing cost condition your thinking of also excludes all units when it checks, so it's never going to work. There is another one similar to it but instead of 'region -> region' it is 'unit -> region.' Here's the trigger I set up to test it a slightly different way and it doesn't work;
Thing doesn't work whatsoever. So I'm going to either have to resort to something else or go ahead with this and see if it will work. Anyone know how I can get the pathing cost to the points I need? Just save it in a integer variable and recite it back to the user in a text message or something?