I am trying to debug a path calculation problem and I am lost. In my map I have a waypoint very close to a supply depot, and there is nothing in between them. There is not any hidden pathing or anything like that. When I calculate the path cost from the waypoint to the supply depot it returns a value of 65536, so I cannot order any units to attack the supply depot based on it having an achievable path. Has anyone had this happen to them? Is there some flag or setting I am missing? I would appreciate any help anyone could give me.
I uploaded a picture of the problem. The point in question is Plateau3Pt 001, and the supply depot in question is the one highlighted. Sorry for the crappy quality.
If the path is blocked it return 65536. Cause the unit don't find any pathing to the point. ... But i don't know how to fix your problem. Don't do AI or issue order that much.
I have been messing around with pathing the last day or so, so I know that 65536 means its blocked. But as you can see in the picture it is clearly not blocked. The point and depot are almost right next to each other.
The point Plateau3Pt 001 is pathable. I can get a path cost to Plateau3Pt 001 from another point (I have other waypoints around), but evaluating the cost from Plateau3Pt 001 to the position of a structure returns 65536 (with the exception of 1 structure). I tried what you suggested and moved Plateau3Pt 001 around. I even created a supply depot out in the middle of nowhere with a clear path and nothing around it and it still returned a value of 65536. After extensive testing this afternoon I was able to fix the problem, but it seems I may have stumbled upon a genuine bug in the editor or Starcraft.
The solution that makes it work is to reverse the order of inputs in the path calculation function. In my trigger if I use the line:
Variable - Set cost = (Pathing cost between Plateau3Pt 001 and (Position of (Unit ii from structureGroup)))
(ii is an index and structureGroup is a unit group containing all of player 1's structures)
. . . then the routine returns 65536 for every structure. However, if I use the line:
Variable - Set cost = (Pathing cost between (Position of (Unit ii from structureGroup)) and PlateauPt3 001)
. . . then I get values for the structures that reflect whether the units can reach them. I am going to make a demonstration map to see if I can get this failure to occur again. If so I'll post it in this thread.
I got the failure to repeat on a new map. I have attached the map to this post. The successful code is implemented and the failing code disabled. To make the failing code functional just follow the comments in the triggers AttackWithPathCost and DisplayPathCostOfUnits.
I think the answer here to your question is pretty obvious:
The position of the structure is NON pathable, becase there is a structure there. The hexes the structure sits on is unpathable - a unit cannot walk to the center of a building. A unit CAN, however walk to the edge of a building.
If you path to the center of a building, and say a unit actually tires, it will never reach the destination. It will walk to the structure, bump into the edge, and try to force itself inside the building to the center. Impossible. Answer = 65,535.
Path to the edge of the building. Problem solved.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am trying to debug a path calculation problem and I am lost. In my map I have a waypoint very close to a supply depot, and there is nothing in between them. There is not any hidden pathing or anything like that. When I calculate the path cost from the waypoint to the supply depot it returns a value of 65536, so I cannot order any units to attack the supply depot based on it having an achievable path. Has anyone had this happen to them? Is there some flag or setting I am missing? I would appreciate any help anyone could give me.
I uploaded a picture of the problem. The point in question is Plateau3Pt 001, and the supply depot in question is the one highlighted. Sorry for the crappy quality.
If the path is blocked it return 65536. Cause the unit don't find any pathing to the point. ... But i don't know how to fix your problem. Don't do AI or issue order that much.
@ILikeKillAndYou: Go
I have been messing around with pathing the last day or so, so I know that 65536 means its blocked. But as you can see in the picture it is clearly not blocked. The point and depot are almost right next to each other.
It seems that your point is already on a unpathable point. Have you tried to put it a bit closer to the center?
@tatatatate: Go
The point Plateau3Pt 001 is pathable. I can get a path cost to Plateau3Pt 001 from another point (I have other waypoints around), but evaluating the cost from Plateau3Pt 001 to the position of a structure returns 65536 (with the exception of 1 structure). I tried what you suggested and moved Plateau3Pt 001 around. I even created a supply depot out in the middle of nowhere with a clear path and nothing around it and it still returned a value of 65536. After extensive testing this afternoon I was able to fix the problem, but it seems I may have stumbled upon a genuine bug in the editor or Starcraft.
The solution that makes it work is to reverse the order of inputs in the path calculation function. In my trigger if I use the line:
Variable - Set cost = (Pathing cost between Plateau3Pt 001 and (Position of (Unit ii from structureGroup))) (ii is an index and structureGroup is a unit group containing all of player 1's structures)
. . . then the routine returns 65536 for every structure. However, if I use the line:
Variable - Set cost = (Pathing cost between (Position of (Unit ii from structureGroup)) and PlateauPt3 001)
. . . then I get values for the structures that reflect whether the units can reach them. I am going to make a demonstration map to see if I can get this failure to occur again. If so I'll post it in this thread.
I got the failure to repeat on a new map. I have attached the map to this post. The successful code is implemented and the failing code disabled. To make the failing code functional just follow the comments in the triggers AttackWithPathCost and DisplayPathCostOfUnits.
I think the answer here to your question is pretty obvious:
The position of the structure is NON pathable, becase there is a structure there. The hexes the structure sits on is unpathable - a unit cannot walk to the center of a building. A unit CAN, however walk to the edge of a building.
If you path to the center of a building, and say a unit actually tires, it will never reach the destination. It will walk to the structure, bump into the edge, and try to force itself inside the building to the center. Impossible. Answer = 65,535.
Path to the edge of the building. Problem solved.