
Modifying Microsoft Flight Simulator 4 to run on three immersive monitors - ywain
http://www.tinmith.net/wayne/blog/2017/06/immersive-flight-sim-4.htm
======
cyberferret
Nice work! I still have fond memories years ago of the first time I managed to
get twin graphics cards working properly with FS so I could have the
instrumentation on my PC screen and the outside world projected on the wall in
my office in front of me.

 _Sigh_ , I still have drawers full of CDs of Flight Sim expansions etc.
sitting around. Terribly sad that Microsoft canned the entire team and the
project will not move forward any more, after so many decades. I still have
really vivid memory of seeing FS1 run for the first time on an IBM PC
monochromatic green screen - achieving the impossible even before graphic
cards were a thing!

~~~
bitwize
Graphic cards were definitely a thing back then... unless FS1 rendered to ANSI
art?!

~~~
mdorazio
No, they were not. Flight Simulator 1 was released for PC in the early 1980s
(see 1), and even earlier for Apple II. Consumer graphics cards were not
widely adopted until quite a bit later.

[1]
[https://en.wikipedia.org/wiki/History_of_Microsoft_Flight_Si...](https://en.wikipedia.org/wiki/History_of_Microsoft_Flight_Simulator#Flight_Simulator_1.0)

~~~
erik
I'm sure this is just arguing about definitions, but the Color Graphics
Adapter (CGA)[1] was a graphics card. I don't know what else you could call
it.

[1]
[https://en.wikipedia.org/wiki/Color_Graphics_Adapter](https://en.wikipedia.org/wiki/Color_Graphics_Adapter)

~~~
mdorazio
Ok, that's fair. The CGA is technically a graphics card. I personally don't
consider the true graphics card era to have started until VGA became a thing
in the late 1980s.

~~~
rhizome
A simple way to think about it is that IBM-PC monochrome never had addressable
pixels like Apple et al monochrome did.

~~~
pdkl95
IBM's MDA cards didn't support direct pixel addressing, which is one of the
reasons I had a Hercules Graphics Card (original from 1982).

I spent way too much time trying to get various games to work with SIMCGA. Not
only did it cause a massive slowdown (single-digit fps - or worse - was
common) as it copied writes to VGA addresses into Hercules address space, the
conversion from (e.g.) 320x200@16 onto a display that only supported 720x348@1
created usually required dropping/doubling lines at non-integer ratios,
skewing the aspect ratio, and other nasty hacks[1].

I was very happy, years later, when I finally upgrade to a Trident TVGA9000B.

[1] [http://3.bp.blogspot.com/-To4gB6TtJJs/Uwa-
qlr0_rI/AAAAAAAAA9...](http://3.bp.blogspot.com/-To4gB6TtJJs/Uwa-
qlr0_rI/AAAAAAAAA9Y/XjMsZE95l6M/s1600/maniac_001.png)

------
rjmunro
A trick for finding memory locations of some variable is to take several
memory dumps changing everything you can about the game state except the thing
whose location you are looking for, so fly around a bit, change altitude,
change all the control positions, then change the thing you want and take
another memory dump.

Anything that changed in the final dump, but didn't change in any of the
previous dumps is likely to be what you are looking for.

Back in the 90s I used to do this with a tool called "Desktop Hacker" on RISC
OS.
[http://www.doggysoft.co.uk/dh/compr.html](http://www.doggysoft.co.uk/dh/compr.html)

~~~
pjc50
There was also the series of "Action Replay" devices for doing this
automatically in hardware. I still have an ISA one for PC.

~~~
digi_owl
And most emulators worth using also have this built in. Nice way to see the
ending of that NES game you could never finish as a kid, thanks to it being
"Nintendo hard"...

------
DerekL
Cool! I'll have to take a look at his DOSBox debugger.

I've been wanting to do the same thing, but with the 1993 Star Wars: X-Wing
game. Eventually I want to build a cockpit with a wrap-around screen and a
specialized control panel with switches and indicator lights.

A few years ago, I used Cheat Engine on the Windows version of the game. I
figured out the memory locations of some of the variables like shield and
laser levels, but then I moved on to other projects.

It would be great if Disney were to release a modern update or sequel with the
configuration options I need for this. It's good that they did release the
original games on GOG.com.

------
geff82
I probably spent months in front of FS4.... would have loved to have dual
screen back then! It ran almost perfectly on a 286 machine... did so many
transcontinental flights from San Francisco to New York. The graphics were
bad, yet imagination made me feel like I was there.

~~~
digi_owl
I still crank up Jetfighter II in Dosbox when nostalgia grabs me.

To me the less detailed graphics are much more "readable" than the modern GPU
powered stuff.

------
Nition
This is very cool, but the perspective doesn't seem quite right. See the road
as it crosses between monitors[1] in the first video for instance. Of course
he's doing this whole thing with crazy multiple game instances so it's fair
enough that it's not perfect.

Most games (even AAA titles) have even worse problems with multi-monitor
setups, often just staying with a basic rectilinear projection that makes the
siides super stretched out.[2] We could do with better camera projection
support in games in general.

[1] [http://i.imgur.com/RQA43aV.jpg](http://i.imgur.com/RQA43aV.jpg) [2]
[http://i.imgur.com/laY2f4w.jpg](http://i.imgur.com/laY2f4w.jpg)

~~~
tinmith
Actually the projection is correct, but the camera is not exactly at the
center of projection, so it appears that the lines are bent across the monitor
edges. However, if you place your head at the exact center of projection, they
look correct. I'm actually doing three separate projections, instead of just
stretching one image across three displays. The GoPro field of view was not
able to capture everything, so I had to pull it back a bit, and so its not
perfect. A spherical camera would have done a better job here.

~~~
Nition
Ah of course! Thanks for that explanation. It already looked way closer to
correct than most games can manage as well.

Man I'd love to try this. I played a lot of Flight Simulator 5.1 back in the
day, which actually included the whole Flight Simulator 4 world as well - you
could choose to load it in from one of the menus. The untextured terrain was
so much harder to read though!

------
bluedino
I remember you could do this with DOS Doom using the -left and -right
parameters: you just needed three PC's that could run Doom AND a local area
network. Quite expensive in 1993.

~~~
PhasmaFelis
There was also a parameter to use stereophonic sound if your sound card
supported it (mine didn't), so you tell which side monster sounds were coming
from! Mind-blowing at the time.

~~~
cyxxon
Ah...I remember having a Guillemot MaxiSound 64 (no clue what version
exactly...), and it did indeed feature incredible sound like that, but I
wonder if that was later and I mix it up with Quake? Quick Google says the
chip was released in 1994, so maybe, maybe not...

------
trampi
Awesome! Thats the great hacker spirit! May I ask how much time it took you to
accomplish this?

~~~
tinmith
It only took me a few days, maybe 20 hours total? ... I started this back in
January but it took me a while to capture the videos and write it up since
I've been reworking the physical frame to make the monitors fit closer.

1/4 of the time was spent running GDB trying to find the memory locations and
work out the encoding scheme.

1/4 of the time was spent getting familiar with DOSBox, building on Ubuntu,
and syncing the data around via UDP.

1/4 of the time was spent trying to automate the start up so I didn't need to
press a hundred keys manually to configure all the displays each time I
restarted it.

1/4 of the remaining time was capturing nice videos and writing it all up :)

I've done hacks like this before ... back in 2000 I worked on the team that
built ARQuake but we had source code
[http://www.tinmith.net/arquake/](http://www.tinmith.net/arquake/)

~~~
andreiw
Really cool. So if there 3 separate instances running, how do they stay in
sync? Surely these 18 bytes are not everything? So you feed the same input to
all 3 instances at the same emulated time?

~~~
tinmith
The left and right FS4 instances are paused at startup, while the front view
is the master. The FS4 renderer seems happy to have the XYZ HPR values
overwritten behind its back and it refreshes the display constantly with the
latest values. So the gauges don't work on the left/right displays - ideally
I'd get rid of them, but removing the instruments causes the left/right 3D
view to not align with the front display any more.

I imagine with more studying of the memory locations, you could sync over the
instruments too. Or if you really wanted to, you could just grab the video
memory for the instruments on the master and blast that over the network too.
Displays were so small back then that you could easily compress and send this.

------
msielski
Really interesting idea of running separate instances and synchronizing them.
I wonder if this could be done in legacy games to support VR - an instance for
each eye - and each instance's game state and camera position synced except
for slight horizontal offset for left eye vs right eye. Xwing VR!

~~~
throwanem
You'd need to be able to offset the camera position per-instance, which I'm
not sure the old X-Wing games can do. I mostly played Alliance, which I'm
pretty certain cannot; it has several camera options, but I don't recall any
that allow for arbitrary positioning. On the other hand, if you're interacting
directly with the game's memory space rather than just its UI, that may not
actually be an issue.

Assuming you can't reposition a camera, you could try offsetting the ship
position on one of the instances, but then you'd probably have issues with the
simulation states diverging - I suspect a big part of why it can be made to
work with Flight Simulator is that the state of the aircraft itself is more or
less the only thing that's actually _being_ simulated, so you can manipulate
it to a fare-thee-well without affecting anything else. Contrariwise, if TIE
fighter shots hit the ship in your left-eye instance, but miss the ship in
your right-, that'a a much harder problem to solve.

------
aareet
What a wonderful throwback! I still remember the big aircraft manual that came
with my Flight Simulator package and spending so many hours reading through it
just trying to figure out how to get the plane to take off. An excellent game
and a great hack!

------
sundvor
Speaking as someone who used to run triple screen gaming before switching my
middle for a 34" ultrawide, that's truly awesome. Additional kudos for the C64
+ 1541(?) floppy drive photobomb. :)

~~~
tinmith
Haha, glad you noticed the C64 and 1541 :) That was my first computer :)

~~~
rzzzt
FS2 is also available for the C64:
[http://fshistory.simflight.com/fsvault/fs2-c64.htm](http://fshistory.simflight.com/fsvault/fs2-c64.htm)

Another project, perhaps? :)

~~~
tinmith
The C64 had such a tiny amount of memory, you could probably easily sync the
entire state of the machine over the network :)

------
770_Eastern
When it was still "Sublogic" it was even more amazing.

It ran on the TRS-80 with 128x64 resolution:

[http://fshistory.simflight.com/fsh/fs1.htm](http://fshistory.simflight.com/fsh/fs1.htm)

------
phreeza
I played FS4 a lot as a kid, but I don't remember there being a jumbo jet with
the modified cockpit shown in one of the screenshots. Does anyone know what
that is about, was that an add-on?

~~~
ethelward
Yes, it was coming with the “Aircraft and Scenery Designer”.

[http://fshistory.simflight.com/fsvault/msfs4.htm](http://fshistory.simflight.com/fsvault/msfs4.htm)

------
phkahler
Was there a full screen mode that didn't show the instruments? That would be
nice for the side monitors. As much as I played it, I don't remember if that
was an option.

~~~
tinmith
Yes, you can hide the instruments. But then it changes the projection and then
nothing lines up across the displays. You need to hide the instruments on all
or none of the displays.

~~~
throwanem
Perhaps you could add a fourth display below center for the instruments, and
have the three mains just show out-the-cockpit views. The rendering method
you're using seems like it would generalize that far, with the simulation
running on the VM displaying the instrument panel, and the center head synced
the same way the sides are now.

(Don't mind me, though - I'm just letting my old flight-sim bug live
vicariously for a while through your extremely impressive setup...)

~~~
tinmith
Unfortunately I don't have any more space below the center monitor to put
another display :) or it gets in the way of the yoke. I tried to fit a smaller
LCD display in there but it just got in the way and slowed X-Plane 11 down
with an extra display to render.

------
Theodores
Please can someone do this far the BBC Micro version of Elite?

~~~
tinmith
This should be possible with any emulator for old school systems, like 286
with DOS, C64, Atari, etc. All you need is the ability in the game to "look
left" and "look right" somehow, and tune the field of view for correct
projection. If the game can't do that, then it might not be possible.

Also, the hacks in the blog post won't work as well for anything newer than
DOS, like Windows games, since there is an OS in the way and writing over
memory locations gets a lot harder. You would need to approach the problem
differently.

------
larodi
this one time when you realize how a working solution can be cool 30 years
after, even improved and still working to the benefit of humanity. do we need
to rush with all new these paradigm shifts... maybe evolution of computing
needs to take a breath and introspect on all 20th century achievements and
improvements before reinventing the wheel.

------
anjc
Bro there's an option to use up to 6 monitors buried in the preferences, FS4
was used for some production simulators at the time, don't forget.

No I'm only joking, well done.

------
osivertsson
Excellent read! Thanks for posting this to HN.

------
erikb
why not use ms f sim X like the real flight simulators?

~~~
tinmith
I built the set up in January to work with X-Plane 11, which I wrote up here:
[http://www.tinmith.net/wayne/blog/2017/01/immersive-
flight-s...](http://www.tinmith.net/wayne/blog/2017/01/immersive-flight-
simulator.htm)

But I wanted to see if it was possible get the original FS4 working on this,
because it seemed quite impossible.

~~~
erikb
I see. For the challenge. Thanks for the answer!

------
brockvond
that's so badass!

------
0x0
What a great hack!

------
wiz21c
Why bother modifying closed source code when you can just use FlightGear ?

