LIVING WORLD CONFIGURATION EXAMPLES

This section presents a few examples of how to write a Living World Configuration file - overriding only parts of the data - followed by some descriptions of how the various systems of the living world work "behind the scenes". A complete example is available in the Samples\LivingWorld_Config folder of the SDK, explained on this page of the documentation. For more information about the xml specifications, see Living World Configuration Definitions.

 

 

Minimal Example

Here is a minimal example that only defines the list of FuelTruck models to be used in Region B:

<SimBase.Document>
    <LivingWorld.LivingWorldSettings>
        <LivingWorldRegion RegionID="B" >
            <Airport>
                <FuelTrucks>
                    <ContainerEntry ContainerTitle="ASO_FuelTruck01_Black" EntryWeight="1"/>
                </FuelTrucks>
            </Airport>
        </LivingWorldRegion>
    </LivingWorld.LivingWorldSettings>
</SimBase.Document>

With such a file, only the FuelTrucks list for region B will be overridden. Any other list for region B, and any list for other regions, will stay as read in the base default Asobo *.xml file. Note that for region B, the whole list of FuelTrucks is replaced by this list with a single entry, it is not "merged" with the default list.

 

 

Large Example

In this larger example, we're defining one of the general settings, as well as the lists of FuelTrucks, Pushbacks, and FreewayTraffic in four different regions:

<SimBase.Document>
    <LivingWorld.LivingWorldSettings>
        <GeneralSettings>
            <AmbientVehiclesQuantityByParking>
                <ParkingEntry ParkingType="RAMP_GA_SMALL" Rate="0.8"/>
            </AmbientVehiclesQuantityByParking> 
        </GeneralSettings>
        <LivingWorldRegion RegionID="B" >
            <Airport>
                <FuelTrucks>
                    <ContainerEntry ContainerTitle="ASO_FuelTruck01_Black" EntryWeight="1"/>
                </FuelTrucks>
            </Airport>
        </LivingWorldRegion>
        <LivingWorldRegion RegionID="D" >
            <Airport>
                <PushbackTugs>
                    <ContainerEntry ContainerTitle="ASO_Pushback_Blue" EntryWeight="1"/>
                </PushbackTugs>
            </Airport>
        </LivingWorldRegion>
        <LivingWorldRegion RegionID="M" >
            <Airport>
                <PushbackTugs>
                    <ContainerEntry ContainerTitle="ASO_Pushback_Blue" EntryWeight="1"/>
                </PushbackTugs>
              </Airport>
        </LivingWorldRegion>
        <LivingWorldRegion RegionID="T" >
            <FreewayTraffic>
                <ModelEntry ModelID="{08546166-d7af-4bfc-9197-a8d98efd2be7}" EntryWeight="1"/>
            </FreewayTraffic>
        </LivingWorldRegion>
    </LivingWorld.LivingWorldSettings>
</SimBase.Document>

In this example, the General setting AmbientVehiclesQuantityByParking is overridden. Even though only one parking type is specified here, the whole AmbientVehiclesQuantityByParking is overridden, which means that all other parking types will have an implicit Rate of 0, instead of their default values. The other GeneralSettings are not mentioned, however, and will thus keep their default value.

 

For regions, each region not mentioned in this xml will keep the entirety of its default lists. The region B will only replace its list of FuelTrucks, keeping every other default list. Similarly, regions D and M only replace their Pushbacks lists, and the region T only replace its list of FreewayTraffic vehicles.

 

 

Examples Of EntryWeight

When generating objects for the Living World, a random model is chosen from the list using EntryWeights to influence the randomness:

<PushbackTugs>
    <ContainerEntry ContainerTitle="ASO_Pushback_Blue" EntryWeight="2"/>
    <ContainerEntry ContainerTitle="ASO_Pushback_White" EntryWeight="1"/>
</PushbackTugs>

With such an example, the blue pushback is twice as likely to be chosen as the white one. This means that if an airport has 100 pushbacks, it is likely to have a distribution of approximately 67 blue pushbacks and 33 white, but it can also have something like 61 blue and 39 white, or 72 blue and 28 white, because of the random distribution.

 

The actual value of EntryWeight only has a meaning relative to other EntryWeight. The following example will lead to exactly the same results as the previous one:

<PushbackTugs>
    <ContainerEntry ContainerTitle="ASO_Pushback_Blue" EntryWeight="2000"/>
    <ContainerEntry ContainerTitle="ASO_Pushback_White" EntryWeight="1000"/>
</PushbackTugs>

Let's look at another example:

<BoardingRamps>
    <ContainerEntry ContainerTitle="ASO_Boarding_Stairs" EntryWeight="6"/>
    <ContainerEntry ContainerTitle="ASO_Boarding_Stairs_Red" EntryWeight="8"/>
    <ContainerEntry ContainerTitle="ASO_Boarding_Stairs_Yellow" EntryWeight="3"/>
</BoardingRamps>

Here, the Red variant will appear, on average, slightly less than half the time, because it should end up with a frequency of 8/17, while the yellow one will only appear around 3/17 of the time.

 

Finally, note that you can have some entries with a weight of 0, as long as the total accumulated weight is not 0:

<FuelTrucks>
    <ContainerEntry ContainerTitle="ASO_FuelTruck01_Black" EntryWeight="1"/>
    <ContainerEntry ContainerTitle="ASO_FuelTruck01_White" EntryWeight="0"/>
</FuelTrucks>

 

 

Counter-Examples: Errors To Avoid

Here is a example of what not to do. It contains mistakes that are most likely to appear due to inattention, and it's been heavily commented to draw attention to these areas:

<LivingWorldRegion RegionID="B" >
    <Airport>
        <PushbackTugs>
            <!-- Empty list has unspecified behavior -->
        </PushbackTugs>
        <FuelTrucks>
            <ContainerEntry ContainerTitle="ASO_FuelTruck01_Black" EntryWeight="0"/>
            <!-- List with a total cumulated weight of 0 will cause issues -->
        </FuelTrucks>
        <CateringTrucks>
            <ContainerEntry ModelID="{08546166-d7af-4bfc-9197-a8d98efd2be7}" EntryWeight="1"/>
            <!-- ContainerEntries must contain a Title to a SimObject, not to be confused with Modelentry containing GUID to a SceneryObject-->
            <!-- Please see the XML specifications to know which lists use ModelEntry and which use ContainerEntry -->
        </CateringTrucks>
        <BoardingRamps>
            <ContainerEntry ContainerTitle="ASO_Boarding_Stairs" EntryWeight="-1"/>
            <!-- Negative weight is not accepted -->
            <ContainerEntry ContainerTitle="ASO_Boarding_Stairs_Red" EntryWeight="1.5"/>
            <ContainerEntry ContainerTitle="ASO_Boarding_Stairs_Yellow" EntryWeight="2.5"/>
            <!-- EntryWeight must be integers -->
        </BoardingRamps>
        <GroundPowerUnits>
            <ContainerEntry ContainerTitle="ASO_Ground_Power_Unit" EntryWeight="2147483647"/>
            <!-- Please avoid absurdely large weights. The total accumulated weight of a list should not be larger than 2147483646 -->
        </GroundPowerUnits>
    </Airport>
</LivingWorldRegion>
<LivingWorldRegion RegionID="B" >
    <!-- Duplicate. This is the second region 'B' in this file -->
</LivingWorldRegion>

 

 

How Living World Systems Work

While this section is primarily about examples of the xml that would be used in add-ons , it's useful to get some context for what these examples are actually doing "behind the scenes", and as such you can find some additional information on what's really going on from the sections below.

 

Ambient Traffic

Ambient Traffic is a system to give some impression of "life" on the airports. A number of vehicles of various types are generated, and move semi-randomly across the airport.

 

When getting close enough to an airport, N vehicles are generated, each picking a random model from the list corresponding to the Region of the airport, and they are placed on an empty parking space. The number N is computed by adding the number of each type of parking, multiplied by its factor from the GeneralSettings AmbientVehiclesQuantityByParking, and then multiplying that by the Airport Vehicle Density (found in the in-sim Options of Microsoft Flight Simulator, taken as a percentage). If every single parking space is occupied before N vehicles have been created, the generation is stopped, ending up with less vehicles. This could be due to too many Parked Aircraft, or to too much overlapping parking on the airport.

 

While occupying parking spaces the same way an aircraft would, ambient vehicles will wait some random time - anywhere from a few seconds to a few minutes - before choosing another random unoccupied parking somewhere on the airport. They will then move towards this new parking, starting over the process of waiting once it has been reached. A fraction of the ambient vehicles - determined by the GeneralSettings RatioOfAmbientVehiclesThatAreImmobile - will stay on their original parking without ever moving.

 

When moving across the airport, ambient vehicles will use the TaxiPaths of the airport, favoring paths of type VEHICLE whenever possible, and they will also trying to avoid runways. When crossing a runway, they will pause at holdshort, and wait until the runway is free if ATC has been warned that the runway is currently in use for a takeoff or landing. If the User tries to takeoff without clearance, for example, the vehicles might cross the runway because they are not aware of the takeoff, since ATC has not been talked to. When taxiing on regular taxi paths, ambient vehicles are aware of other vehicles and aircraft taxiing, and ATC will also warn them in the case of incoming traffic near intersections.

 

If an aircraft (User or AirTraffic) lands and requires a parking space, but all parkings are currently occupied due (in part) to ambient vehicles, then a vehicle is destroyed (removed from the sim world) to make some room for the aircraft.

 

Parked Aircraft

Parked Aircraft is a system that generates a number of aircraft in each airport, in order to avoid a feel of "emptiness" that was present in FSX airports. This also helps the AirTraffic system to avoid having aircraft appear "out of thin air" in the airport before taking off.

 

When getting close enough to an airport, each unoccupied parking of the airport tries to generate a parked aircraft with a probability determined by GeneralSettings ParkedAircraftsQuantityByParking rate multiplied by the Ground Aircraft Density (found in the in-sim Options of Microsoft Flight Simulator). The model of aircraft is chosen with multiple criteria, such as:

  • preferred parking type
  • company
  • manufacturer (if the parking has such requirements)
  • radius of the parking.

The aircraft chosen will always have a wingspan smaller or equal to the diameter of the parking. Depending on the GoodToBadMatchRate attribute, aircraft that have a wingspan closest to the parking diameter might have higher chances of being chosen (parking spot definitions are discussed here: <TaxiwayParking />).

 

If an AirTraffic aircraft should be created at an airport - due to a Takeoff happening soon, for example - the system first tries to find a Parked Aircraft of the same model. If such a Parked Aircraft is found, the plane leaves the Parked system, and becomes part of the AirTraffic system, otherwise a proper aircraft is created.

 

To give even more life to an airport, Parked Aircraft might randomly use some of the services available around them from time to time. See the <SleepingActivities> of the Airport Services xml for more details.

 

If an aircraft (User or AirTraffic) lands and requires a parking spot, but all spots are currently occupied due to Parked Aircraft - and no ambient vehicle is occupying a relevant parking - then a Parked Aircraft is destroyed (removed form the sim world) to make some room for the new aircraft. Ambient vehicles are prioritized for this kind of destruction, when possible.

 

 

Road Traffic

Road traffic - or FreewayTraffic - is a system that simulates the traffic of cars and other vehicles on all types of roads all across the world. Note though that road traffic is excluded from airport perimeters.

 

Based on the type and width of roads, a different amount of vehicles will be generated and move at different speeds depending on the type of road. At night, lights are also generated around the vehicles to simulate their headlights and backlights. The amount of vehicles is also influenced by the Road Vehicles slider (in the in-sim Options of Microsoft Flight Simulator).

 

When creating vehicles for this system, we recommend creating models with a single LOD, that is on the "low side" of quality, to avoid performances issues. Also avoid adding lights to the vehicles, since - as we've mentioned above - the system already generates lights. An example of such a vehicle is available in the Samples folder of the SDK, and the image below show's the wireframe of a simple car from the sim so you can get an idea of the typical LOD we're discussing:

Wireframe Low-ploy Car Traffic Model

 

Inland Boats

Inland Boats - or Leisure Boats - is a system that is used to generate boats on coastal areas and lakes. The amount of boats is influenced by the Leisure Boats slider (in the in-sim Options of Microsoft Flight Simulator) and also by the density of population in zones nearby. These boats are only generated near coasts, on the open sea, or on lakes. They wander randomly in their surroundings, trying to stay on water at all times.