Board index FlightGear Support Graphics

Lag Issue when looking around or changing view etc.

Graphics issues like: bad framerates, weird colors, OpenGL errors etc. Bad graphics ar usually the result of bad graphics cards or drivers.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).
- please upload a screenshot of the problem.

If you experience FlightGear crashes, please report a bug using the issue tracker (can be also used for feature requests).
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article. If you are seeing corrupted/broken textures, please see this article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Lag Issue when looking around or changing view etc.

Postby BattleVenom » Sun Mar 08, 2020 10:46 pm

Hello, I installed flightgear yesterday, and have been doing some flying, I have been getting the issue of when I look around in the cockpit, or anywhere else, I get a lag spike, like in some other user posts.

My computer specs:
CPU: Intel i5-6200U @ 2.30GHz
Memory/RAM: 16 GB DDR3
GPU: Intel HD Graphics 520

I currently have the graphics on the game on the lowest I can.

Can anyone help me fix this? I am really looking forward to playing this game, and enjoying it without lagging.
BattleVenom
 
Posts: 4
Joined: Sun Mar 08, 2020 10:16 pm

Re: Lag Issue when looking around or changing view etc.

Postby Lincoln » Mon Mar 09, 2020 7:00 am

What jet are you using? For example using the advanced 777 over the FGaddon A319 makes alot of difference
Currently flying the 737-800YV / MD-11-GE / 747-400

GE90-115B for life!

Follow me to the sun on SXS98X!

LincolnWorks discord!
Lincoln
 
Posts: 126
Joined: Mon Jan 20, 2020 5:34 pm
Location: In the sky ofcourse or in The Netherlands
Callsign: ATC_Lcn/RM01/SXS98X

Re: Lag Issue when looking around or changing view etc.

Postby BattleVenom » Mon Mar 09, 2020 11:17 pm

Hello, even using the stock cessna, it lags. I found out though that when turning off the AI, the lag is lowered.
BattleVenom
 
Posts: 4
Joined: Sun Mar 08, 2020 10:16 pm

Re: Lag Issue when looking around or changing view etc.

Postby wkitty42 » Tue Mar 10, 2020 5:05 pm

that makes sense since there's thousands of AI flights... the sim has to load all of them to be able to figure out where they are so it can display them on the map when they are within range as well as taking off and landing them...

FWIW: there are 282740 callsigns used in the current AI traffic... of those, there are 69151 that are unique... so yeah, there's a lot of AI flights to work with ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6494
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Lag Issue when looking around or changing view etc.

Postby V12 » Wed Mar 11, 2020 11:50 am

... and this is good reason to run traffic manager in thread other than default.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1817
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Lag Issue when looking around or changing view etc.

Postby Hooray » Wed Mar 11, 2020 12:17 pm

V12 wrote in Wed Mar 11, 2020 11:50 am:... and this is good reason to run traffic manager in thread other than default.


In theory, that's a very good idea -in practice, the code in question was not structured/designed with this in mind, so that running parts of it outside the main loop would cause issues, because two threads would be trying to access a resource that isn't properly synchronized/serialized.

For the time being, the only thing that seems to run outside the main loop is indeed the schedule parser itself: https://sourceforge.net/p/flightgear/fl ... gr.cxx#l87

This is basically the part that loads XML files from disk to populate C++ data structures.

This uses a helper class to run code outside the main loop, called "SGThread": http://simgear.sourceforge.net/doxygen/ ... hread.html

Depending on what the algorithm currently looks like, it might be possible to parallelize some parts of it using OpenMP and pre-processor macros, but other than that, things won't be as trivial I am afraid.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: Lag Issue when looking around or changing view etc.

Postby V12 » Wed Mar 11, 2020 9:54 pm

FG can visualize aircraft driven by external application via UDP. That app will read AI flightplans for aircrafts, calculate aircrafts new position by simple FDM and send this positions into FG via UDP. FG only render that aircraft.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1817
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Lag Issue when looking around or changing view etc.

Postby Hooray » Thu Mar 12, 2020 8:40 am

V12 wrote in Wed Mar 11, 2020 9:54 pm:FG can visualize aircraft driven by external application via UDP. That app will read AI flightplans for aircrafts, calculate aircrafts new position by simple FDM and send this positions into FG via UDP. FG only render that aircraft.


Indeed, that is exactly how the multiplayer system already works - and as a matter of fact, under the hood it's using the AI subsystem, which is why MP won't work, unless you also enable the AI system.

The primary developer of the AI system has been wanting to change the system to always "inject" traffic over the MP system, for the reasons you mentioned - but also so that multiple inter-linked fgfs instances would see consistent traffic (think having a traffic server, and running that outside the main loop):

http://sourceforge.net/p/flightgear/mai ... /15645677/
Durk Talsma wrote:I've been thinking about this idea for some time now; separate out the "intelligent part of the AI code" into a separate program, and run this as a dedicated standalone program that feeds aircraft positions into flightgear. This would solve many initialization problems, because the server could run completely independently of FlightGear itself. If somebody would care to assist in working out the details of the networking code, I'd be happy to investigate the possibilities of setting up a dedicated AI traffic server.


In such a setup, each fgfs client would have its own equivalent of the fgms multiplayer server running as a FlightGear subsystem, while the traffic server itself would run in a separate thread or process.

Again, Durk and others had that idea long ago, so your idea is not bad at all - but there's more to it than just coming up with the idea, which you will understand once you look at the details.

Full background below:

http://wiki.flightgear.org/FGTraffic
http://wiki.flightgear.org/Decoupling_t ... fic_System
http://wiki.flightgear.org/An_Integrate ... fic_System
http://wiki.flightgear.org/High-Level_Architecture
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: Lag Issue when looking around or changing view etc.

Postby V12 » Thu Mar 12, 2020 4:40 pm

Hooray wrote in Thu Mar 12, 2020 8:40 am:Indeed, that is exactly how the multiplayer system already works


IMHO, this is not true. FG uses only 2 cores. Why I can't see CPU load more than 50% on i5-2550K (physical quad-core) ? If OSG is multuthreaded, uses 2 cores, 3td core should be used by MP system. But in this case max CPU load will be almost 75%. If is only 50% and MP system runs in dedicated core, OSG is not multithreaded. But differences in CPU load with and without <multithreading-mode> is significant, then OSG is multithreaded and MP system runs in main loop.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1817
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Lag Issue when looking around or changing view etc.

Postby Hooray » Thu Mar 12, 2020 4:52 pm

You misunderstood, the MP systems already works according to what the OP said ("FG can visualize aircraft driven by external application via UDP.") so that it uses the AI system to set up AI traffic which is in turn driven/updated via network, setting properties in FlightGear based on those packets.

OSG multi-threading is all about rendering, so has little do with multiplayer, except for the paging of MP/AI models to render those as needed. Otherwise, all the network transmissions and updating happens outside OSG land.

Again, if you are so interested in learning more about the current situation with regard to multi-threading in FlightGear, you could spend a little more time researching the topic.

As has been said, a number of core developers have been wanting to run a built-in fgms instance inside the FlightGear main loop and use that run a dedicated traffic generator in another thread/process.

In theory, it would even be possible to run an actual FDM/autopilot and route manager instance for visible traffic nearby. Such updates could be computed in a background/worker thread, and would only be copied back into the property tree at frame rate (aka 30-60 hz). This is something that a few core developers suggested in response to the original idea of coming up with a generic "performance database" for different types of aircraft, primarily because AI traffic is totally agnostic to other traffic, but also to the environment itself (weather, winds etc)

And by the way, we have previously built such an external "traffic generator" on top of the MP system, and it would indeed run in a different process (i.e. on a different core):

http://wiki.flightgear.org/FGAIS
Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: Lag Issue when looking around or changing view etc.

Postby V12 » Thu Mar 12, 2020 7:19 pm

OK. Thx.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1817
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Lag Issue when looking around or changing view etc.

Postby Puffergas » Fri Mar 13, 2020 11:25 pm

I also experience a lag when first looking around. However, it is something that I add to my check list. Considered to be just another thing needed to be done before take off.

Raspberry Pi4 4G
Raspbian
Puffergas
 
Posts: 49
Joined: Thu Jan 02, 2020 1:09 am

Re: Lag Issue when looking around or changing view etc.

Postby Johan G » Sat Mar 14, 2020 8:26 am

Puffergas wrote in Fri Mar 13, 2020 11:25 pm:[...] when first looking around.

I have sometimes seen it mentioned that people often, in either internal or external view, look on the surrounding scenery around the aircraft. I might be wrong but I recall that it will trigger scenery loading, so that you will have less stutter, at least on the initial climb.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5782
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Lag Issue when looking around or changing view etc.

Postby Puffergas » Sat Mar 14, 2020 11:22 pm

It is about a 3 second, or more, stutter when first looking around internally. After that a 3 hour flight is smooth as silk. I consider it, just part of my pre flight check list.
Puffergas
 
Posts: 49
Joined: Thu Jan 02, 2020 1:09 am

Re: Lag Issue when looking around or changing view etc.

Postby BattleVenom » Mon Mar 16, 2020 8:06 pm

Since my laptop's graphics card is the Intel HD 520, could I go into the bios and allocate more memory ram to it?
BattleVenom
 
Posts: 4
Joined: Sun Mar 08, 2020 10:16 pm

Next

Return to Graphics

Who is online

Users browsing this forum: No registered users and 1 guest