Home Technical Talk

Anyone using 3ds max Xrefs to build levels?

I'm looking into using 3ds max as a game level editor, and am examining the particular task of laying out a very long trench level. It'll be made out of a library of instanced trench segment pieces, snapped into place by hand, and populated with instanced NPCs.

I'm imagining that at some point the scene is going to get messy... file size will balloon, navigating the viewport will get slow, etc.

So I'm looking into using Xrefs to reduce the overhead, by using simplified proxy meshes to help arrange the actual trenches/NPCs. Our engine allows replacing one object with an object in another file, so I figure I might as well use Xrefs at the same time.

Is anyone actually using Xrefs right now, or has used them in the past, and could shed some light on possible pitfalls?

Replies

  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    We used Xrefs on Daredevil. It might have been a problem with the older versions of max (we used 4.5/5 on Daredevil), but we ran into some issues with Xrefs. There seemed to be a lot of problems with the objects updating correctly, when you edit the external source file. We constantly found ourselves having to re-xref the objects again.

    Now, I'm simply merging stuff in, and instancing from there.
    I never messed around with Proxy objects though, so that's a grey area for me.

    As far as file sizes getting huge, there is a trick I learned that helps size it down pretty damn well. If you notice your scene file is sitting at 26MB or something crazy, do the following to cut it down in size (in order):

    open file > Xref Objects
    - Close the window
    open file > Xref Scene
    - Close the Window
    In the listener window in the bottom of 3dsmax, type "gc()" minus the quotes, then hit enter. Resave the file.
    On average, I saw a huge file size drop. One scene in particular dropped from 25.5MB, down to 4.6MB.
    This apparently has something to do with the way max handles merged/xrefed materials and objs. The "gc()" command is simply a legacy MS command for "garbage cleanup".

    Hopefully this helps ya a bit.
  • Eric Chadwick
    This is great, much appreciated!

    I searched around the Discreet forum and noted the file size bug is still around in v7. There also seem to be some other issues people are having, like illogical circular dependency errors, duplicate xref listings, file corruption, etc.

    Hmm. Well, I still think I might need to Xref to keep complexity low. If it bites me in the ass later, I guess we could just write a script to convert them into regular instances.

    Or maybe I'll just use our engine's ability to Xref on its own... I could use low-detail proxies in Max, without Xref-ing, and have the game replace them. Hmmm, food for thought.

    Thanks again!
  • ScoobyDoofus
    Offline / Send Message
    ScoobyDoofus polycounter lvl 19
    The NetImmerse (now Gamebryo) engine used in Freedom Force used 3ds max for level authoring, and it used Xrefs.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Heh, we're using Gamebryo for our game wink.gif
    It's a pretty good engine for the price. It has it's shortcomings, though. I'm not using Xrefs in Gamebryo though. I'm just merging the objects in.
  • Eric Chadwick
    From all I've been reading, I'm going to avoid Xrefs. I'll just rely on our engine to do that for me, since that works just fine. Won't be able to do preview renderings in max, but that's no biggie.

    Thanks for the insights.
Sign In or Register to comment.