Airline Sim
Prototype Goal: To create a fully-functioning airline management simulation. This includes aircraft flying routes designated by the player, creating a queue system for aircraft that are navigating airports, and implementing various other behaviors familiar to aircraft and airports.
This prototype was originally taken up as a contract for a client of mine, and I was highly interested since it was a chance to build big interrelated systems from scratch. I ended up finishing the prototype, with flying colors, and implemented 30+ features over a period of 3 weeks. I will go over some of the major ones.
The first big feature was having aircraft fly to and from airports by following a player-defined route. This required discrete points for which the aircraft would fly through, set up by the client and myself when testing. When in the air, we decided it best to not have to worry about collision yet. But for the ground, there were only so many points: gates, taxiways, runways, etc. And so, this spawned the need for the beginning of a queuing system. I ended up creating this system by having the aircraft route being run on a coroutine, and when the queue for the next point was full, I would 'yield return' and this made the aircraft wait to continue it's process. For special navigations or interruptions, I would yield another coroutine. After doing this many times, I ended up creating a network of nested coroutines that worked pretty well. The route for which the aircraft received data from for its target airport, time of flight, etc was just a struct that was passed to the gameobject and stored as a variable for reading.
At the end of it all, the RouteManager script ended up being over a thousand lines of C# code: RouteManager
Things like having the Aircraft reach a certain cruising altitiude after departure, factoring whether the target airport was above or below the Aircraft, having them teleport across a 2D map (fly across the ocean), and the combination of these intricate pieces to the puzzle proved to be a really tough challenge. Admittedly, the code was a bit ugly, but I did get it to work, through sheer force of will and dedication.
Here's a playlist of all the features I created and implemented for this project: Playlist