Jump to content
  • andisart
    andisart

    Custom building foundations in 3DS Max

    Custom building foundations in 3DS Max

    Tutorial level: Intermediate; general knowledge of BAT creation and modding required.

    There are two effective methods to create custom building foundations in 3DS Max.

    The first is creating building foundations the traditional way in the same fashion they work in the game (assigning a foundation model as a foundation in the Pluginmanager (PIM)), the other is using building and foundation as props.

    Both methods have their pros and cons:

    Traditional method

    + automatic matching of building and foundation in game

    + convenient to use in PIM when creating the lot

    - nightlights not possible for foundation (which then can create abrupt breaks if lights in scene illumine both building and foundation)

    - not suited for cases where LODs of building and foundation differ (impossible to match foundation to building in Lot Editor (LE))

    - possibility of a bug occuring requiring manual texture ID fix

    Method using props

    + nightlights on the foundation possible

    + foundation can extend beyond building as both can be matched manually in LE

    - matching process not 100% clean if LODs differ

    - extra step in lot creation needed: since building and foundation work as a prop, an empty object needs to be assigned as the actual building

    - if slope is too steep, slope can move into building because it functions as a prop. More finetuning in slope settings of lot required

    ___________________________________________________________________________________________

    Traditional method

    Create building and foundation as separate geometry.

    Make sure foundation geometry does not exceed ground level (0 on Z axis).

    tut_simple_zpsfd1ee990.jpg

    Render seperately. When creating the LODs, make sure they sit on top of each other and have the same width and length (height can differ).

    If they don't building and foundation will not line up later in the game.

    Foundation LODs may not exceed ground level (0 at Z axis).

    tut_LODs_zps6651c4ec.jpg

    When rendering the foundation LODs in gmax, make sure to select the option for "Foundation" in the BAT options tab:

    tut_BATparameters_zps388c879a.jpg

    It is not necessary to render the nightview of the foundation, since nightlights don't work with this method anyway.

    Render building as normal.

    After rendering, assign the foundation model as a "Foundation" in the PIM:

    tut_pim_zpscc9b024c.jpg

    Afterwards assign the building model to a building type of your choice.

    In the properties options under the Advanced tab you can now select the building foundation you created before:

    tut_pim_fndt_zps723014a8.jpg

    When creating the lot in the LE you can just create your lot normally, the building foundation is already assigned to your building through the PIM.

    There is an option to change the foundation within the LE, however, when I tried that it didn't work properly, so better leave that option alone.

    Lastly, you need to make sure the lot can actually have a slope in the game. As an orientation: for the example model with a foundation of approx. 3m depth a good value for the threshold is 8. This is subject to fine-tuning.

    In the game it should then look like this, left on flat and right on slope with foundation:

    tut_flatslope_zps8b81a5eb.jpg

    You should be done!

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Possible bug:

    If you don't see the foundation but instead just green, blue and red colors then the beforementioned bug hit you.

    In this case the material IDs of the foundation model need to be corrected. They need to say 0x00030xxx, and not 0x00031xxx or anything else.

    You can find the ID's in the Reader in the "Mats" tab of the S3D files of the model.

    Note: Every S3D file has to be fixed.

    tut_s3d_zpse791f6a3.jpg

    ___________________________________________________________________________________________

    Method using props

    The two advantages of this methods are nightlights and the possibility of having differing LODs between building and foundation.

    The following model has a foundation that is wider than the building and a nightscene which illumines the foundation as well. So this method is the prefered choice.

    Foundation extends beyond building:

    red_single_fdt_zpsd2766ffc.jpg

    Nightlights shine on the foundation (stairs going down), windows lit on foundation:

    tut_rednite_zps4f1623bf.jpg

    LODs of foundation and building have different footprint:

    tut_2LODs_zps2ed84930.jpg

    You start off as with the traditional method above with separate geometry and LODs for your building and foundation.

    However, the foundation LOD and geometry must be slightly below ground level, otherwise there will be glitches with the base and overlay textures on the lot. A value of -0,01 meters on the Z axis will work (values below that don't seem to work without glitches).

    During the rendering process there are the following differences:

    - you render the foundation LODs in gmax without the "Foundation" option ticked, that is as a normal model.

    - if foundation extends beyond the building footprint: when rendering the foundation leave the building in the scene to avoid false lighting of the extened foundation parts (if building not present the correct shadows cant be cast onto foundation parts).

    - if applicable, also render the nightscene of your foundation. As with for the dayscene inlcude the building as well, especially all lights shining onto the foundation

    In the PIM assign both models as props with the necessary options. Important here are to set IsGroundModel and QueryAsMainBuilding to true for the building model.

    (Note: Options changed for foundation were only Lights and AppearanceZoomsFlag. Changing other options hasn't been tested for foundation.)

    Now, because our building is a prop, we need a blank model that serves as the acutal building exemplar.

    For example create a small cube with LODs, then before rendering delete the cube and render LODs only.

    Use this blank model in the PIM to assign to the building type you want your lot to be.

    In the LE replace building with the blank model:

    tut_LE_zpsa18b9613.jpg

    Then add foundation and building props.

    tut_LE2_zps250d19f7.jpg

    In order to be able to allign the props you need to remove the base and probably the overlay textures as well.

    It's a bit tricky to match the two, if not impossible to perfectly allign. What helps is to not emphasize vertical elements between building and foundation. So it's advised to make the design so that the foundation is more independent from the building, i.e. without vertical elements reaching from building down to foundation.

    On the other hand, if your LODs have the same width and length the matching process is very simple in LE, just allign them on top of each other and it will look perfect in game.

    After adding base textures back, the foundation should be completely covered like this:

    tut_LE3_zps4eff13e3.jpg

    When you're done with the LE you can mod your lot as usual.

    Important here:

    • in order to avoid any Maxis foundations from showing change the foundation ID in your lot to 0x194B1000.
    • as with the above method you need to finetune the values for maximum lot slope. Again, a good starting point is threshold value 8. This is the more important since with the building as a prop the slope can reach into the building if it's too steep, which will not like so nice

    You should be done!

    In the game it should look something like this:

    tut_rednite2_zps4338f2b6.jpg

    ___________________________________________________________________________________________

     

    Special thanks to Aaron Graham, c.p., callagrafx for their help


      Edited by andisart  


    Sign in to follow this  
    Sign in to follow this  

    User Feedback




    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 to join our friendly community. It's easy!  

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×

volume5_md.pngURGENT! We need your help!

We urgently need your help to meet our September goal!

Please consider a donation today.

We need to continue to raise enough money each month to pay for expenses which includes hardware, bandwidth, software licenses, support licenses and other necessary 3rd party costs.

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation goes to help us keep the site running free.

Enjoy the site!

OK - See STEX Collections