I'm producing tactical turn-based game that is not grid based. I need to determine the pathing distance, taking into account obstacles, cliffs, and units so the requested move is within the unit's range.
I'm working on a map where I would like to calculate the pathing distance from the unit's current position to a point some distance away. I've found that using an A* algorithm works 'ok' but becomes too inaccurate for my needs (>10% error) with the introduction of elevation changes, large obstacles, and unusually large distances. Has anyone every tackled this problem before? My comparison so far as been using a unit of 1 speed to traverse the distance and clock total time from A to B.
Yeah, unfortunately it's only marginally useful for finding the cost of each iteration used in the A* algorithm (probably why it's there in the first place). I use that function in my A* trigger blocks, but it doesn't give me the 'output' that i'm looking for.
...hm... i wonder if I spawned and invisible unit at a known speed travel and see how long it took, use that to calculate the distance given the speed?
Do you or anyone happen to know how to make a truly invisible model (not cloaked!)
A unit with a fixed speed being timed traveling a distance would give you a pretty accurate Pathing cost I think, so long as this invisible unit has the same collision flags, and radius as the unit that it is plotting the pathing cost for. Make sure to give the invisible unit the same collision flags and radii (inner radius, movement radius, etc.).
One obstacle is that the smallest iteration of timing in Triggers is 1/16 Second (or, 0.0625 Second). This could also lead to some inaccuracies. (More inaccuracies the faster the speed of the unit.)
As far as making a unit completely invisible, try the "No Draw" flag in the Data Editor - Under unit. Furthermore, you can send an actor message to a unit to ModelSwap for the Invisible Target Dummy unit. As Rommsteinz said, it would be a good idea to set the unit's state to Unselectable, Uncommandable, and Invulnerable.
Do you or anyone happen to know how to make a truly invisible model (not cloaked!)
There is a model available in the standard WoL assets that is called Invisible and is just that.
You can also set the Opacity of an actor to 0 by using Actor Events which makes it invisible, you might still see other actors that are attached to this actor though unless you manually edit their Opacity/disable them (like Selection circles, Shadows etc.).
Your last option is to give a unit both the Cloaked and Buried flags, I think that should make them invisible too.
Hello everyone,
I'm producing tactical turn-based game that is not grid based. I need to determine the pathing distance, taking into account obstacles, cliffs, and units so the requested move is within the unit's range.
I'm working on a map where I would like to calculate the pathing distance from the unit's current position to a point some distance away. I've found that using an A* algorithm works 'ok' but becomes too inaccurate for my needs (>10% error) with the introduction of elevation changes, large obstacles, and unusually large distances. Has anyone every tackled this problem before? My comparison so far as been using a unit of 1 speed to traverse the distance and clock total time from A to B.
There is a function "pathing cost between points". Did not work with that so much but I guess that one could help you.
@Talon0815: Go
Yeah, unfortunately it's only marginally useful for finding the cost of each iteration used in the A* algorithm (probably why it's there in the first place). I use that function in my A* trigger blocks, but it doesn't give me the 'output' that i'm looking for.
...hm... i wonder if I spawned and invisible unit at a known speed travel and see how long it took, use that to calculate the distance given the speed?
Do you or anyone happen to know how to make a truly invisible model (not cloaked!)
Just make an invunerable, unselectable & co. unit, attached to a model with a 0.001 size. Should do the work.
But I think this solution to calculate the path cost is not the best one, anyway I don't see another better solution, so good luck with this one. ;)
A unit with a fixed speed being timed traveling a distance would give you a pretty accurate Pathing cost I think, so long as this invisible unit has the same collision flags, and radius as the unit that it is plotting the pathing cost for. Make sure to give the invisible unit the same collision flags and radii (inner radius, movement radius, etc.).
One obstacle is that the smallest iteration of timing in Triggers is 1/16 Second (or, 0.0625 Second). This could also lead to some inaccuracies. (More inaccuracies the faster the speed of the unit.)
As far as making a unit completely invisible, try the "No Draw" flag in the Data Editor - Under unit. Furthermore, you can send an actor message to a unit to ModelSwap for the Invisible Target Dummy unit. As Rommsteinz said, it would be a good idea to set the unit's state to Unselectable, Uncommandable, and Invulnerable.
There is a model available in the standard WoL assets that is called Invisible and is just that.
You can also set the Opacity of an actor to 0 by using Actor Events which makes it invisible, you might still see other actors that are attached to this actor though unless you manually edit their Opacity/disable them (like Selection circles, Shadows etc.).
Your last option is to give a unit both the Cloaked and Buried flags, I think that should make them invisible too.
For an accurate way to measure distance between stuff, go to tools and use Measure Distance (or Ctrl+M)
Thanks for the help.
My invisible unit is creating a vision field- is there any way to make it blind/not have vision?
@En7ropi: Go
Look for the field called Sight or Vision. I forget.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.