1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSXA Creating custom autogen trees

Discussion in 'Autogen' started by Horst18519, 31 Jul 2012.

  1. simulondo

    simulondo

    Joined:
    5 Dec 2011
    Messages:
    38
    Country:
    spain
    looking at the SDK, I´ve seen this:

    (about AutogenDescriptions_mid.xml / AutogenDescriptions_min.xml)

    "Yes. If new groupings or models are added, then they should be referenced in all three descriptions files, otherwise gaps could appear in the scenery during certain seasons, or might occur depending on which descriptions file the user has specified in the configuration file. "

    So, It seems necessary to add the new class in all those files (AutogenDescriptions.xml/ / AutogenDescriptions_mid.xml / AutogenDescriptions_min.xml).

    "I have a bad felling about this". This method will bring all kind of problems when several addons begin to modify them.

    BTW, what is the difference between these files?. I´m checking them (the SDK´s xml version) right now and to me they are almost equal.
     
    Last edited: 20 Mar 2013
  2. simulondo

    simulondo

    Joined:
    5 Dec 2011
    Messages:
    38
    Country:
    spain
    I answer to myself after I re-read correctly this phrase from SDK:

    "These are variations of the AutogenDescriptions file that reduce the rendering complexity of the vegetation. Which file is used depends on the AutogenDescriptionsFilename setting in the [Terrain] section of the FSX.cfg file. "

    It seems each file defines an autogen complexity level (min = low, mid=medium, etc). So when you want to create a new class/group you must define in those files what objects will appear in each level.
     
  3. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    No undoing will occur if you add and remove only your own classes and models.

    For example, after decompiling a users file from .spb to .xml, one could use an automated method to add your own classes via a text-based search.
    Any classes that were added by another developer will remain.
    On uninstall it is simply a matter of restoring a backup or removing the text again via search.
    There are tools as well to recompile from xml->spb.

    While I have not completely automated the process yet, I have done it before.
     
  4. simulondo

    simulondo

    Joined:
    5 Dec 2011
    Messages:
    38
    Country:
    spain
    Well, finally I got it:

    I´ve been playing with some cubes as vegetation autogen and their seasonal variation:

    Spring:
    [​IMG]

    Summer:
    [​IMG]

    Winter:
    [​IMG]


    I can also confirm, at least to me, It only works modifying the default .xml (AutogenDescriptions.xml/ / AutogenDescriptions_mid.xml / AutogenDescriptions_min.xml). I´ve tried to call the objects with my own .xml without success.

    The workflow is very basic:

    1) Create a library objects with all seasonal variations. I´ve done it with Arno´s library creator:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <FSData version="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bglcomp.xsd">
    <ModelData sourceFile="spring.MDL" />
    <ModelData sourceFile="summer.MDL" />
    <ModelData sourceFile="fall.MDL" />
    <ModelData sourceFile="winter.MDL" />
    <ModelData sourceFile="hard_winter.MDL" />
    </FSData>
    
    Each model has his texture, I´ve set them without shadows and vertical normal in MCX.

    2)I call the models from the .xml´s in the tag <Autogen.SeasonalModels>
    Code:
    <ModelEntry id="{45d5eb92-bdc4-455c-8444-7cff5c9c9e53}">			
    	<FriendlyName>TestTree</FriendlyName>			
    	<IntersectionThreshold>0.000</IntersectionThreshold>			
    	<MinScale>0.900</MinScale>
    	<MaxScale>1.100</MaxScale>			
    	<SeasonEntry>
    		<ModelGuid>{951a9432-e216-40a3-8655-b6832aa0349d}</ModelGuid>
    	</SeasonEntry>
    	<SeasonEntry>
    		<Season>FALL</Season>
    		<ModelGuid>{b96118ea-269f-4fca-bf1e-e5fee68eb3bd}</ModelGuid>
    	</SeasonEntry>
    	<SeasonEntry>
    		<Season>MILD_WINTER</Season>
    		<ModelGuid>{91d315d7-5bca-4393-9904-83481d302768}</ModelGuid>
    	</SeasonEntry>
    	<SeasonEntry>
    		<Season>HARD_WINTER</Season>
    		<ModelGuid>{5f67ca19-7574-4319-963f-0eeb9a76cf79}</ModelGuid>
    	</SeasonEntry>
    	<SeasonEntry>
    		<Season>SPRING</Season>
    		<ModelGuid>{dc34c3b3-82e4-4cc7-b702-aec21c316732}</ModelGuid>
    	</SeasonEntry>
    </ModelEntry>
    
    I have not found in the SDK what is the tag <IntersectionThreshold>. As you can see the summer variation is setting as default season.

    3)And last create a group in the tag <Autogen.AutogenGroupings> to call the model:
    Code:
    <Grouping id="{a2ec468e-0521-48d3-b374-cf3d0b9e7510}">            
    	<FriendlyName>GRUPOPRUEBA</FriendlyName>            
    	<ReferenceEntry>
    		<TargetGuid>{45d5eb92-bdc4-455c-8444-7cff5c9c9e53}</TargetGuid>
    		<RelativeWeight>10.000</RelativeWeight>
    	</ReferenceEntry>            
    </Grouping>
    
    I call the model using his GUID.

    One more thing, I´ve created the GUID´s of group and ModelEntry using http://www.guidgen.com/.

    Later you can add all these objects in the Anotator without problems.

    I put the library and the textures in my own folder, inside addon sceneries, and works correctly.

    Now, I must to learn c++ to create my own installer to modify the xml´s :(
     
    Last edited: 21 Mar 2013
  5. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,514
    Country:
    netherlands
    Thanks for sharing. I am eager to try it out myself.

    Good to know spb and XML can be easily converted. Then a installer only would have to take care of that indeed.
     
  6. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    Right; that is the basic workflow.

    Also note that the AutogenConfigEditor.exe will do all that XML editing for you automatically when you are first creating your new groupings and model entries (I find I get confused between copying and pasting grouping GUIDS and model GUIDS quite frequently:confused:).
    One need only take the resulting new XML code to add to the end user's autogendescriptions file.

    I experimented with teaching myself scripting a few years ago to automate my tasks. Worked well.
    It's about time I dust of my programming skills and get back into Delphi Pascal (and maybe even C++ :rolleyes:)

     
  7. simulondo

    simulondo

    Joined:
    5 Dec 2011
    Messages:
    38
    Country:
    spain
    Yep, but sadly the autogenConfigEditor doesn't work in my W7 64bits :(

    On the other hand, I've been testing with other names for the xml definitions (AutogenDescriptions_xxx.xml and AutogenDescriptionsXXX.xml) but they don't work. It seems that FSX only will read vegetation definition in the AutogenDescriptions.xml or AutogenDescriptions.spb (but only one of them per time).

    Another potential "problem" is the decompile .spb files. The only way I´ve found it´s this tool: .

    Too much difficulties for this task.
     
  8. GaryGB

    GaryGB

    Joined:
    23 Dec 2005
    Messages:
    3,318
    Country:
    us-illinois
    The "official" relocated website for excellent and generous contributions to our FS Community by Lamont Clark (aka "lc0277"), is now at:

    http://lc0277.gratisim.fr/


    Lamont's "other" software (including spb2xml : Decompiler for SimProp Binary (SPB) binary files to XML) ...is at:

    http://lc0277.gratisim.fr/software.html


    Hope this helps ! :)

    GaryGB
     
  9. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    True.... a potential problem, as any automated method would have to go through that spb2xml tool.
    But since I'm fairly sure it can be done via scripting, it shouldn't be to hard to do via C++ (if you have the patience :whiteflag).

    As for the autogenconfigeditor not working on your PC, might it be that it can't find a copy of "default.xml" in its own directory? I recall vaguely that that might be the cause of some errors.
     
  10. Flugwerk

    Flugwerk

    Joined:
    2 Nov 2007
    Messages:
    109
    Country:
    austria
    Any news to the AutogenDescriptions.xml/.spb edit/modify issue?
    My installer will have to modify this files when installing my scenery.

    It would be easy just to remove the .spb file because FSX uses the .xml version instead but this is not an elegant solution.

    Many companies just rename and copy their own files which is crap of course.

    Regards,
    Heinrich
     
  11. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,514
    Country:
    netherlands
    I haven't looked at it yet, but plan to do so soon, as I want to experiment with new vegetation types etc.
     
  12. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    Just when I thought I had mastered Autogen...

    Created all my models, created a custom tool to decompile-add/remove-recompile my own entries to the end users autogendescriptions.spb./xml files.
    Successfully released my product with custom autogen.

    Now I'm back to update it with a few seasonal models... THE MODELS WONT CHANGE WITH THE SEASONS!!! ARGGG!!!

    The methodology is identical to that of the SDK and the code is identical to Simulondo's! Yet only the summer model is showing up no matter the season.

    What could I be missing?
     
  13. jtanabodee

    jtanabodee Resource contributor

    Joined:
    16 Jan 2008
    Messages:
    3,122
    Country:
    thailand
    Deleted..... sorry wrong posted.
     
    Last edited: 6 Nov 2013
  14. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,514
    Country:
    netherlands
    Did you add all seasonal models to your vegetation definition in the xml?
     
  15. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    Yes. Fall, spring, and winter. All have different GUIDs.
     
    Last edited: 7 Nov 2013
  16. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,514
    Country:
    netherlands
    Can you maybe show the part of the XML where your custom autogen is defined? Maybe we can see what is wrong from it.
     
  17. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    The model entries.

    Code:
    <ModelEntry id="{77e9e830-4f8d-45a4-9826-0646b85c5424}">
                <FriendlyName>rs_ag_tgpygrass1</FriendlyName>
                <MinScale>1.000</MinScale>
    			<MaxScale>1.000</MaxScale>            
                <SeasonEntry>
                    <ModelGuid>{a2e9d243-9997-4600-a74a-50f2e48df658}</ModelGuid>
                </SeasonEntry>
                <SeasonEntry>
                    <Season>FALL</Season>
    				<ModelGuid>{4EE00D65-967B-46D5-B6E6-86DC0CDF11FA}</ModelGuid>
                </SeasonEntry>
                <SeasonEntry>
                    <Season>MILD_WINTER</Season>
                    <ModelGuid>{E03B12E7-2482-458E-8239-9EC1CC1921A5}</ModelGuid>
                </SeasonEntry>
                <SeasonEntry>
                    <Season>HARD_WINTER</Season>
                    <ModelGuid>{E03B12E7-2482-458E-8239-9EC1CC1921A5}</ModelGuid>
                </SeasonEntry>
                <SeasonEntry>
                    <Season>SPRING</Season>
                    <ModelGuid>{E78C2A54-2350-43E8-94CB-00C98C364167}</ModelGuid>
                </SeasonEntry>
    </ModelEntry>
    
    The grouping.

    Code:
    <Grouping id="{e8aebdf5-0d8c-4d8b-9924-42e67288fd86}">
                <FriendlyName>rs_ag_tgpy_grass1</FriendlyName>
                <ReferenceEntry>
                    <TargetGuid>{77E9E830-4F8D-45A4-9826-0646B85C5424}</TargetGuid>
                </ReferenceEntry>
            </Grouping>
    P.S: I've verified that this is the file FSX is using. If I change the summer GUID to some other object, the autogen changes, but once again, remains the same throughout all the seasons.
     
    Last edited: 10 Nov 2013
  18. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,514
    Country:
    netherlands
    Hummm weird. The code looks fine indeed. That's the same I did with my own models when I tested the seasons.
     
  19. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    It MUST be an in sim issue. I'll test on another machine and get back to you all later with results.
     
  20. MOUSY

    MOUSY Resource contributor

    Joined:
    14 Aug 2008
    Messages:
    349
    Country:
    dominica
    Came back to it and I believe I may have remembered the issue. It's that triangle limit you discovered in this thread, Arno.
    http://fsdeveloper.com/forum/threads/autogen-and-drawcall-batching.425904/#post-637594
    My object seems to be too complex to be autogen.
    Also, it appears, that even if one of the seasonal models are complex and the others are simple, no season will be displayed. I may be wrong, but that is what my tests show. (One seasonal model with 5000 triangles, the others with 100).
     

Share This Page