Flight simulator

I’ve been playing around with some rendering techniques and made this simple demo:

FlightSim.hex (35.9 KB)

Code is here:

It’s completely broken in the embedded emulator for some reason :cry:
It seems to work in the standalone version of ProjectABE :thinking:

What it should look like:

Works in Firefox, just broken in Chrome apparently?


Really interesting, I wonder how much is left to be able to make a game using this.


Amazing, what rendering technique is that please? Mode 7?

Are you planning to share this engine? :slight_smile:

The code is currently a bit of a mess but I can clean it up and share it if there is interest. There is plenty of RAM / program memory left for gameplay but not many CPU cycles.

I guess that the rendering technique is essentially ray tracing? For each pixel it casts a ray which either hits the ground plane (when y < 0) or the cloud plane (when y > 0) and then based on the intersection location it looks up into a texture to see what colour it should be


Really very nice, I’m surprised full raycasting runs so fast, even though it’s only quarter of the screen resolution (if I noticed correctly). I’d love to see the code, even if messy. Maybe it could be optimized to run in full resolution.

Works for me. Do you get an error?

No error reported but the rendering is all messed up:

This is using desktop Chrome Version 76.0.3809.100 (Official Build) (64-bit)

Appears to work ok in mobile Chrome

1 Like

I’ve uploaded the code to github here:

An updated demo, now running at ~30FPS:
FlightSim.ino.hex (47.4 KB)

There are several different render modes which can be cycled through by pressing B:

  • Quarter resolution with interpolation hack (default)
  • Quarter resolution
  • Half resolution
  • Full resolution

One thing that I’ve noticed is that due to the dithering pattern, it isn’t really noticeable to run at any higher than quarter resolution! (Other than causing it to be slower to render)


This reminds me a lot of MS Flight simulator that I had on my 80286 in yellow and black :grinning:


13 posts were split to a new topic: Trouble uploading on Mac

Dude I missed this too, you are amazing.

1 Like

Am I the only guy who can’t figure out if I’m pointing at the sky or the ground?

That looks really cool! Reminds me of MS flight simulator 1.0 (which I was also playing on a black/green dithered screen, on an 8086@4.7MHz). But your demo looks 10x smoother!

1 Like

@jhhoward - say, I provide you with sprites for bi-planes, so HUD UI, and a couple nice menus/splash: you’d be up to turn this into a WWI dogfight simulator?

1 Like

It would be awesome to make it into a full game but I don’t have the time to spare at the moment!

Fair enough - just ping me when/if you do! It won’t take me too long.

1 Like

the 1 button that changes the rendering method at first didnt seem to do much but refresh the screen with a wipe effect from left to right. but i noticed the standard rendering method glitches a little when you do hard turns. hit the button 1 time and it goes away and you can do hard turns without the sky bending into the side panels on the opposite side your turning.

also it looks like in order to add thruster control you have to give it a new coordinate for it to lerp to thats farther ahead of the screen.

Were you playing on actual hardware or in the emulator? The web emulator has some accuracy problems with this demo

i made this thing thats like idk a arduboy advance .your flight sim is great but i had to change the default render type it starts out with in the ino so it wouldnt do that. the fail condition of the player intersecting with the ground isnt in play with that render mode so i have to port it over to it.

also i have been poking around in the code since then and raising the cloud height changes the way they look but not the plane in the sky that stops you. i guess thats just for rendering and the actual stage boundaries are defined with the fancy math

That is incredible. Great work James!!

1 Like