Board index FlightGear Development

MP optimization

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

MP optimization

Postby sgofferj » Sun Dec 25, 2011 9:34 pm

Hi,

I just tried to fly at KSFO when 20 +/- some MP pilots were online there also. I got framerates between 2-4fps. On a quadcore 3400MHz Phenom II. That is pretty much unacceptable, because if FG get more popular there WILL be more MP aircraft around.
Flightgear scales miserably and I think, I got at least a basic idea, why.
When checking the console output, I noticed messages like this ones:

Code: Select all
Could not find at least one of the following objects for animation: 'door.cargo_aft'
Could not find at least one of the following objects for animation: 'door.cargo_forward'
Could not find at least one of the following objects for animation: 'yoke'
Could not find at least one of the following objects for animation: 'yoke'
Could not find at least one of the following objects for animation: 'VSIneedle'
Could not find at least one of the following objects for animation: 'HDG VS select'
Could not find at least one of the following objects for animation: 'range.zoom'
Failed to load submodel: Texture file not found: '../../../Instruments'
        from:/usr/share/flightgear/Aircraft/A380/XML/FlightDeck/Glareshield/wing_c.xml
Failed to load submodel: Texture file not found: '../../../Instruments'
        from:/usr/share/flightgear/Aircraft/A380/XML/FlightDeck/Glareshield/wing_fo.xml


So if I read this right, for ANY MP aircraft, the COMPLETE model is loaded? Including cockpit, gauges, etc...
If this is so, it's no wonder that the computer breaks down if there are more than 2 or 3 MP aircraft nearby...

The other thing is that the multithreading seemingly does not apply to all of FG, because while one core was running hot at 100% the others were between 10% and 60%.
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: MP optimization

Postby Hooray » Sun Dec 25, 2011 10:33 pm

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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MP optimization

Postby sgofferj » Sun Dec 25, 2011 10:43 pm

So it has been briefly discussed on the mailing list and the problems still persist?
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: MP optimization

Postby Hooray » Mon Dec 26, 2011 1:21 pm

Not just "brief talks" - there have been lots of talk here, too:

http://www.flightgear.org/forums/viewto ... f=4&t=2460
viewtopic.php?f=6&t=3207
http://www.flightgear.org/forums/viewto ... f=6&t=6480
viewtopic.php?f=27&t=14640
http://www.flightgear.org/forums/viewto ... =10&t=8432

Also, once you do a forum search, you should be able to find a thread where stuart announced working on a patch to automatically reduce the complexity of AI/MP models to improve performance.

Obviously, discussions like these are not perfect to handle the "meta issue". For that, the issue tracker would definitely be better.

http://flightgear-bugs.googlecode.com/
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MP optimization

Postby sgofferj » Mon Dec 26, 2011 1:32 pm

The problem is that for my understanding this issue is not a "bug" because FG behaves basically correctly, i.e. as it was programmed. The present algorithms just don't scale.
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: MP optimization

Postby Hooray » Mon Dec 26, 2011 4:41 pm

The issue tracker isn't just for bugs only, it is also used for feature requests or for "meta planning".
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MP optimization

Postby stuart » Wed Jan 04, 2012 4:48 pm

Following up on Hooray's comments about automatically reducing aircraft complexity.

I did eventually get a scheme working that simply did not load anything other than the initial model for an AI aircraft. However, this wasn't ideal as a number of aircraft (notably the 747) consists of multiple models - one for the wing, another for the engine. In the end I decided it was a development dead end and didn't pursue it any further.

My current thinking is that we should populate the AI/Aircraft directory. This is supposed to be for low-poly AI versions of aircraft which are used by FG in preference to the "full fat" version of an aircraft.

If someone wanted to spend a small amount of time removing excessive textures and objects from aircraft, I'd be happy to receive patches. It should be possible to resize the textures with a script, and removing secondary models is simply a matter of going through the XML and deleting files.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: MP optimization

Postby Hooray » Wed Jan 04, 2012 5:06 pm

I did eventually get a scheme working that simply did not load anything other than the initial model for an AI aircraft. However, this wasn't ideal as a number of aircraft (notably the 747) consists of multiple models - one for the wing, another for the engine. In the end I decided it was a development dead end and didn't pursue it any further.


Well, I still think your method is pretty promising, especially in the long run.
Maybe, your problem was trying to work with the existing aircraft layout, which is pretty much random and often semi-chaotic ?

It's hard to cater for such a degree of "flexibility" actually.

Maybe it would be better to come up with a new convention instead, to require multi-model aircraft to "mark" exterior models accordingly, so that FG knows about relevant parts (for an exterior view) and irrelevant views?

This is something that could be implemented as part of the aircraft loader, while traversing the 3D model and loading all sub models. FlightGear could then be EXPLICITLY told about INSIDE/OUTSIDE models.

How difficult would it be to come up with such a "marking scheme" where relevant sub models get meta information assigned so that the loader knows about sub models belonging to the interior or exterior view?
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MP optimization

Postby stuart » Wed Jan 04, 2012 5:55 pm

Yes, I thought about that, and did include a marker to indicate sub-models that should be loaded.

However, if you're going to force aircraft designers to mark anything that should be included, they might as well just create a "proper" AI version of the aircraft, with a smaller texture footprint etc.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: MP optimization

Postby gooneybird » Wed Jan 04, 2012 7:19 pm

If anyone is replacing any of the AI models can you let us know, I'm currently working on a whole host of AI liveries, including remapping some models, and don't really want to do any unnecessary work.
http://www.flightgear.org/forums/viewtopic.php?f=23&t=14232
My Github repository (mostly AI stuff) https://github.com/gooneybird47
User avatar
gooneybird
 
Posts: 3046
Joined: Sat May 31, 2008 2:57 pm

Re: MP optimization

Postby F-JJTH » Wed Jan 04, 2012 10:34 pm

Hi,

I have a little experience about MP optimisation and I would like to share it :
I participe to the DC-3 development ("PAF" version) and I use "range" animation in order to don't load all DC-3 parts in MP. This is the details :

- Engine are visible under <property>/sim/rendering/static-lod/ai-detailed</property> (currently this property is only available in GIT version)
- Overhead and all switchs on it are visible up to 18 meters
- Panel and all instruments are visible up to 18 meters
- Pilot chairs and copilot chairs are visible up to 18 meters
- All cabine chairs are visible up to 18 meters
- Details object available in cabine are visible up to 18 meters

With this technique : if you fly at over 18 meters of a DC-3 you load only exterior 3D. But if you approach you at least from 18 meters of the DC-3 you load all details of the DC-3.
The range animation is usefull and maybe it sufficient to improve MP loading.

It was my contribution to your thread. Hoping this could help you ;)

Cheers,
Clément
User avatar
F-JJTH
 
Posts: 696
Joined: Fri Sep 09, 2011 12:02 pm

Re: MP optimization

Postby stuart » Thu Jan 05, 2012 9:51 am

Hi Clement,

The range animation is very useful, but FG still has to load the entire model and textures, even if only some of it is rendered.

A simpler AI model has the advantage of reducing loading times, and allowing you to use smaller textures as well.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: MP optimization

Postby F-JJTH » Thu Jan 05, 2012 4:06 pm

stuart wrote in Thu Jan 05, 2012 9:51 am:The range animation is very useful, but FG still has to load the entire model and textures, even if only some of it is rendered.


Oh ok... I'm desappointed to hear that... But your information is usefull ;)
So the 3D is loaded but isn't rendered... It's off to a great start !

Cheers,
Clément
User avatar
F-JJTH
 
Posts: 696
Joined: Fri Sep 09, 2011 12:02 pm

Re: MP optimization

Postby AndersG » Thu Jan 05, 2012 8:13 pm

stuart wrote in Thu Jan 05, 2012 9:51 am:Hi Clement,

The range animation is very useful, but FG still has to load the entire model and textures, even if only some of it is rendered.

A simpler AI model has the advantage of reducing loading times, and allowing you to use smaller textures as well.


And has the disadvantage of ruining MP cockpit views and dual control. A lazy range animation (I thought Mathias was committing something approaching that recently?) would allow the aircraft author to make a reasonable LOD hierarchy for the aircraft (at least something like the LOD steps basic exterior only, detailed exterior and detailed exterior + interior + instruments or so).

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: MP optimization

Postby gooneybird » Fri Jan 06, 2012 12:29 am

I think the main problem here is asking one model to do two, sometimes incompatible, jobs, a lightweight model for AI traffic use and an MP version that needs all the bells and whistles of the parent aircraft.

The only answer I can see at the moment is having two different versions of the same model but perhaps using the same low-res texture files.
The reason for using two models is that I've noticed that just removing the interior etc. of a model for AI use sometimes leaves a horrible see through effect which can only be cured by blanking the windows, or other alterations to the model, therefore negating it's MP use :? :( .
My Github repository (mostly AI stuff) https://github.com/gooneybird47
User avatar
gooneybird
 
Posts: 3046
Joined: Sat May 31, 2008 2:57 pm

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 5 guests