FSX Seasonal objects as effects

rhumbaflappy

Moderator
Staff member
Resource contributor
Hi all.

We can display objects seasonally by placing them as effects. But there is a bug in FSX that crashes the sim when changing the season while using the effect-objects. There is a work-around:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<FSData version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{BEE80850-5160-47ED-AD93-03B89EB5AA57}" scale="0.0001"/>
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{F5FA3C7D-1DB1-4E30-A3BC-7EEED385CFCB}" scale="0.0001"/>
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{AF2B2CA1-D00B-4F24-B7CB-6B972A8AE07F}" scale="0.0001"/>
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{DF9DBE5E-E11A-4EEA-B406-77FD939517D7}" scale="0.0001"/>
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{FA59B805-336F-486A-A883-C9C1E1E06DDC}" scale="0.0001"/>
</SceneryObject>


<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_hw" effectParams="MOY=01,03;" />
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_sp" effectParams="MOY=04,05;" />
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_su" effectParams="MOY=06,08;" />
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_fa" effectParams="MOY=09,10;" />
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_wi" effectParams="MOY=11,11;" />
</SceneryObject>

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<Effect effectName="object_Cottonwood_16m_hw" effectParams="MOY=12,12;" />
</SceneryObject>

</FSData>
This huge xml file will produce a conditionally displayed tree on the C59 runway in all seasons, with the seasons matching FSX.

I first placed all 5 variations of the 16meter cottonwood tree according to their GUID... but scaled very tiny to obscure their visibility in the sim. This prevents the crash when switching seasons.

Then I set the conditional monthly display for each effect-object variation after checking the seasons.bgl in TMFViewer to get the monthly season for my location.

Compile the BGL and place in an active scenery folder.

The FX files are text files, and can be generated by the built-in effects tool in the sim ( use the insert debris menu entry to start). Here's object_Cottonwood_16m_fa.fx:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Radius=0
Priority=0

[Properties]

[Emitter.0]
Lifetime=0.00, 0.00
Delay=0.00, 0.00
Bounce=0.00
Rate=1.00, 1.00
X Emitter Velocity=0.00, 0.00
Y Emitter Velocity=0.00, 0.00
Z Emitter Velocity=0.00, 0.00
Drag=0.00, 0.00
X Particle Velocity=0.00, 0.00
Y Particle Velocity=0.00, 0.00
Z Particle Velocity=0.00, 0.00
X Rotation=0.00, 0.00
Y Rotation=0.00, 0.00
Z Rotation=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.00, 0.00
Z Offset=0.00, 0.00
Pitch=0.00, 0.00
Bank=0.00, 0.00
Heading=0.00, 0.00

[Particle.0]
Lifetime=1.00, 1.00
Type=22
X Scale=1.00, 1.00
Y Scale=1.00, 1.00
Z Scale=0.00, 0.00
X Scale Rate=0.00, 0.00
Y Scale Rate=0.00, 0.00
Z Scale Rate=0.00, 0.00
Drag=0.00, 0.00
X Rotation=0.00, 0.00
Y Rotation=0.00, 0.00
Z Rotation=0.00, 0.00
Face=0, 0, 0

[ParticleAttributes.0]
Bounce=0.00
Jitter Distance=0.00
Jitter Time=0.00
X Scale Goal=0.00
Y Scale Goal=0.00
Z Scale Goal=0.00
GUID={F5FA3C7D-1DB1-4E30-A3BC-7EEED385CFCB}
Scale=4096
Radius=4096
Power=4096
If hand-coding the FX files, it's much easier to make them this way:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Radius=0
Priority=0

[Emitter.0]
Rate=1.00, 1.00

[Particle.0]
Lifetime=1.00, 1.00
Type=22
X Scale=1.00, 1.00
Y Scale=1.00, 1.00

[ParticleAttributes.0]
GUID={F5FA3C7D-1DB1-4E30-A3BC-7EEED385CFCB}
I haven't the checked FPS hit in the sim, but it would be reasonable for a specialized building... for forests of trees?!?

Dick
 

Attachments

Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Dick,

Thanks for sharing. So basically you are pre-loading the different seasonal versions by adding them to the beginning of the XML? And that prevents a crash while changing seasons in FS.
 

rhumbaflappy

Moderator
Staff member
Resource contributor
Hi Arno.

Yes, it seems preloading the guid variations as objects does prevent the crash. I tried placing the objects underground, the north pole, etc..., but it still crashed. I think the object might need to be placed at ( or very near ) the same location as the effect-object. It would be useful if one object could 'protect' many effect-objects ( with the same guid )... I haven't tested that.

This seems to be a bug with the visualfx.dll

I also noted that the effect line of Face=0, 0, 1 ( under Particle.x ) can make a bitmap rotate to face the viewer, but I don't know if an effect-object ( debris ) can be made to always face the viewer.

Dick
 
Last edited:
Happy new year, Arno, Dick and all here !

Thanks for sharing, Master Dick ! That sounds a very nice beginning for 2010 !

We count on you to teach us more and more about FSX tweaking, Dear Master !


A seasonal trees addict
 

rhumbaflappy

Moderator
Staff member
Resource contributor
Hi all.

It occured to me it might be better to encapsulate all the library object calls and effects calls into a singular MDL using attachpoints... then the xml files become much simpler. The Library BGL:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<FSData version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<ModelData
      sourceFile="seasonal_maple_29m.MDL" /> 

</FSData>
The Placement BGL:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<FSData version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{36c38914-9203-4218-8bd6-835e6fb5c61c}" scale="0.001"/>
</SceneryObject>

</FSData>
Or all in one:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<FSData version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<SceneryObject lat="42.6290553492842" lon="-88.6017056125155" alt="0" pitch="0" bank="0" heading="4.83000859240525" altitudeIsAgl="TRUE" imageComplexity="NORMAL"> 
<LibraryObject name="{36c38914-9203-4218-8bd6-835e6fb5c61c}" scale="0.001"/>
</SceneryObject>

<ModelData
      sourceFile="seasonal_maple_29m.MDL" /> 

</FSData>
Note the placement XML code contains scale="0.001". That's needed to hide the redundant library objects. The gmax object has 5 seasonal object attachments and 6 effect attachments.

The FX files would still need to be created for the seasonal variations, and put in the effects folder. They are in the attached zip file.


Dick
 

Attachments

Last edited:

rhumbaflappy

Moderator
Staff member
Resource contributor
Hi all.

Working with making effect-objects, I found them to be unworkable due to an annoying flickering of the objects. But I found the cure:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Radius=0
Priority=0

[Properties]

[Emitter.0]
Lifetime=0.00, 0.00
No Interpolate = 1
[B][COLOR="Red"]Rate=2.00, 2.00[/COLOR][/B]

[Particle.0]
Lifetime=1.00, 1.00
Type=22
X Scale=1.00, 1.00
Y Scale=1.00, 1.00
Z Scale=0.00, 0.00
Face=0, 0, 0

[ParticleAttributes.0]
GUID={9C13ACA5-A84F-4FD3-8873-7C3079BB82DD}
The Rate is apparently the renewal of the emitter in # of times / second. Simply increasing the rate to 2 times per second eliminates the flickering.

I've used SBuilderX313 to place lines of trees with some success. I'm making some MDLs to collect in Libraries. The MDLs use attachpoints to hold the needed redundant library objects as well as the effect-objects. I'm using Arno's ModelConverterX to make the MDLs...bypassing the use of gmax, which is pretty slow.

The creation of the FX files is a lot of cut-n-pasting with notepad... plugging in the right GUID for each tree.

The FPS is a hit for many trees, but not unworkable. This might be a good solution for areas that cannot support autogen, or for which autogen cannot pinpoiny a seasonal landmark.

I find that we don't need all the autogen seasonal tree sets, but just a good representation of different sizes.



And, yes, these trees change with seasons matching the seasons of FSX. No flickering. There is a small problem with them disappearing as the plane approaches...similar to the v2? problem of old. But there may yet be a fix for that. These are some elms and maples of different sizes.

Hard Winter:




Dick
 
Last edited:
Hi ! Dick, Hi ! all,
I'm working on creating trees library with your method, Dick, and it just works fine.
Some pictures :
Hard Winter at LFSR



Spring



Left, your Maple_29m, right, "my" aspens 7m & 9m and chestnuts 8m & 10m, center, ... tree from misplacing ! I've pasted many trees with Annotator and I need to clean up a lot...

Many thanks, Dick !

I use MDLConverterX to tweak all MDL files (Thanks Arno ;) ) as you wrote before, and I have some work to do for my scene (about 20 trees) and I should share with anyone interesting with trees library for FSX.
Location tweaking is quite easy with Arno's MDLConverterX and it's easy, but long in time, to make a basic tree library which could be tweaked by anyone for his own location.

Keep on tweaking !
Keep on sharing !
 

rhumbaflappy

Moderator
Staff member
Resource contributor
I'm glad you are finding a use for it.

I might be too picky, but the abrupt image loss when moving out of the effect-object refpoint is annoying... but we have seasonal trees again.

I wouldn't try to make all the tree sizes for libraries, but a few representations.

How are your framerates?

I think using autogen from the Annotator is still the best, but there are cases where Annotator just doesn't do the right job... and it doesn't allow specific trees reliably. Airports are a disaster because the runways do exclude trees nearby.

Dick
 
Last edited:
Hi Dick,
I can't answer you about FPS loss ; I've about a dozen of effect trees on my scene now, and I have to put about an hundred if I want to do as I made for FS9.
Let me some time to do it :)
For now, it's one giant leap for the FS community ;) A door is open, what's behind ?
I think it's possible now to add, by this way, any seasonal tweak on any object. I'm thinking about trees library I've made for FS9 with Gerrish Gray textures and asm tweaking, the "old way"...
I'll tell you ASAP.
SYS, Dick !

P.S.: my apologies for my approximate english, I'm a Froggie, but this isn't an excuse.

Edit :
About Annotator, I agree what you write, Tree lines cannot be done with Annotator, too.
 
Last edited:

rhumbaflappy

Moderator
Staff member
Resource contributor
Most objects can use the FS9/ASM tweaked code just fine. So if we stay away from alpha-channels, our old methods are good.

But Alpha-transparency is broken for FS9 materials in FSX... so no seasonal trees from FS9 objects.


I'm still not done experimenting... but this works pretty well. I also thought of calling FSX objects from FS9 code, but the FSX objects have a persistence in the sim and you can't 'delete' them conditionally.

Dick
 
Once again, I agree.

I learned so much by reading what you wrote here, Dick, and I made with your help (and Arno's, too ;) ) some objects for FS9 :
- 2 trees libraries, one with original FS9 trees textures, the 2nd with G. Gray trees textures, which both don't work in FSXA due to broken FS9 transparency in FSXA, as you told before.
- anti-fragment "modular" hillocks (sorry for this bad translation, even with the help of Google and my Harrap's ) with seasonal textures, which work fine in FS9, FSX and FSXA too.
- a rotating-to-wind french flag (sorry again I'm working on French AFB), works fine in all FS, and a Wind-T which has transparency issue in FSXA, only observable when you are very near.
A lot of asm tweaking, but I like it :)
Back to the subject, I'm thinking of making a seasonal trees library with G. Gray textures ; they are more diversified than FS originals and look much better as European trees. I know they aren't at FSX standard but I don't know how to make my own trees textures.

Thanks you, Dick, for giving ideas... ;)


[Edit]
Today, I made all the decideous trees I want (a lot of copy/paste !). I also tested making a tree with G. Gray textures with the same method : it works ! But, there is a but, there is some trouble with the sunny side, too bright, and the reverse, too dark.
Only one pict. ImageShack is too crowdy !

 
Last edited:

rhumbaflappy

Moderator
Staff member
Resource contributor
The brightness has to do with the Normals. Offhand I can't remember the fix, but maybe ModelConverterX can fix that. I think we want all the normals pointing up?

Dick
 
MDLConverterX does it ! Thank you Arno ! :)
This conifer appears like it does in FS9.
I've just turned Assume Vertical Normal to True and Specular Color to 0 (avoid ugly brightness).
I must verify transparency with a deciduous tree.

A little bit more work to do...

To be continued.
 
Hello,

First of all thanks for the research and all the work :)

I downloaded the file from http://dl.free.fr/iu7i6geMr and have some questions:

1) Do you have the same issue that when seen from a distance everything is OK. Though, when moving towards the trees, at some point (quite close to them) the textures turn to sort of automn ones? (the trees turt red/yellow)

2) I wanted to use the existing mdls - to tweak them to display bigger trees. But I do not manage. Here is what I did:
- in ModelConverterX (thanks for it Arno :)) I changed the attachpoints to the GUID for bigger oak tree (all seasons) and then I exported it in FSX format
- I changed all relevant effects for the GUIDs for bigger oak (corresponding to the GUIDs in the tweaked mdl file).

The bigger oak displays but is seems to be burried half way in the ground ;)

Any idea?

Thank you,

Milan
 
1) Have you set the scale to 0.01?
2) Sorry, no idea. Did you use the autogen oak_22m tree GUID?
 
Last edited:
Hi all,

Firstly thanks Dick and Arno for all this info.

I've made a series of .fx files for seasonal trees based on my own x-plane fsx gmax tree models, then put the original tree .mdls (for all seasons) and the gmax attachpoint effect placement .mdls as described above into a single library.

I've found that as long as all of the seasonal tree models are placed relatively nearby (about 100m away, underground, and with the same GUID as referenced by the .fx files), I can place as many .fx placement mdls with whisplacer without fsx crashing. So it looks like as Dick suspected not every placement needs the mini instances of the model.

Also which is kind of nice I can adjust the headings of these placement .mdls in whisplacer to get a bit of tree variation :) Now just have to make a few more .fx variations for size and I'll have a proper forest!

Cheers,
Mat
 
Top