Hey guys,
So I’m working on my airport sim game at the moment. The next challenge I face, is to tackle path finding for the planes.
At the very basic level, the planes need to navigate from the runway, along the taxi way, to an available apron.
I’ve started by inheriting my base building class to create a ‘PlaneNavigatableBuilding’ sub class. So runways, taxi ways, aprons will be derived from this class. The rough idea in my head is to use pathing points and then use something like A*.
So in the PlaneNavigatableBuilding, it has an FVector array of PathingPoints. My runway (derived from PlaneNavigatableBuilding) class then has an FVector for it’s Entry and exit. Then the Aprons (Also derived from PlaneNavigatableBuilding) have an FVector for the parking position.
So then the plane just needs to check the runway for it’s exit point, run through and path the taxi ways PathingPoints, to an apron parking point.
Am I going about this the right way? Can you suggest a simpler method?
Many thanks!
While thinking about checking if a taxiway is actually connected, I think that should be okay. I’ve implemented a grid snapping system for when the player places buildings, so everything is on a grid. To check if a taxiway is connected to itself, just needs to check if the other one has any PathingPoints that match any of it’s own.
When thinking about scale, I’m thinking in my head it would be a good idea to have some kind of path manager. Once the player exit’s build mode, the path manager pre-calculates routes from runways to each apron. When a plane land, it asks the path manager for a route from it’s runway exit to a desired apron.
So then maybe the Path manager will hold ‘route structs’:
struct RouteRunwayExitToApron
{
RunwayExitPoint;
PathingPoints;
ApronParkingPoint
}
The plane then requests a route from runway to apron, then the pathing manager searches through the route structs to find one that fits the planes desired