This is a tiny flight simulator based on a Cessna-172R with a G1000 glass cockpit. (This is the plane I fly in real life, so I thought it would be a challenge to see if it can be done with Pico-8.)
The flight model is not based on theory but on my observations as a pilot. I have to say that it's quite good ;-) Within the limits of Pico-8 it quite feels like the real thing.
Disclaimer: while I created the instruments and the flight model, the majority of the programming work was done by @freds72, including 3D outside view, code structure, eye candy, music, etc. Many thanks Fred, this would not have been possible without your ninja programming skills!!
If you want to go flying right away, the cheatsheet will get you in the air in less than 1 minute:
If you are more the serious type, there is a 34-page flight manual, which explains everything in detail and features 20+ flight lessons.
We also created an entire area you can fly in (with a mountain, an island, ships and much more):
Just as a sneak preview, here are some of the things you can do:
High speed buzzing
Illegal low-level flying at night
Instrument flying in the clouds
Here is the real cockpit on a flight in the Swiss alps to compare:
- fixed polygon gaps
- added collision detection for wind turbines
- sub-pixel polygon rasterization
- faster textured clouds
- fixed ugly crash
- fixed: crash when geometry is fully clipped
- added: HUD-mode (player 2 down key to toggle)
The full approach is probably worth explaining in more detail. You are inbound to Pico VOR (a navigation beacon - blue dot on map display) at 3000 feet. You will now continue to fly your inbound course of 313 degrees while remaining at 3000 feet. The blue arrow on the HSI (horizontal situation indicator - round instrument in the middle) always points towards Pico VOR and the number at the bottom left shows the distance to it in nautical miles. As you pass over Pico VOR, you will observe that the bearing pointer changes direction and now points directly behind you and the distance to the VOR will start increasing. Continue to fly a heading of 313 degrees at 3000 feet while observing the distance from the VOR.
Pay close attention to the green arrow on the HSI once you are at 6 miles. The middle part of the arrow will start moving towards the airplane symbol, which means that you approach the runway centerline. Once you are almost on the centerline, start turning to a heading of 265 degrees - AWAY from the airport! This is now the moment to reduce power (to around 2000 RPM) and descend to 2000 feet (at around 1000 feet per minute).
Level off at 2000 feet and slowly turn right 45 degrees to a heading of 310. Fly for one minute and turn left 180 degrees to a heading of 130. Now you are at a 45 degree intercept angle for the final approach towards the airport. Once again, closely observe the middle part of the green arrow on the HSI. As it starts moving towards the airplane symbol slowly turn left the final approach heading of 85 degrees.
Try to keep the moving part of the green arrow in the middle (this means that you are on the extended runway centerline). If it is to the left of the airplane symbol this means that you are to the right of the runway centerline. Turn left a couple of degrees to re-intercept the centerline and turn back to the final approach heading 85. Keep the line centered! Now things start getting busier.
At around 6 miles from the airport (pink number on top right), the green dot next to the altimeter will start moving. This is the glide slope indicator and it will tell you how much you need to descend to end up at the beginning of the runway. Once it starts reaching the center, you will start a gentle descent towards the airport: deploy flaps (Q), reduce power to around 1700 RPM and lower the nose a bit, such that you get an indicated airspeed of around 90 knots and a descent rate of around -500 feet per minute. This will keep the glide slope centered. If the green dot is above the center, this means that you are below the glide slope and you need to pitch up and add a little bit of power to re-intercept the glide slope. Try to keep the glide slope and the green arrow centered.
At around 3 miles from the airport, you will see it appear as a green dot on the map display. Keep everything centered! At around 200 feet, reduce power to around 1200 RPM to slow down the airplane to 65 knots while still keeping the green arrow and glide slope centered. At around 50 feet, slowly reduce power to idle and start gently raising the nose. Your goal is to be in a slightly nose high attitude, at 50 knots by the time the altimeter and the distance to the airport both read zero.
Congratulations, you have successfully shot an instrument approach and landed the airplane - welcome to Tiny Municipal Airport!
This description is valid with no wind. If you fly with wind, it will push you away from where you want to fly, so you need to correct your heading a couple of degrees into the wind. Check the wind arrow to see where it is blowing from. Example: if you are on final approach (heading 085) and the wind is blowing from the left (060), it will push you to the right. The localizer will start moving to the left, so you will need to correct into the wind and towards the localizer to a heading of let's say 078 to recenter the localizer.
If this is confusing for you, here is what the entire will more or less look like in the map screen.
lol. I DID spend hours at a friend's on "mission delta". not sure I still could. those were the times ;)
youtube Mission Delta Oric Atmos
awesome work yellowbaron!
I am really impressed by this project, a lot less by the code structure and how you do 3d!!
I have a solid framework to do 3d flightsims (draft below) - happy to colaborate if you want.
@freds72 Thanks for your comment regarding code structure and 3d. These are literally my first lines of code and I'm afraid that this is about as good as it gets ;-) This being said, I am seriously impressed by your projects! If you have some time to spare, I would be more than happy to collaborate and improve this cart.
Thanks, will do. My Twitter handle is @tcueni. I am now following you, so you should be able to send me a DM. Have a good vacation!
For those interested, unminified source code & assets can be downloaded from:
- Mini json parser from Tyler Neylon: lua JSON parser
- trifill (untextured): @p01
- music lifted from "public" MIDI files, simplified and converted with midi2pico.
I really appreciate the amount of documentation and extra-pico8 content and instruction that this game has. I think a lot of game makers should take this level of detail for their releases. It really ups the level of polish a game has and while I'm not into flight sims, I find this aspect of this game (and the presentation itself) to be above and beyond. Kudos and you other developers, take note...this is how a game is really 'complete'. It doesn't stop when the code's done and the game posted. Manuals were/are a thing and really add the immersion of any game!
My God, how long did this take? This is absolutely beautiful. Bravo!
The repo gives you the stats - we spent something like 4/5 months on it (given we both have full time jobs). That said, @yellowbaron had the MFD display ready before (see older versions).
Source: repo commit activity
Shame on me... 1.3 is posted now. Bonus: full screen HUD-mode.
Wow! Awesome job!! I never flown a Cessna, but the flight model ressemble the one from Flight Simulator (played since FS4).
As far as daytime, even though if it'll resemble gray blocks on green, it would be a very welcome addition just for flair. Also a little advice, add pixels in a light grid pattern so we can get a better sense of visual altitude
thanks - flight model is @yellowbaron real life experience dumped as lua code!
dots are displayed (dark blue) - you may have missed them!
daylight version is not planned (even if would be a nice extension)!
@BrightBlackHole I saw that too, but this game is AMAZING!
[Please log in to post a comment]