Jump to content
Sign in to follow this  
toby23

OOM errors and how to avoid them

Recommended Posts

This document is long but if you're interested in why you're suffering from OOM errors and how to avoid them, grab a cuppa something and read on...


 


 


What do you mean I have to reinstall again?


 


Since installing Prepar3d v2.4 and v2.5, I too have been suffering from OOM errors as well as 'random' crashes to desktop. This has resulted in four reinstalls of Prepar3d and two system reinstalls. Not a pleasant way to spend my spare time but I learned a lot doing it, so time well spent.


 


After my most recent reinstall of Prepar3d v2.5, a few weeks ago, I made the decision to only install native add-ons or non-native add-ons that I can install manually, without the Migration tool. I also decided to install them one at a time, instead of all at once, to compare their performance, evaluate their use i.e. 'do i really need this?', as well as optimising them for use in Prepar3d.


 


 


'These go to 11'


 


If more third parties optimised their add-ons and if consumers were more conservative with their settings, a lot less people would be suffering from OOM errors and random crashes.


 


As consumers, we shouldn't have to optimise our payware but as most third party add-on developers focus on looks and not performance, you will never get the best performance you can 'out of the box'. There are a few exceptions where developers provide optimised products that need no further optimising but they are still the minority.


 


The main problem is that most consumers still don't know how to optimise their add-ons and/or want to spend the time doing it. The attitude, 'I paid for it, it should work' prevails, which, as a consumer, I understand, but as someone who wants their sim to look and perform as best as possible, I can't accept.


 


From a developers point of view, I understand the old arguments but they hold no weight with modern graphics cards and recent versions of Prepar3d, there are simply no excuses for not providing optimised products for Prepar3d.


 


I haven't had any OOM errors in Prepar3d v2.5 since optimising my add-ons but I can easily trigger one if I want to. I don't get them any more because I check and optimise every add-on that I purchase and use realistic in-game settings that achieve a compromise between looking great and performing excellently.


 


 


Multum in Parvo


 


It is possible to have a great looking and smooth sim experience without having all the sliders to the right. By optimising my textures, I have seen a huge drop in VAS consumption and a very noticeable boost in performance.


 


All I did was resize oversized textures (reduce from 4096 to 2048 or 1024 pixel width) and save them in the correct format with mipmaps (DXT1 no alpha, DXT5 with alpha). This cost me a lot of time but everything looks and runs much better now, no more shimmering in the cockpit and no more shimmering in external view. It's the difference between 1.3mb and 16mb PER texture in some cases. Multiply that by ten and you can see what's consuming your VAS. The irony is that the optimised version nearly always looks better.


 


Compared to the time you can spend looking for that elusive holy grail tweak, this one actually has visible and immediate results.


 


The mipmap VC panels option in the simulator does not work as you might expect, you will need to optimise the textures yourself if you want the best result. I have this option off.


 


A quick example, I recently bought a brand new GA third party aircraft developed for Prepar3d. After installing it, I loaded it up only to see that the cockpit gauges shimmer, small text is hard to read and straight lines in textures look like marching ants as soon as I move my head using Track IR head tracking. Half an hour later, I had an optimised product, that looks much better and performs much better, with cockpit text and labels that are clear and easy to read, the gauges now look smooth and the external textures load instantly. The best bit, it consumes much less VAS and frees up resources to run the sim more smoothly.


 


 


Plane spotting


 


AI aircraft also consume VAS and can easily cost you 20 fps on top if set up too optimistically. UT2 is, in my opinion, the best looking and the best performing AI package, as long as you mipmap the textures correctly, but unfortunately unsupported for Prepar3d, and the last time I used the Migration Tool to install it, I had to reinstall Prepar3d after files became corrupt. My attempts at a manual install also resulted in a reinstall of Prepar3d. 


 


The only official AI package that I know of that has been developed for Prepar3d, My Traffic 6, fills the skies with all kinds of wonderful aircraft, even the textures are correctly mipmapped, but unfortunately the models are not as optimised as UT2, so unless I am extremely conservative with the AI sliders, I can cause my fps to drop by 20 frames, great for plane-spotting at airports but not that great if I want a smooth flight out of EGLL.


 


 


Unification


 


Everybody's setup is unique and no two systems will perform the same, even with the same hardware. This is why the process of 'unification', as practiced by people like Michael Greenblatt or Nick Needham, is so important. Unification doesn't mean tweaking cfg files or resizing textures, it's understanding how to design a system and then set it up correctly for optimal use. The right hardware, the right software, the right add-ons, the right settings... it takes time to learn and it takes time to set up correctly but once you get it right, you get the best sim experience available to the public. You don't need the latest hardware to run everything well, you just need an optimised system and a fast quad core processor.


 


 


VAS is my currency


 


The FSX/ESP engine was not designed to work with uncompressed textures larger than 1024 pixel width. Even if they load, there is always a price to pay. The currency is VAS. It's not just incorrectly sized textures without mipmaps, high resolution mesh has a price, even third party weather and ATC add-ons can cost you an OOM if not set up correctly. When I met the developer of FEX a few years ago, he showed me FSX running with 4096 pixel width ground textures. Not just at an airport, the whole world was covered in 4096 textures. FSX loaded and ran fine, no signs of an OOM error. This was proof of concept only and ran in a default install of FSX Acceleration but I bet if we had added all of the popular add-ons that we use today, the sim would have crashed too.


 


Some developers have wised up and now offer an extra set of textures for their products, in a 'lower' resolution and are very active in trying to prevent OOM errors. Lower resolution doesn't have to mean it looks worse, default size 1024 textures that are well made look great too. 2048 is the maximum size I allow into my sim.


 


Here's the reality... 4 badly optimised textures can consume around 100mb of VAS. 4 correctly optimised textures consume around 5mb of VAS. 


 


Mipmapped textures might appear to have a larger file size than same dimension non-mipped textures but in reality they ease the load on the CPU/GPU and prevent a kind of shimmering that people often confuse with geometry shimmer and try to combat with high levels of forced anti-aliasing. Ever wonder why when you load an aircraft in the Scenario Editor, it takes time to load the textures and when they appear, they are hard edged and unclear? Mipmaps is why, or rather the lack of.


 


Wouldn't you like it if the textures in your shiny new third party aircraft were clear and readable and smooth? Maybe you don't care but the lack of proper custom anti-aliasing options in Prepar3D make the lack of mipmaps even more painfully obvious.


 


Most Payware add-ons are designed to look amazing, that's why uncompressed over-sized textures are used so often. Why should a developer care? They have made a product that looks great and works fine on a default install of Prepar3d. They have done their job. We are purchasing the right to experience this product, no more, no less, it's like buying a ticket for a ride at the fair. We are therefore responsible for ensuring that these products are optimised.


 


But if we combine an unoptimised aircraft with two unoptimised airports and then add high resolution mesh, terrain and cloud shadows, AI, full cloud cover, thousands of buildings covering huge Ultra LOD areas, hundreds of unoptimised cloud textures, what else could happen but...


 


vas-maxed-out2.png


 


 


 


tl;dr - optimise your add-ons


 



Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Thanks for your advise Toby, I've read with interest your article and would be great if you can tell me(or us) how to optimizing textures like what kind of software you have used!

Paolo

Share this post


Link to post

Or just look for optimise parts=0 in your p3d cfg and change it to optimise parts=1 much easier.

Share this post


Link to post
 
 
 
 

Do you also have FSX installed with UT2?  If so, it's very simple to get UT2 working in P3D.  No migration tool needed.

 

Change C:\FSX\ path to match your own.

1. open %programdata%\Lockheed Martin\Prepar3D v2\simobjects.cfg
2. add this line:

     [Entry.9]
     Path=C:\FSX\SimObjects\UT2 Aircraft
    
3.open \AppData\Roaming\Lockheed Martin\Prepar3D v2\exe.xml Add the following.

<Launch.Addon>
    <Disabled>False</Disabled>
    <ManualLoad>False</ManualLoad>
    <Name>UT2</Name>
    <Path>C:\FSX\Flight One Software\Ultimate Traffic 2\UT2Services.exe</Path>
    <NewConsole>True</NewConsole>
  </Launch.Addon>
 

That's it

Share this post


Link to post

Or just look for optimise parts=0 in your p3d cfg and change it to optimise parts=1 much easier.

Hey,

 

This attempts to optimize multiple parts of a model by combining them into fewer meshes if possible. If you have a complex model that is not already optimized to reduce draw calls etc, this will attempt to do that for you. There is some overhead to this, as it happens at runtime when the model is being loaded and ideally the model would already be optimized before runtime. This only happens for FSX Models, and not older model types.

 

That is what I gathered from a quick look over, hopefully that helps.

 

Thanks,

-Kevin.

 

Prepar3D® Graphics Software Engineer

 

Forkboy2, I do not have FSX installed.


Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Also, I don't think you should mip map 3rd party aircraft textures unless they are AI aircraft.  You can reduce the size of 3rd party aircraft textures, but adding mip maps won't do anything since your view isn't typically far enough away to make use of a mip map.

Share this post


Link to post

Forkboy2, with all respect, believe me when I tell you that you can and you should. It is not just about distance.


Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Please explain.  My understanding is that the lower resolution mips aren't used unless they are viewed from a greater distance.  Not trying to be argumentative, I just want to know if there's something I'm missing as it seems to me that if you add mip maps to a texture that are never used, you would just be increasing the file size of the texture for no reason.

Share this post


Link to post

I thought about trying to draw an image to explain this but even that's not easy so I'll try with words..

 

Imagine you're looking down a cone, the pointed end is in the distance and you're at the open end. Everything that you see in the sim is placed somewhere inside this cone.

 

If you zoom far out to 0.30 and move your point of view around, you will see how distorted the view becomes, that's the cone I mean.

 

Mipmaps, or smaller versions of the original texture, are used, as you correctly pointed out, by the computer to show the textures on models at various positions inside this cone.

 

Your zoom factor can influence the position the computer uses to calculate which level of mipmap to use, as can your seat position, as can a custom camera position.

The computer cannot know how you fly or set up your cameras, this is why you should always use mipmaps, except on moving parts and certain 'special' textures.

 

It is often said that you don't need mipmapped textures for the cockpit, as you are so close to the textures but I have had great success many times optimising cockpit textures too, especially gauges.

If you own the A2A Comanche, you can try this yourself. Backup the gauge texture, then add mipmaps to it and save it. The result is shimmer free smooth and clear gauges.

 

I hope that this helped you better understand how the sim rendering engine works?


Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Good info Toby. ok, so now you've shared how YOU do it, would you also share how TO do it? Are you using freeware or commercial tools?

 

In your reference to the "antsy" panel - I assume you modified all the panel bmp files or did you extract and manipulate all the gauge files also? I have a few payware a/c that I'd like to experiment on.

 

Thanx,

 

Vic


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

Share this post


Link to post
 
 

Thanks Toby, I'll give it a try.

 

Vic, you can use DXTBmp along with a standard image editor.  Be careful not to mess up the alpha layers.  Be ready for some trial and error.  http://www.mwgfx.co.uk/programs/dxtbmp.htm

 

You can also use imagetool if you have the FSX SDX (or you might be able to find it online).  To reduce size of texture with imagetool

1) Create mip-maps if texture doesn't already have them

2) Extract mip-maps, which will extract a separate image for each mip level

3) Open up the smaller mip-map with imagetool

4) Create mip maps

 

There may be other ways/tools to do this.

Share this post


Link to post

The replies went to 11.


- Jens Peter "Penz" Pedersen

Share this post


Link to post

I will see if I can put together a guide on how to do this.

You will need Imagetool, included in every FSX and Prepar3d SDK.

Beneficial but not required is Photoshop and the Nvidia 3d plugins.


Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Would be cool if someone created some bat files for various common addons since Imagetool works with standard bat files.  Sounds too much like work though :)

Share this post


Link to post

This thread is going to be full of much win.   I am in your corner Toby.   I kept OOMing on 2-3 hour flights in the PMDG 737 with all my payware running with normal autogen settings, 1024 textures, 512 texture REX clouds, etc, etc.    and I was like..   Why?  @_@  I am not running things that hardcore!  Why are you still bugging out and crashing with OOM!?  

 

Then... I started looking at my airports with their HD Everything mentality.   I used Texture Optimizer from my Skyrim days to force a rebuild of ALL my payware airports to knock them down to 1024k textures with full MIP MAPS.   I also went into all my PMDG 737 liveries and knocked down their 4k external textures to 2k.

 

The results are dramatic.    Better FPS at large payware airports.  No black loading textures.    No stuttering.    The VAS usage dropped dramatically and I've been able to soar for up to 5 hours so far without a crash and the best part of all... the simulation pretty much looks exactly the same as it did at 2k/4k.     

 

I haven't tried messing with any textures on the VC yet but the bottom line is folks...  4k textures are great for screen capping.  They are NOT great for practical simulation flying.   Get out of the mind set of BIGGER is BETTER.   It is NOT in the simulation environment.

 

EDIT:   For those of you who want an alternative tool to Toby's, Texture Optimizer works great for resizing P3D aircraft and airport textures.   You can grab it off the Skyrim Nexus.  RTFM before you start.   I use it because it performs automagic backups of all your originals and archives them in the folder of your choice so you can restore the originals at anytime should you desire too.  You also won't need Photoshop or any Nvidia plugins for this package.


100454.png
Captain K-Man FlightBlog Channel: https://www.youtube.com/channel/UCulqmz0zmIMuAzJvDAZPkWQ  //  Streaming on YouTube most Wednesdays and Fridays @ 6pm CST

Brian Navy

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...