Matthieu LABAN
.NET, My Life, Flight Simulation and Real Flight...

 
About Me :
25 Years old developer and aviation
enthusiast living in Santa Clara, California.
View Matthieu Laban's profile on LinkedIn 
Contact me at :
mlaban at gmail dot com


Photo & Video Galleries:
- Gallery List
- Flight Videos
Resume :
e-mail me to get my latest résumé
Pixel Fog and Flight Simulator Project Update 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

Cessna 421

I’ve just released an update of the flight simulator project. This update has the following changes included:

Changes in version 1.0.2036 (2005-07-29) :
- Fixed another bug with axis assignments (I hope it'll work this time :-/)
- New physics routine, it's now frame rate independent!
- New Pixel Fog (requires shader model 2.0) (Switches to vertex fog for 1.1 cards)
- Changed Grip of wheels on the ground
- Added a wind configuration window
- Added a visibility configuration window

A couple of comments on this list

Winds:
You can now practice your cross-winds landings with the Flight Simulator Project ! A new tab has been added in the Weather window. It adds the ability to set wind direction and speed.
The turbulences are ready behind the scenes, but I haven’t set any public way of setting them yet. This should come up soon.

Visibility Settings:
During my first shader tests I posted screenshots of a fog shader that could show haze at low altitudes. I have now exposed public values to set the general visibility and a factor of how much fog you want to see at low altitude.

This actually uncovered some problems due to the way the fog is implemented by default in DirectX I think. When objects are not tessellated enough, the fogging becomes inaccurate.
I then implemented a pixel fog shader. This shader computes the fog values to the pixel and not to the vertex, making it more precise and realistic without adding new faces to objects.
Comparing these two pictures shows the difference between the two techniques, especially on the runway and ground :

[Fog] Vertex Fog 
Vertex Fog
[Fog] Pixel Fog
Pixel Fog

Frame Rate Independent Physics:
Up until today, the physics were updated at the same rate as the graphics. To make this work in most cases, I had to lock my frame rate to 60fps. That was becoming harder and harder as I added new things to the program.
This won’t be an issue anymore. The physics are now updated at a fixed rate, but no longer frame rate dependent.
I had tried to do this before but I never got good results due to a simple mistake I did in the early days of the simulator. This error apparently messed up the frame time calculations making the whole thing unstable … It’s fixed now, and I’m happy about that !

Some screenshots to complete this post :

[Fog] Short Final [Fog] Low approach with fog  [Fog] Pixel fog again 
[Fog] Pixel Fog on final [Fog] Low layer of fog 

The update is downloadable here :
http://matt-online.homeip.net/flightsimulatorbeta.aspx

Happy Landings

Flight Simulator Project - Public Beta 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

[Cessna 421] Parking

The Flight Simulator Project is now available for download to everyone.

The closed beta test has been of great help to get rid of the most important bugs. Some still remain but most of PC configurations should be able to run the simulator.
I would like to thank Stefan, Darren, John, Mike, Antony, Raoul, and all those who helped me locate many bugs in the simulator.

If you are interested, click this
link to go to the download page.
Note that this Simulator requires at least a video card that supports shader model 1.1. (2.0 prefered but not mandatory).

Happy Landings !

Garmin GPSMap 96c - Short Review 

[Update 2008-04-13: I posted a "3 years after" review of the device here]

Last Friday was my first flight since I got myself a Garmin GPSMap 96C. This device is a handheld GPS receiver that can operate in Aviation, Automotive and Marine mode.
Complete specifications can be found here :
http://www.garmin.com/products/gpsmap96c/

During my quest for the best GPS I could afford, I was unable to find any review of this device anywhere on the internet. That’s the reason why I’ll write a quick review of it here. It’ll only cover the aviation part.

The Screen:
One of the first things that struck me with this GPS is the screen. I was afraid the display dimensions would be too small to read anything on it (160x240-pixel, 256-color), but the people at Garmin really did a great job to make everything clear and crisp.
It is very readable, even under direct sunlight. I kept the GPS on my laps during the whole flight and I never had any problem reading the information on the screen in any of the display modes.
The backlight is quite good as well, but I didn’t use it during this flight, it was on only while learning how to use the GPS at home.

Learning:
Once you figure out the way the menus work, you can do anything in the 96c without any problem. The owner’s manual is good, although some parts lack explanations.

Flight Planning:
I thought planning my flight on a device with 8 buttons and a directional pad would be a pain, but it was not !
The flight planner can create routes from a lookup by name, or a visual edition directly on the map. I programmed my flight in the GPS in a couple of minutes from the route I had planned on my ‘real chart’ of the area.
The flight was in a PA-28 from Lognes (LFPL) to St Cyr L’Ecole (LFPZ).

 

During the Flight:
During the flight, I didn’t have any problem with the GPS whatsoever. It worked like a charm with no signal loss, even when it was sitting on my laps. The big numbers on the screen helped my read the information quickly, allowing me to concentrate on the vital flight stuff.

I found this very reinsuring compared to the times when I didn’t have a GPS on board with me. Now instead of being sure of where, I’m *really* sure of where I am, and that counts when you fly in the vicinity of the weirdly shaped Paris Class A airspaces.

The waypoint switch was seamless. When passing near a waypoint, the GPS automatically switched to the next waypoint in the flight plan.
The page I used the most during the flight was the Moving Map Page with 4 data fields, including the ETE to next, Bearing, the Distance to next and the Time to next. Of course, this was combined with the 1/250’000 map of the region on my laps as well.

Battery Life:
So far, I’m impressed! Almost 15 hours of use (okay okay, I play with it a lot, and I use it when I’m in a car as well …) and most of these 15 hours were spent with backlight on. The battery indicator now tells me 2 out of 4 bars. It really beats the PDA-GPS with their 2 hours top battery life.


 

Log Book:
I was surprised after the two flights to see that both of them had been logged in the logbook section of the GPS.

Tracks:
The track feature of the GPS is stunning. After the flight, I could review my flight path, and get the time at each position on the track. In this case, it couldn’t be a succession of straight lines, I had to avoid a lot of cities along the way. (maximum altitude was 1500ftQNH)

Reception:
No problem at all during the flight, I got a correct signal all the way to St Cyr and back.

 

Well, that’s all I can write for now, I’ll certainly post an update if I feel like some feature of the 96C is worth writing about.

Happy Landings !

Environment.TickCount hidden bug with Flight Simulator Project 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

Last monday, after two days away, I decided it was time to release a new beta version.
Just to be certain I wasn't packing a broken version, I fired up the flight simulator to check if it was still working ...
To my big surprise, it crashed! I got a NullReferenceException that i was not getting on my other computer. The exception was thrown on a portion of code similar to this one :

At Load time :
_nextUpdateCameraTime = 0;

At Runtime :
if (_nextUpdateCameraTime < Environment.TickCount)
{
    // This function will place the camera in front of the aircraft, on a fixed position, and looking at the aircraft. 
    _camera.UpdateCameraPosition()
    _nextUpdateCameraTime = Environment.TickCount + _cameraUpdateInterval;
}

// This function will update only the target of the camera, not the position
_camera.Update();

I had a null reference exception in _camera.DoSomething() because UpdateCameraPosition() had never been called.
Normally, since _nextUpdateCameraTime is set to 0 during loading, the condition "_nextUpdateCameraTime < Environment.TickCount" should have been be true on first execution and UpdateCameraPosition() should have been called, but it wasn't.
Why ?
-> Environment.TickCount was returning a negative value.
After reading the documentation, I quickly found out that this property can return a number from Int32.MinValue to Int32.MaxValue cycling every 24.9 days. This is because this property returns an signed integer representing the number of milliseconds elapsed since computer startup. My computer was up for 26 days at this time ...
If I recall correctly, this was causing problems on older versions of windows ...

Anyways, I know that the use of this function is very questionnable, but I want to note for the record that I didn't want extra precision for portions of code where I used this, so I figured I could use ticks instead of a high precision timer. This problem is fixed now and i'm using a high precision timer.

I'm glad I found this bug by myself, it would have been a pain to debug this on someone else's computer ...

Flight Simulator Project - Update 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

[Cessna 421] Parking
Cessna 421C Golden Eagle at KSNA

Beta Testing :
It is still running, and I’m always looking for new people to test the simulator. This testing helped a lot on a wide variety of problems. The biggest issue I’ve had to fix was with the joysticks. A few days after the beta testing started, I received bug reports from people who were having problems with their joystick configuration. Apparently, the axes were mis-configured. I tried to fix this by implementing a settings window where you could chose wich joystick axis to assign to each simulator axis.
The problem didn’t go away on some people’s configuration. It turned out they were using joysticks that were made of different physical entities, therefore, different devices.
Since I was only picking out the first device I found, there was simply no way they would have been able to configure the game properly. Only their USB Pedals were found in most cases. I then made a couple modifications to the configuration window, and this problem went away.
Below is a screenshot of the configuration window, with the axis and device listing.

[Joystick Configuration]
Click to enlarge

The New Aircrafts :
Two new aircraft joined the fleet. A Piper J3 Cub, and a Cessna 421C Golden Eagle.

The Piper J3 Cub :
Find everything about this airplane here :
http://www.airliners.net/info/stats.main?id=298

To be honest, I had never planned to add this aircraft to the simulator, but an e-mail from a beta tester kinda challenged me to make a tail dragger like this one. It was interesting for two reasons :

  • It has really different flight characteristics than the aircrafts I’ve designed so far.
  • It’s a tail dragger, so the ground handling is different, and I didn’t know if the simulator was able to handle such a thing.

It turns out it is able to handle it :-) All I had to do was to move the front gear to the back of the airplane and inverse its rotation angle and it was working!

This aircraft was pretty easy to create; it doesn’t have complicated shapes, a real pleasure to design!

Enough words, screenshots:

[Piper Cub] [Piper Cub] [Piper Cub] 
[Piper Cub]  [Piper Cub] [Piper Cub]

The Cessna 421C Golden Eagle:
This airplane is one of my favorites. I’ve been wanting to do it in the sim from the very beginning. It’s a twin engine pressurized airplane from the Cessna Corporation.
Read more about it here :
http://www.airliners.net/info/stats.main?id=154

After completing the J3, I thought modeling an aircraft had become a piece of cake for me… well, no it hadn’t … It took me two whole days to come up with what I have now. What’s great is that I didn’t have to change anything to the simulator; it’s nice when it goes well like that :)

[Cessna 421] Retracting Gears  [Cessna 421] Take Off [Cessna 421] Test Flight 
[Cessna 421] Final [Cessna 421] Parking [Cessna 421] Rolling [Cessna 421] Parking

The Instrument Panel:
You might have noticed that on the Cessna 421 screenshots, there is an attitude indicator on the lower left hand of the screen. I’ve reworked a little bit on the instrument panel. This time, the instruments can be viewed in 3D.
For that, I use dynamic textures that I fill every time the instruments are updated. The gauges are drawn in individual images using GDI+, and these image are copied in textures, then displayed on the screen. This technique might not be the best, but it sounds alright so far.

That’s all for today. By the way, I’m still looking for people to test the game ;-)

Happy Landings