Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help needed with improving Gauge Graphics and Sim performance

Featured Replies

Hi to all,

 

I've had a go at doing my first Gauge in FSX, this is currently just a pop-up 2-D gauge.

 

I followed a tutorial to get me started.

 

The result is kind of OK, but not there yet, and I still have much to learn.

 

Please assume zero knowledge, as this is the fist time I've coded in XML

 

The project is a Roller-Blind presentation Attitude indicator, 1950's technology, where a roller blind moves a horizon image up and down the face of the instrument to indicate pitch, the roller-blind also rotates to indicate roll, this seemed very suited to XML coding as all I needed was a half black, half white bitmap that slides up and down and rotates.

 

 

First up the graphics:

 

On the left Photoshop, on the right how it appears in FSX:

 

Attitude_Indicator.jpg

 

 

First up where I have shaded in Photoshop, the colors break-up into purples and greens in the sim, spoiling the appearance.

 

Secondly, where I have applied masks to the circular areas and rings or attempted to make parts of the canvas invisible - I get nasty black pixelated areas - I can figure this is because to work the colors have to be exactly 0,0,0 or 1,1,1, and therefore this is causing the rough edge or additional black areas, but what are the work-arounds?

 

I'm saving the Bitmaps in Photoshop as Windows/24bit

 

The next problem is the performance in FSX - the display 'wobbles'. Particularly the roll indicator triangle shown inside the face at the bottom. It jiggles up and down all the time and is very annoying! It should be rock-solid and just swing round the face to indicate the roll angle. The same problem occurs on the 'Roller-blind' (black and white part) at high or low angles of pitch a zenith/nadir star comes into view. It wobbles about all over the place at times, appearing to be jumping backwards and forwards.

 

Here's the code I am using:

 

 

 

<Gauge Name="Attitude_Indicator" Version="1.0">

<Image Name="Attitude_Indicator_Canvas.bmp"/>

 

 

<Element>

<MaskImage Name="Attitude_Indicator_Mask.bmp">

<Axis X="350" Y="350"/>

</MaskImage>

 

<Image Name="Roller_Blind.bmp">

<Axis X="200" Y="524"/>

</Image>

 

<Shift>

<Value Minimum="-90" Maximum="90">(A:Attitude indicator pitch degrees, degrees) /-/</Value>

<Scale Y="3.6"/>

</Shift>

 

<Rotate>

<Value>(A:Attitude indicator bank degrees, radians)</Value>

</Rotate>

 

</Element>

 

 

<Element>

<MaskImage Name="Attitude_Indicator_Mask.bmp">

<Axis X="350" Y="350"/>

</MaskImage>

 

<Image Name="Inner_Roll_Marker.bmp">

<Axis X="351" Y="351"/>

</Image>

 

<Rotate>

<Value>(A:Attitude indicator bank degrees, radians)</Value>

</Rotate>

</Element>

 

<Element>

<Image Name="Pitch_Rings.bmp">

<Axis X="0" Y="0"/>

</Image>

 

</Element>

 

</Gauge>

 

 

Any tips or advice on improving the appearance in FSX and the performance most gratefully received!

 

 

All the best,

 

Gemma

  • Replies 38
  • Views 5.9k
  • Created
  • Last Reply

Top Posters In This Topic

  • Commercial Member

I can't speak for the xml because I'm a C-programmer but I suspect Fr. Bill will be along fairly shortly.

 

FSX converts 24-bit graphics to 16-bit graphics before displaying them. As you've found, this can sometimes create visually nasty results, particularly with an area that has a gentle colour gradient. Actually saving as 16-bit sometimes helps but I've found it's hit-and-miss most of the time.

 

You can't do anything about the jaggies for transparent and mask colours - that's just the way FS works. You can disguise them but it really depends on what is behind the transparency or the mask. If this was a purely rotational gauge, then by extending the rotating display bitmap to include part of the grey ring and resizing the mask to suit, you'd hide the jaggies because you're moving grey-on-grey. However, because your bitmap moves in the O-direction too, it comes down to having to pick away at the pixels until the grey overlay is as visually acceptable as possible and then having to live with it.

 

The azimuth rings are far harder to deal with. Rather than have to deal with the entire ring in one go, select a 90 degree slice and keep removing/replacing pixels until that slice is acceptable and then flip and rotate to get the other three sections. A 45 degree slice doesn't seem to respond so well after it's been transformed.

 

The real problem is that there is no alpha channel in FS, so there's no partially transparent pixels. They're either on or off.

 

-Dai

One possibility to reduce the jumping would be to add a <Lag> section to those elements. This slows down their response and reduces the jitters.

 

Hope this helps,

  • Moderator

From Photoshop, try converting your artwork to "Indexed Color Mode" (make sure you save your work as a native .psd file of course!), and save as 8-bit .BMP in the gauge's folder. This should help reduce the gradient banding effect you're seeing, as well as some of the excessive stair-stepping artifacts.

 

Your XML script appears to be fine.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

Many hanks for all the advice guys, to be totally honest though I can't get much improvement on this gauge but I'll keep all the advice in mind. The banding still showed up whatever I tried, I guess beginners luck I picked colors FSX didn't like :rolleyes: , so I just painted over without the shading. I guess in all I started out with a project that would show up lots of problems, mainly because I didn't know any better! I've learnt tons though already and that is the main thing.

 

I wondered though could this make a good project for a 3D gauge? Not even sure how that could work with the display being a roller-blind design.

 

I'm thinking along the lines that the white/black against the bevel ring is causing most of the problems, I can get the bevel ring looking great for one color or the other, but not for both at the same time. It would be slightly set back in the real instrument so perhaps rather than spend too much time trying to improve on this 2D version, should I just accept the limitation and start to thinking 3D?

  • Author

Can't you make gauges for the virtual cockpit which use actual modeled parts? This is what I meant by 3D.

 

As it is, with this gauge I'm sort of stuck where the bevel ring meets the white and black. If the bevel ring was an actual 3 dimensional part, then it could mask the jaggies by sitting slightly further out than the black and white display. (That probably still makes no sense lol).

 

I'm a long way off being able to do that, just wondering though if it is a future possibility so I can get on with learning some more xml at this stage, rather than spending ages trying to improve the appearance of this pop-up gauge. It pretty much seems from what everyone has said it's just the way it is with gauges, rather than anything I can do much to improve.

  • Moderator

In short, no...

 

We cannot create 3d gauges for FSX unless they are part of the complete interior (virtual cockpit) model (.mdl) file.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

Oh I see, so it wouldn't be possible for example to make a 3d gauge identical in size to an existing one and then fit it into an existing FSX virtual cockpit?

 

I'm really only just learning what can and can't be done.

 

In all though my first gauge is really useful, I find it a better display for accurate flying. I'm keen also to do a combined TACAN/ILS/Nav unit from the same era too as a complimentary pop-up gauge. I think it will be much easier now I've had help to understanding the limitations of the pop-up gauges to get a reasonable result.

  • Commercial Member

Gemma,

 

 

Can that gauge really go to 90/90 in pitch? If it can't you might want to change that in your min/max for the pitch shift.

 

 

Otherwise if it is still being problematic rolling around then you may want to add a delay to the shift. Below is an example:

 

<Element>
<Position X="0" Y="5"/>
<MaskImage Name="ADI-M1.bmp">
<Axis X="60.5" Y="49.5"/>
</MaskImage>
<Image Bright="No" Name="ADI-Pitch.bmp">
<Axis X="60.5" Y="51"/>
</Image>
<Shift>
<Scale Y="1.15"/>
<Value Minimum="-30" Maximum="30">(A:ATTITUDE INDICATOR PITCH DEGREES,degrees) /-/</Value>[/color]
<Delay DegreesPerSecond="40"/>[/color]
</Shift>
<Rotate>
<Value>(A:ATTITUDE INDICATOR BANK DEGREES,radians)</Value>
</Rotate>
</Element>

 

This may help to smooth out the gauge movements. Otherwise you may also want to learn how to create images with alpha channels. This will allow you to create an alpha overlay for the purpose of adding shadows and reflections on the gauge such as a glass reflection and the shadows you wish and will not be received as badly by the simulator.

 

The best and only working tutorial I have found for creating alpha images for the simulator is by Fr. Bill and here it is.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Moderator

I wish now that I'd archived those images from Susan's blog so that they would still appear. Ah, the lessons one learns over the years... :blush:

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

Gemma,

 

 

Can that gauge really go to 90/90 in pitch? If it can't you might want to change that in your min/max for the pitch shift.

 

 

Otherwise if it is still being problematic rolling around then you may want to add a delay to the shift. Below is an example:

 

<Element>
<Position X="0" Y="5"/>
<MaskImage Name="ADI-M1.bmp">
<Axis X="60.5" Y="49.5"/>
</MaskImage>
<Image Bright="No" Name="ADI-Pitch.bmp">
<Axis X="60.5" Y="51"/>
</Image>
<Shift>
<Scale Y="1.15"/>
<Value Minimum="-30" Maximum="30">(A:ATTITUDE INDICATOR PITCH DEGREES,degrees) /-/</Value>[/color]
<Delay DegreesPerSecond="40"/>[/color]
</Shift>
<Rotate>
<Value>(A:ATTITUDE INDICATOR BANK DEGREES,radians)</Value>
</Rotate>
</Element>

 

This may help to smooth out the gauge movements. Otherwise you may also want to learn how to create images with alpha channels. This will allow you to create an alpha overlay for the purpose of adding shadows and reflections on the gauge such as a glass reflection and the shadows you wish and will not be received as badly by the simulator.

 

The best and only working tutorial I have found for creating alpha images for the simulator is by Fr. Bill and here it is.

 

I didn't know I could use alpha channels for a gauge, I will look through the tutorial. I can use alpha already as have done a few aircraft repaints so thanks for pointing me in the right direction. (sorry bad gauge pun!).

 

The gauge does go 90 to -90 in pitch, it is not a gyro gauge, but a roller-blind design (taking it's information from a master gyro electronically), so it could do this for real. The aircraft also had the performance to do a 90 degree climb. It's also calibrated, each 10 degree ring is an accurate 10 degrees pitch of the model, right up to 90 degrees. (roll is accurate too).

 

I've now found a video on youtube of the real gauge in action and it is vary similar, on reaching 90 degree positive or negative pitch, as soon as it passes it, the whole display swings round and points at the nearest horizon, fortunately that's exactly what it does in FSX too. (Which was just lucky really as I had little idea what I was doing at the time, but FSX expects this and handles the display accordingly).

 

I'll try the delay, though I have since found size of the gauge bitmaps was playing a part. I have reduced the size of the bitmaps by half and that has made the display much steadier, if not yet quite perfect. If the delay improves it further I think it will be very acceptable.

 

It's really those rings and edge of the bezel I need to go back over before moving on now. I think some of the issues is Photoshop anti-aliasing, it wants to put in other colors than exact 0,0,0, and 1,1,1, and this is where I need to work to improve the jaggies I think. I also added a black outline for the rings, this wasn't needed, it appears that light objects on light backgrounds already have a black outlined edge in the finished gauges.

 

I've got some time tomorrow, so I'll go over all that has been said and see just how much I can improve on the appearance :wink:

  • Author

I decided to stay up half the night and give the Alpha a try (I have a cold and could not get to sleep any way!)

 

and I have progress!

 

Attitude_Indicator_02.jpg

 

 

I've still a way to go, the window is too gray, but when it is transparent enough, the pitch rings are so subtle to be almost invisible (but even that is handy to know that it can be done, they currently form part of the bitmap that carries the Alpha channel), so a bit of work there to get the balance between the two just right, but much more what I had in mind so many many thanks Engjell, I'm totally indebted to you for the help.

 

The jaggies I've masked by shadow (so I've no need to worry about them anymore) a little more work tweaking things tomorrow should see me complete this gauge looking just how I wanted it. :smile:

 

 

Learning curve in past few days - very steep, satisfaction level very high and I'm already looking forward to adding another element to this gauge and then starting the next (much more complicated) one. B)

 

So thanks to all for the help so far, I'll post up a vid of the finished gauge in action when I'm 100% happy with it.

  • Commercial Member

I decided to stay up half the night and give the Alpha a try (I have a cold and could not get to sleep any way!)....

 

Welcome to the secondary addiction of aviation; gauge programing. I believe we have started something here that you will never be able to control and yet will love it for that. I'm glad to hear that you've made progress. Any credit for such help is due principally to Fr. Bill and Jan from whom I've learned just about everything I know.

 

Looking forward to seeing more of your work.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Hi,

 

Do you have a picture of the real thing?

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.