- Home /
Flight Sim frame rate drops severely at particular altitude range
Hi, I have a flight simulator and am experiencing a severe drop in the FPS (from 50-60fps down to single figures - I've seen around 1.5fps) when my aircraft goes through a particular altitude range. Below this range everything is fine, above this range everything is fine.
It happens around a height of about 1600 units but there is nothing significant about this height in the game logic - no extra scripts are run, nothing special happens in any of the ones running.
I thought it might be related to the fogging effect as it seems to coincide with the terrain below fogging out but I've turned fogging off and it makes no difference.
I've noticed spikes in the hard-disk activity during the fps dips so I'm guessing it could be texture related but I'm not sure what to tweak. Something to do with the mipmapping for the terrain?
Any help would be appreciated.
I can't specifically point to anything, but I've heard other people who have had issues with 1000+ unit distances. If you want to get around this, you could possibly scale down by 10.
Floating point issues? Doesn't sound like it, but it's something to check.
$$anonymous$$ight be that's when the physics subsystem has to restructure it's broad-phase collision structures.
Thanks guys, Flaviusxvii's suggestion sounds possible, especially as after further checks it appears to be independent of the rendering (see my response to $$anonymous$$$$anonymous$$$$anonymous$$xJOEY1). Is this something that can be tweaked or is it Unity's internal workings? Or is there some way of confir$$anonymous$$g that this is definitely what is happening?
Bored$$anonymous$$ormon, I'm pretty sure I'm O$$anonymous$$ floating point-wise.
static_cast, If I rescale I'm guessing I need to scale down gravity and all forces in the game too. I'll wait before I attempt this as a last resort!
Flaviusxvii, not sure if you'll see this but your comment on the physics subsystem prompted me to try something. It's definitely nothing to do with the rendering. It's also not specific to the Y-axis, I just happened to notice it on that axis. It happens in any direction when the aircraft is a particular distance from the terrain. As a test I decided to disable the terrain collider while the FPS drop is occurring and... smooth as anything again. I'll probably use some scripting to disable the terrain collider at a particular range. Thanks for your suggestion.
Answer by KMKxJOEY1 · Nov 23, 2014 at 01:22 AM
If your camera is angled down, it makes sense that you would get a frame drop when you go up (more terrain exposed). I've seen some complex ways around this using terrain splats (mainly from this year's Unite) but for a quick workaround you could have 2 cameras that view only specific layers. One camera can view the plane, while another the terrain. Just add a simple code to clear the camera or disable it when your altitude gets to high.
Hi $$anonymous$$$$anonymous$$$$anonymous$$xJOEY1, Thanks but I'm not sure this is the cause. $$anonymous$$y terrain is actually an island and this effect occurs when most of it is already visible at this height (it's quite a small island at the moment). I also just checked and noticed that the effect happens even when the camera is fixed looking horizontally at the aircraft with little or none of the terrain visible. It even happens when the camera is in-cockpit looking directly up, i.e. at nothing but the skybox.
Answer by Vetpetmon · Nov 30, 2014 at 07:26 AM
I totally know the answer to your FPS problem. Frame rate drops depending on these occasions:
To many objects or you have used terrain
Graphics quality is too high
you did not set the expected frame rate code:
function Awake () {
// Make the game run as fast as possible in Windows
Application.targetFrameRate = 300;
}
note: you can set the frame rate to any number if you want.
computer is hot and needs cooling ASAP
need bigger RAM
Or, you computer is just slow
These answers are %100 tested and works. This may help you get the speed of the game you want it to go. Or it might just kill you computer(Overwork it).
Your answer
![](https://koobas.hobune.stream/wayback/20220613172219im_/https://answers.unity.com/themes/thub/images/avi.jpg)