Heya. Here's the scenario I'm looking to accomplish. Not now necessarily, but someday I think I'll need it, so I'll just ask now.
Let's say I have a maze of pathable terrain. But the maze can change. (Maybe there's depots that open and close or something. It doesn't matter too much.)
I want to have a flying unit (or a missile or something). When it starts, I want it to immediately have a path determined for it according to what path is open in the terrain at ground-level. But if the terrain changes while the unit is moving, I want that unit to continue to travel the path that was pre-determined for it upon its launch.
So basically, I want the game to determine the best path from start point to end point, and then the unit or missile to start traveling along that path in the air, and for it to stay true to the path it started on no matter what changes happen to the terrain below it while it is moving.
Is that possible? If so, how? This is for a map idea I haven't started on yet, so any ideas are appreciated. A data way is preferred, but I'm open to any and all ideas.
The idea I'm currently tossing around in my head is to have an extremely fast invisible ground unit path across the maze right before the flying unit or missile launches. If the game can transfer a path from one unit to another, I'd then do that. But if not, then I could come up with some convoluted way for the super-fast ground unit to register nodes on the ground to make a hacky missile path or something.
While I was reading your post I was thinking about the exact same idea: having a ground unit walk in front of the unit.
Maybe the ground unit shouldn't be super fast but have the exact same speed as the flyer. the flyer would move towards the current position of the ground unit while the ground unit walks the path.
Maybe there is a way to make flying units actually cliff walkers (like Collosus). Or maybe you can generate air blockers the same way you generate your terrain.
The path would have to be determined instantaneously, or near instantaneously, hence the idea of a fast unit to grab the pathing from. Though I suppose if it's just the pathing we need to grab, the unit's speed wouldn't matter. It would just have to be a ground unit and you would have to be able to transfer its path to the flying unit somehow.
But if the game doesn't have a way to transfer a pathing, then it would have to be a fast ground unit. Maybe if there's some way to give it a behavior that detects when it turns, it can queue shift-move orders to the unit that it's guiding whenever it turns.
The reason the pathing would have to be determined instantly, is because it's important for the flier/missile to continue along the same path once that path is determined. I can't have it deviate if the terrain changes, so the path has to be determined right away.
just save each point of the path in an array (or on the unit, custom values) and issue order the flying unit to move to these points.
problems arise if the path is too long (max order count).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Heya. Here's the scenario I'm looking to accomplish. Not now necessarily, but someday I think I'll need it, so I'll just ask now.
Let's say I have a maze of pathable terrain. But the maze can change. (Maybe there's depots that open and close or something. It doesn't matter too much.)
I want to have a flying unit (or a missile or something). When it starts, I want it to immediately have a path determined for it according to what path is open in the terrain at ground-level. But if the terrain changes while the unit is moving, I want that unit to continue to travel the path that was pre-determined for it upon its launch.
So basically, I want the game to determine the best path from start point to end point, and then the unit or missile to start traveling along that path in the air, and for it to stay true to the path it started on no matter what changes happen to the terrain below it while it is moving.
Is that possible? If so, how? This is for a map idea I haven't started on yet, so any ideas are appreciated. A data way is preferred, but I'm open to any and all ideas.
The idea I'm currently tossing around in my head is to have an extremely fast invisible ground unit path across the maze right before the flying unit or missile launches. If the game can transfer a path from one unit to another, I'd then do that. But if not, then I could come up with some convoluted way for the super-fast ground unit to register nodes on the ground to make a hacky missile path or something.
While I was reading your post I was thinking about the exact same idea: having a ground unit walk in front of the unit.
Maybe the ground unit shouldn't be super fast but have the exact same speed as the flyer. the flyer would move towards the current position of the ground unit while the ground unit walks the path.
Maybe there is a way to make flying units actually cliff walkers (like Collosus). Or maybe you can generate air blockers the same way you generate your terrain.
The path would have to be determined instantaneously, or near instantaneously, hence the idea of a fast unit to grab the pathing from. Though I suppose if it's just the pathing we need to grab, the unit's speed wouldn't matter. It would just have to be a ground unit and you would have to be able to transfer its path to the flying unit somehow.
But if the game doesn't have a way to transfer a pathing, then it would have to be a fast ground unit. Maybe if there's some way to give it a behavior that detects when it turns, it can queue shift-move orders to the unit that it's guiding whenever it turns.
The reason the pathing would have to be determined instantly, is because it's important for the flier/missile to continue along the same path once that path is determined. I can't have it deviate if the terrain changes, so the path has to be determined right away.
@Amaroq64: Go
just save each point of the path in an array (or on the unit, custom values) and issue order the flying unit to move to these points.
problems arise if the path is too long (max order count).