Jump to content
Sign in to follow this  
arno

Best Implementation of Multiple Objects in FS

Recommended Posts

Greetings again everyone,I just have two questions regarding the use of clone objects in Flight Simulator.Specifically, I have an airport with three different types of Aerobridges/Jetways. These objects are used multiple times in the airport at different gates. The thing is if the objects are identical is there a way for me to somehow add the object to the library so that it only has to be created 'once' and the rest of the jetways refer to this object.What is the most economical way to add an object with multiple copies? Should I just be creating the whole thing in GMAX and during the export it will condense it down or should I be creating one copy, and place this object multiple times in the scenery using a program like SceneGenX. Secondly, is there a limit in Gmax polygons for exporting to a MDL. If I create all my aerobridges and try to export I get errors (few different types). However if I delete some of them it exports fine. I've double checked and experiemented and its not any specific object that causes the problem, but the number of objects itself.Hope you can help. Thanks.Jeremy

Share this post


Link to post
Share on other sites

Hi Jeremy,>What is the most economical way to add an object with multiple>copies? Should I just be creating the whole thing in GMAX and>during the export it will condense it down or should I be>creating one copy, and place this object multiple times in the>scenery using a program like SceneGenX.That is certainly the best approach. Create a model of your gate in GMax and then include the MDL object in a library. After that you can place it as often as you want on your airport.The process is the same for objects you use once btw. They also contain of a MDL file that gets a GUID attached to it (in the XML code). After that you place a copy of that object by calling the GUID. You can simply call this GUID multiple times if you want more copies of a certain object.>Secondly, is there a limit in Gmax polygons for exporting to a>MDL. If I create all my aerobridges and try to export I get>errors (few different types). However if I delete some of them>it exports fine. I've double checked and experiemented and its>not any specific object that causes the problem, but the>number of objects itself.I don't know if there is a hard limit, but there is a size limit on some of the sections (for example platforms, animation tables, etc). Does the error message or the log file maybe provide more information on the reason of the 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

Thanks for your reply Arno,>I don't know if there is a hard limit, but there is a size limit on >some of the sections (for example platforms, animation tables, etc). >Does the error message or the log file maybe provide more >information on the reason of the error?Well I get two errors on bascially all my objects if I duplicate them too much, (kind of a blessing in disguise actually because it forces me to use SceneGenX). Mainly these two:* Found colocated vertices within triangle* Jetway_0.asm(65534) : error A2071: initializer magnitude too large for specified sizeI only bring it up as it occurs only if I duplicate my aerobridge say 10 times and try to export for example, 1 Copy = fine, 4 copies = fine, 10 copies = errors.>That is certainly the best approach. Create a model of your gate in >GMax and then include the MDL object in a library. After that you >can place it as often as you want on your airport.I'll use SceneGenX to place my objects. One thing I've noticed though is that when you import an object it only shows like a 'box' for the object. How does one go about aligning anything if all you can see is a box?I'm praying its not trial and error with coordinates and heading changes.Once again I really appreciate your helpJeremy

Share this post


Link to post
Share on other sites
Guest Bell206freak

Here's a suggestion. It's one I ended up doing for Sanderson Field since I didn't want to fool around with heading and coordinate trial-and-error hassles.What you should do is create a separate *.MDL file for each jetway with a different coordinate. I know what you're thinking, this is something that sounds hard, but it's actually not since you can incorporate each separate *.MDL data into one single scenery *.XML base file.Make sure the center of your object (or close to it) is at the 0,0 reference point in gMax. Then, rotate the object in gMax to the right heading it should be in FS, then select the entire thing and export it as normal. Save the *.MDL file and copy the data, namely the *MDL data in the XML file to a master XML file.It's a method I used to create my tacoma Narrows Bridge scenery object also. I'm away from my FS design PC right now, but when I get to it I'll save a copy of the XML source code so you can have a peek at how I did it.

Share this post


Link to post
Share on other sites
Guest Bell206freak

Another suggestion I just came up with is to try this...Do what you were doing before. (creating them all in one gMax file).But, when it comes time to export, only export them in chunks. For instance, if you have, say, 25 jetways in one gMax file, only export as many as you need to prevent you from getting export errors.Continue exporting them in chunks until you have all of your jetways exported. Next, compile the *.MDL data in the separate XMLs into a master XML file. This XML file will be the one used to create a part-object library/part scenery object BGL file. Here's an example of what the code should look like. For this, I finally accessed my FS design PC and copied a small chunk of master code for my Tacoma Narrows Bridge scenery replacement object. I call the same location for each separate object (this is necessary for two reasons. One, when you export, be sure to click "Export Selected" and then export your chunks, and for two, it aligns everything up perfectly in the final result.The top half will call all of the locations for your selected *.MDL files, and the second half contains a built-in object library.<?xml version="1.0"?>

Share this post


Link to post
Share on other sites

Thanks for your reply,I'm a little confused. How exactly does Gmax export a scene to FS?If there are multiple identical objects in the Gmax 'Scene' and it is exported are all the objects merged and the whole scene seen by FS as a single 'object'.Forgive my lack of understanding but your suggestion to export it in chucks would work from a practical sense, but wouldn't that also be a bit of a waste of frames. What a mean is say I export a scene with 12 aerobridges, wouldn't those 12 identical objects be individually created as part of that single 'object', instead of say creating the object once and calling it at different locations, or would there not be any difference in performance.If creating an airport and exporting it in chucks is the same I'd much rather do it that way than create a single object and import it and orient it multiple times.I'm new to Gmax and the whole export concept so you'll have to excuse my confusion.

Share this post


Link to post
Share on other sites

If you export from GMax everything is indeed seen as one big object. Also performance wise and that is no good. This means that all your object will become visible at once. Therefore it is much better to have only one gate in your GMax file and do the placement of different copies in the XML file.If you do the copying in GMax you will hurt the performance, as all end up in one big object. Even using export selected to export only a part does not help, as all objects will still have the 0,0 point of GMax as their origin. To get optimal performance you want the origin to be as close to the center of the object as possible.So I strongly advice to make only a single gate in GMax and do the placement of additional copies with the XML file. I did it with my own gates as well. Just make sure you choose an easy point for the origin and then it should not be too hard to place the different copies with a tool like Rwy12 or ObPlacer XML.


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

Just to add my $0.02 here, the XML approach is quite flexible. I have a rather large structure in GMAX, which I saved in 3 different sections, so that I have 3 different GMAX files. They are all part of one large structure though, so they are all interconnected.My XML file contains 3 entries to the identical location (as all 3 objects have the same origin) and 3 MDL file calls (for each of the sections). The XML file creates one BGL out of these 3 MDLs ...it works quite well. Even the CAT animation is in sync with all the objects from different MDLs.Which begs the question - is this the most efficient approach, or would 3 different BGLs work better?


P3D SpacePort Team

Share this post


Link to post
Share on other sites

Hi Misho,No, I don't think 3 BGL files is more efficient. It is probably even (slightly) less efficient, as the scenery engine would have to read more files from disk.Each MDL object already has his own visibility distance, etc. So for the performance that is about as optimal as you can get it. The only way to improve it would to give each object its own reference point and to not use the same for all three objects (as discussed above). But for some specific conditions using the technique you use might indeed be easier.


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...