Jump to content
Sign in to follow this  
Taildragger

Library bridge problem

Recommended Posts

I'm trying to create a bridge using multiple GUID objects from the library. Problem is of course piecing them together to properly align and form a seamless bridge. Even with an FS9-linked scenery placer like Runway 12 this is a tedious trial-and-error process.I realize it would be easier to make a VTP line bridge, but the style selection is limited and simplistic. The real bridge is a truss design, very similar to the library gen_bridge01.In the thread below Arno posted a clever API macro that automates stitching together a desired number of GUID segments.http://forums.avsim.net/dcboard.php?az=sho...13851&mode=fullBut that thread is nearly two years old, and I keep reading in the forums that we should be getting away from using APIs. So does anyone know of a similar method for building a multi-segment GUID bridge in xml?John

Share this post


Link to post
Share on other sites

Hi John,That FreeSC API was indeed an experiment I did a long time ago.In the XML code you could try to use the Bias option to move the brdige a certain amount of meters. In that case you only need to know the length of one library segment. You don't have to set the lat/lon of each object in that case.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest artmartin

Arno, I'd think that would make creating bridges easy if they are aligned horizontally or vertically but what if they're not? Seems like aligning multiple segments would be a huge problem there. Do you or anyone else know a good source of basic GMAX bridge objects that are available that one could easily alter the dimensions of? What objects does FS use for their bridges? Do they include generic bridges or are they all individually defined?Art Martin

Share this post


Link to post
Share on other sites

Hi Art,I would have to check it, but I think it would be logical that all objects that you place inside the SceneryObject with the Bias commands take the heading of the SceneryObject they are in. But as I said, I have not tested it :). So then the heading should not be a problem.Apart from specific bridges, like the Golden Gate bridge, most default bridges are placed as VTP line. In the terrain.cfg file you can find the library objects that are used to form these bridges. There is one object for a normal segment (with a certain length) and another object that has the ramp for the ends of the bridge. The scenery engine combines these objects to get a bridge of the required length.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno,Thanks -- that's a good idea. Now how do you find the length of a library segment? I don't see anything in the SDK documentation. Is it possibly buried in the GUID numbers?Also, once the segments have been pieced together, can the whole bridge be converted into a single custom object that could then be moved and aligned to the right heading as a unit?John

Share this post


Link to post
Share on other sites

Hi John,I am afraid you will still have to find the length by trial and error (that is also how I did it with that API I worked on some time ago). I don't think it is listed anywhere.I think if you collect all the Bias/LibraryObject commands in one SceneryObject command, you should be able to move and rotate it by changing the properties of the SceneryObject command. But that is something that I have not yet tested. To place it in another location you would need to copy the XML copy.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

I did take another look into this issue and it is not as hard as I wrote before :).If you look in the terrain.cfg file, you will see that the length of the different segments is also listed there. So that makes our life easier.Here is a little example of XML code to place three segments next to each other:[tt][/tt]Unfortunately rotating does not really work :(. You would have to calculate the correct BiasXYZ with the rotation, as setting the heading does not rotate the BiasXYZ command with it.Maybe it is time for another little tool to do the calcuations for you :).


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Ah, fantastic! That greatly simplifies things. Much obliged for the help, Arno.Rotation then is the only problem. Sure would be nice if the whole collection could be compiled into a single object.John

Share this post


Link to post
Share on other sites

Oops -- I'm getting compilation errors.-----------------------------------------------------Parsing document: BridgeTestArno1.xmlERROR C2033: XML Parse Error (line, column, error)ERROR: 21, 13, Element content is invalid according to the DTD/Schema.Expecting: LibraryObject, Effect, Trigger, Windsock, AttachedObject, GenericBuilding.ERROR: Schema errors detected, compilation failed!------------------------------------------------------The FS2004BGLCompSDK.doc has this on page 9:"Note: unlike previous versions of BGL there is only one object allowed per placement."Does this mean both a BiasXYZ and a LibraryObject cannot be included in the same SceneryObject?Sure enough, when I remove the BiasXYZ code, the compilation works.John

Share this post


Link to post
Share on other sites

Hi John,Yes, each combination of BiasXYZ and LibraryObject must be in its own SceneryObject command (like I did in my example code).When you try to put more in one SceneryObject command you get an error.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

I'd did exactly this by using sbuilder. Luis' program allows you to define a "footprint" for the object at a given scale. This gives you WYSIWYG GUI functionality, allowing you to cut and paste iterations of the bridge segments until you've made the bridge you like...you can then make curves and such as you'd like. Of course, it's still manual, but it works very well.Here's the 7 mile bridge I created for our upcoming FREEflow Ultimate Florida scenery:The project in SBuilder aligned to a satellite photo (the little yellow squares are actually unresolved in this screen shot - they match the size of each segment of the bridge exactly, allowing a tiny bit of overlap with each segment):http://cobweb.dartmouth.edu/~gridlock/NewSevenMile-SB.jpgAnd the bridge in the sim (gotta get a daylight shot, sorry!):http://cobweb.dartmouth.edu/~gridlock/NewSevenMile-FS9.jpgHope that helps...sg


I7-7700k@4.7ghz | 32gb RAM | EVGA GTX1080 8gb | Mostly P3Dv5 (also IL2:BoX, DCS, XP11)

Share this post


Link to post
Share on other sites
Guest artmartin

Man that seems like a ton of work. Sure seems easier to create a basic bridge object, stretch it to the desired length in GMAX, and export it back out. Then you're working with a single object which can be rotated, raised up and down, scaled, etc. Of course my GMAX experience consists of opening the program, loading in one of the sample objects, rotating it a bit, and closing the program so I may be way over my head here. FS does have some really cool bridge segments and I've built one bridge by hand with them but it was EW aligned and if I overlapped a tiny bit it didn't matter. It all flowed into one long shape. However, I found that in real life the bridge was slightly off of pure EW and trying to angle and offset all the objects was a royal pain. Your solution above is truly doable but I'm the eternal lazy programmer. If I can do something once and reuse it over and over I go for that every time.Art Martin

Share this post


Link to post
Share on other sites

That was just the end point of that saga, too! ;)You know - learn as you go...I first decompiled bridges.bgl to xml using NewBglAnalyze, then used SceneGenX to search the xml for the GUID of the default FS9.1 object for the seven mile bridge, then move it. But, in the end, it turned out that the object had it's bends in the wrong places, and I just wasn't satisfied with the aligment with the very accurate land.Once I found the footprint thing in SBuilder, and found that you could select a couple of objects, and cut and paste them, it took me an hour or two to build the two bridges above. Figuring out GMAX would have taken MUCH longer!Best,sg


I7-7700k@4.7ghz | 32gb RAM | EVGA GTX1080 8gb | Mostly P3Dv5 (also IL2:BoX, DCS, XP11)

Share this post


Link to post
Share on other sites

Hi Arno,Sorry, I did not explain that well. The compiler (bglcomp.exe from the 2004SDK) gives the error I reported above unless the BiasXYZ statements are removed from EACH of your three SceneryObjects.The complete (uncompilable) xml is attached. I pasted your sample code directly into the headers. Removing the three Bias lines allows it to compile.The explanation in the SDK.doc seems a bit confusing:----------------"The object types (and sub-elements) allowed within a SceneryObject are as follows:BiasXYZEffectGenericBuildingLibraryObjectModelDataTriggerWindsockNote: unlike previous versions of BGL there is only one object allowed per placement."-------------------So is a "placement" the same as a single SceneryObject element? If so, it would indicate that each SceneryObject can have either a BiasXYZ or a LibraryObject, but not both.Am I interpreting it wrong?John

Share this post


Link to post
Share on other sites

Hi John,The code I posted here compiles fine on my PC. So could it be that we are using different versions of BGLComp or so? I am using the one from the latest BGLComp SDK from MS.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...