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:
+ 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
Create building and foundation as separate geometry.
Make sure foundation geometry does not exceed ground level (0 on Z axis).
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).
When rendering the foundation LODs in gmax, make sure to select the option for "Foundation" in the BAT options tab:
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:
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:
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:
You should be done!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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.
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:
Nightlights shine on the foundation (stairs going down), windows lit on foundation:
LODs of foundation and building have different footprint:
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:
Then add foundation and building props.
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:
When you're done with the LE you can mod your lot as usual.
- 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:
Special thanks to Aaron Graham, c.p., callagrafx for their help
Edited by andisart