MP Fallback models: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "MP Fallback models allow an aircraft developer to set what aircraft model be used to render their aircraft over MP if a user doesn't have their aircraft installed. To make us...")
 
(Fallback model is also used for LOD ranges)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
MP Fallback models allow an aircraft developer to set what aircraft model be used to render their aircraft over MP if a user doesn't have their aircraft installed.
'''MP Fallback models''' allow an [[Portal:Developer/Aircraft|aircraft developer]] to set what [[aircraft]] model be used to render their aircraft over [[multiplayer]] if a user does not have their aircraft installed or if the aircraft is outside the [[Level Of Detail (LOD) Ranges#AI/MP ranges|level of detail range]].


To make use of this feature, simply set /sim/model/fallback-model-index in the aircraft -set.xml file to one of the indexes in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/AI/Aircraft/fallback_models.xml /AI/Aircraft/fallback_models.xml].
== Using a fallback model with your aircraft ==
 
To make use of this feature, simply set /sim/model/fallback-model-index in the [[aircraft-set.xml]] file to one of the indexes in {{fgdata source |path=AI/Aircraft/fallback_models.xml}}.


This is then transmitted over the MP system and used by other clients.
This is then transmitted over the MP system and used by other clients.
Line 34: Line 36:


</syntaxhighlight>
</syntaxhighlight>
== Testing fallback models ==
The easiest way to test if a fallback model is working is by using two instances of flightgear connecting locally with each other for MP.  To do this you first need to ensure that you have no FG_AIRCRAFT paths set (this ensures that flightgear will use the FGDATA AI/Aircraft).
Then start two separate instances, e.g.
<syntaxhighlight>
# Instance loading the aircraft (in this case the spitfire)
fgfs --multiplay=out,10,127.0.0.1,5000 --multiplay=in,10,127.0.0.1,5001 --callsign=Test1 --disable-fullscreen --aircraft=spitfireVb --airport=EG32 --geometry=800x600 --fg-aircraft=/home/stuart/FlightGear/fgaddon/Aircraft
# Instance loading the ufo to view the above aircraft
fgfs --multiplay=out,10,127.0.0.1,5001 --multiplay=in,10,127.0.0.1,5000 --callsign=Test2 --disable-fullscreen --aircraft=ufo --airport=EG32 --geometry=1280x1000 --altitude=100 --offset-distance=0.1
</syntaxhighlight>
== Fallback model guidelines ==
Ideally fallback models should meet the following guidelines.
* a single .ac model which is less that 3mb
* a single texture file recommended 1024x2014 (ideally jpg, for size); less than 1mb, but ideally 300kb. resolution isn't as important as size.
* no transparent textures; and a minimum of transparent elements.
* animations (gear, control surfaces, flaps, canopy etc) are optional but good to have.
The guidelines are to ensure the fast loading of the fallback model. Generally I'd try to keep the total size less than 3mb; but ideally less than 2mb. Using 300kb for a jpeg texture is fine - but 2048x2048 is also acceptable - providing that the file size isn't too large (again jpg is good here).
== How to create fallback models ==
Remove as much geometry as possible and then use the various simplify geometry options usually on a per mesh basis - again using your judgement to get something that still looks reasonable.
== See also ==
* [[Howto:Animate models]]
== Related content ==
=== Wiki articles ===
* [[Pilot List]] dialog
=== Forum topics ===
* [https://forum.flightgear.org/viewtopic.php?f=4&t=34572 Fallback models for MP]
=== Mailing list treads ===
* [https://sourceforge.net/p/flightgear/mailman/message/36378050/ <nowiki>[</nowiki>Flightgear-devel<nowiki>]</nowiki> Fallback models for AI]
* [https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/CAP3ntyu6kRfEBKd%2B0jen4wDRs9yq%3DJe10XVNhV75%3DN3bCJYg2A%40mail.gmail.com/#msg36335571 <nowiki>[</nowiki>Flightgear-devel<nowiki>]</nowiki> LoD for MP Models]
[[Category:Aircraft enhancement]]

Latest revision as of 12:08, 15 April 2024

MP Fallback models allow an aircraft developer to set what aircraft model be used to render their aircraft over multiplayer if a user does not have their aircraft installed or if the aircraft is outside the level of detail range.

Using a fallback model with your aircraft

To make use of this feature, simply set /sim/model/fallback-model-index in the aircraft-set.xml file to one of the indexes in flightgear/fgdata/next/AI/Aircraft/fallback_models.xml.

This is then transmitted over the MP system and used by other clients.

For example;

<sim>
  <model>
    <fallback-model-index>6</fallback-model-index>
...

will use the Cub model, as index 6 refers to it in fallback_models.xml:

<PropertyList>

<!-- Default aircraft.  Will also be used if an AI model is not found -->
<model n="0" type="string">/Models/Geometry/glider.ac</model>

<!-- 1-50   Single engine GA aircraft -->
<model n="1" type="string">AI/Aircraft/c172/c-fgfs.xml</model>
<model n="2" type="string">AI/Aircraft/c177/c177-g-brdo.xml</model>
<model n="3" type="string">AI/Aircraft/c182/Models/c182-ai.xml</model>
<model n="4" type="string">AI/Aircraft/c182rg/Models/c182rg-ai.xml</model>
<model n="5" type="string">AI/Aircraft/Cessna208Caravan/Models/Cessna208-ai.xml</model>
<model n="6" type="string">AI/Aircraft/Cub/Models/Cub-ai.xml</model>

...

</PropertyList>

Testing fallback models

The easiest way to test if a fallback model is working is by using two instances of flightgear connecting locally with each other for MP. To do this you first need to ensure that you have no FG_AIRCRAFT paths set (this ensures that flightgear will use the FGDATA AI/Aircraft).

Then start two separate instances, e.g.

# Instance loading the aircraft (in this case the spitfire)
fgfs --multiplay=out,10,127.0.0.1,5000 --multiplay=in,10,127.0.0.1,5001 --callsign=Test1 --disable-fullscreen --aircraft=spitfireVb --airport=EG32 --geometry=800x600 --fg-aircraft=/home/stuart/FlightGear/fgaddon/Aircraft

# Instance loading the ufo to view the above aircraft
fgfs --multiplay=out,10,127.0.0.1,5001 --multiplay=in,10,127.0.0.1,5000 --callsign=Test2 --disable-fullscreen --aircraft=ufo --airport=EG32 --geometry=1280x1000 --altitude=100 --offset-distance=0.1

Fallback model guidelines

Ideally fallback models should meet the following guidelines.

  • a single .ac model which is less that 3mb
  • a single texture file recommended 1024x2014 (ideally jpg, for size); less than 1mb, but ideally 300kb. resolution isn't as important as size.
  • no transparent textures; and a minimum of transparent elements.
  • animations (gear, control surfaces, flaps, canopy etc) are optional but good to have.

The guidelines are to ensure the fast loading of the fallback model. Generally I'd try to keep the total size less than 3mb; but ideally less than 2mb. Using 300kb for a jpeg texture is fine - but 2048x2048 is also acceptable - providing that the file size isn't too large (again jpg is good here).

How to create fallback models

Remove as much geometry as possible and then use the various simplify geometry options usually on a per mesh basis - again using your judgement to get something that still looks reasonable.

See also

Related content

Wiki articles

Forum topics

Mailing list treads