Kind of getting somewhere







I finally built a physics model that was mostly acceptable, and then added in a bunch of other features. However as I started adding LUTs (lookup tables, what Microsoft's Flight Simulator used from ~1981-2019) things increasingly got off the rails. That said this has been a great learning opportunity and I think I nailed it as far as prototypes go.
Next step is to break out the flight model, graphics, event loop into separate modules so they don't overlap so much in the spaghetti code.
The other night I came up with a really cool way to procedurally generate airports with up to three runways based on real world data. It's not 100% accurate but if you want to land/takeoff at 10R/28L, 1R/19L at SFO you can do that now. Or any of 100 largest airports in the vicinity, and a handful of international destinations.
I kind of painted myself into the corner with the flight model, but I am really happy with the way everything else turned out. I think protecting the flight model in it's own module with unit tests will help prevent speghetti code, only time will tell. This also gives me an opportunity to design better data bus for the systems and computers to use. I don't have enough access to enough info to go full study sim, but of what there is, the Concorde is phenomenally well publicly documented so I've got a number of LUTs built up at this point. I was remarkably surprised at how easy getting the "autopilot" setup was, I was expecting it to be super fiddly but in the end was not.
One thing I really want to nail is the center of lift (CoL) vs center of gravity (CoG). The Concorde really struggled with this, it needed the COG far enough back at takeoff to get off the runway, but then wanted to shift it over the COL after initial climb phase. Being a moderately skinny aircraft with a delta wing the fuel tanks are scattered about and modifying the COG as fuel burn happens is a big part of flying this aircraft. Pretty much always you have a fuel pump running in the background, pumping fuel to one of the trim tanks.
I'm writing this from scratch using rust so no outside game engine like unity or godot or whatever.
You can fly intercontinental no problem, my initial use case was SFO to HND (Tokyo) which is both intercontinental (5100 nm), but also crosses the international date line, and is moderately high latitude. NY-London, Paris-Dakar-Rio DeJaniro etc are all possible. There is a bug that once you go north of 5N you're kind of stuck there in the bermuda triangle but I looked in to this and there's no commercial flights at 5N and in fact no airports at 5N so this is a later me problem to solve, if ever. Attached are some attempts at resolving navigation very close to the north pole, you can see once it gets up there it's trapped above 5N and just kind of bounces around. The one that looks like an apple peeler diagram is a plot from a simulated flight from SFO at 265 deg W for 40,000km at 10,000 ft (which intersects HND)
Next steps:
Validate physics model, variablize plane profile (I think I'm going to target Piper Cherokee, 737, Concorde for now, focused on Concorde), modularize flight model, add tests. Move graphics into module, write tests. Move event loop into module, write tests. Add joystick support. Integrate procedurally generated airport logic, add sqllite db of airports/airport data
In general I'm really happy with my initial prototype, as they say, fail fast. I have accomplished everything I wanted to do with this version. Time to put this on the shelf and start over with a more extensible framework as I generally know where I want to head.
Wish list:
VATSIM support
Orbital mechanics support (once you have full WGS 84 support, this is surprisingly easy) and maybe a crude space shuttle reentry scenario lol or at least throw some starlink satelites and the ISS up there for good measure.
CONCORDE.EXE
mach capable lo-fi graphics, full physics flight simulator
Status | Prototype |
Author | Hadlock |
Genre | Simulation |
Tags | Flight |
Leave a comment
Log in with itch.io to leave a comment.