• Welcome to SC4 Devotion Forum Archives.

Custom Building Foundations created with Max?

Started by andisart, March 10, 2013, 02:05:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

andisart

hey all,

I'm currently creating some SC2013-style homes for SC4 and would like to add custom foundations to the lot.
However, I am using 3ds Max and that doesnt seem to work with custom foundations. I always get a display issue ingame:


Does anyone know what I need to do to fix it? It worked with a test model in gmax. But I would much rather prefer Max since my models are all done there (also due to the easy texture creation methods it allows).

Any help would be appreciated.

callagrafx

The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it

andisart


callagrafx

#3
Same as mine... When I get a chance I'll try a simple test, see if I can replicate

Edit:



Mine worked fine.  Have you got Max installed in Program files or have you installed it off the root C:?

You could try this: 

Delete all .sc4model files in plugins that relate to this foundation
Delete all .sc4desc files in plugins that relate to this foundation
Delete all .SC4LOT files in plugins that relate to this foundation

In Max,
Delete the XREF Scene
Manually delete the lightrigs (if they're frozen and hidden, use the layer window to unhide and unfreeze)
Make sure the TB2CameraHandle object is deleted too

Once you have a raw scene with no B4M elements (cameras or lightrigs), in the Let there be light rollup, click "Sky" then "Day"

Then in the preview rollup, select a camera view.  This will re reference the cameras and set the rig properly.

Now export the foundation LODs again.  Import them into GMAX BAT and export the model. 

Run BAT4Max as normal using this new model file.  See if that solves it.
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it

andisart

I have it installed in C: root, both Max and gmax.

I tried your suggestion and it was the same error.

Aaron Graham discovered that the material ID is wrong in the S3D files, instead of 0x00030010 and so on, they are 0x00031010... Changing them to the values that the FSH files have corrects the problem. I'd still like to know what the issue is, as it is a manual process to correct it.

Here's the model file, if you wanna have a look: http://www.mediafire.com/?95pkn0in5qjqjk1

Just a weird thought, but could it be that I made the file name too long?

callagrafx

Quote from: andisart on March 10, 2013, 05:01:10 PM
Just a weird thought, but could it be that I made the file name too long?

That's a distinct possibility...
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it

Diggis

Quote from: andisart on March 10, 2013, 05:01:10 PM
Just a weird thought, but could it be that I made the file name too long?

Unless SF messed something up, that shouldn't be an issue. I've used some long names in my models with the last version from ChrisAddams without any issues. I have never done foundations however.

callagrafx

#7
The bmp to fsh is still handled via command line so there could be a character limitation issue... Foundations are handled just like any other model, you just need to make sure they're under z=0 and the model is assigned as a foundation in PIM or PIMX

Mine worked without any issues but the file was called test_foundation.  It could be an issue with characters (there's a $ in the file name).  The test would be changing the name of the gmax file and re-exporting
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it

andisart

I tried with a simple name and it was still the same issue. I also now tried it in 3ds max 2012, same error.
There is one wrong digit in the material ID instances of the S3D file, so it doesnt recognize the material IDs. Correcting the IDs fixes it.

Another question: are nightlights not funtioning with foundations? I noticed the Maxis foundations dont have nightlights. And the ones I rendered for my foundation dont show.

c.p.

#9
I just render the foundation as a regular model (not as a "foundation"), and then make a foundation exemplar with PIM, and finally, add a "Building foundation" property to the building exemplar, setting it to the IID of the foundation exemplar.

Nightlighting doesn't appear to work on foundations, but if you really want nightlighting, you can make the foundation and building as props with nightlighting.  If you do this, you'll want to use an invisible building on the lot.  I use the Maxis invisible model, Resource Key 0  0x5AD0E817,0xBADB57F1,0x0E110000.  Also, you should add a "Building foundation" property to this building exemplar and set it to 0x194B1000.  This will eliminate the game-generated foundation.

By the way, the house looks really nice  :)

callagrafx

Quote from: c.p. on March 16, 2013, 09:52:35 PM
I just render the foundation as a regular model (not as a "foundation"), and then make a foundation exemplar with PIM, and finally, add a "Building foundation" property to the building exemplar, setting it to the IID of the foundation exemplar.

That's what I did as well, should have mentioned that... sorry.  Another thought, did you use the updated modelnames.ms script file?
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it

andisart

Quote from: c.p. on March 16, 2013, 09:52:35 PM
I just render the foundation as a regular model (not as a "foundation"), and then make a foundation exemplar with PIM, and finally, add a "Building foundation" property to the building exemplar, setting it to the IID of the foundation exemplar.

Nightlighting doesn't appear to work on foundations, but if you really want nightlighting, you can make the foundation and building as props with nightlighting.  If you do this, you'll want to use an invisible building on the lot.  I use the Maxis invisible model, Resource Key 0  0x5AD0E817,0xBADB57F1,0x0E110000.  Also, you should add a "Building foundation" property to this building exemplar and set it to 0x194B1000.  This will eliminate the game-generated foundation.
Thanks for those tips! Havent tried the first one yet, but the second. Rendering the whole thing as a foundation does the trick with the nitelites, but what it does is that because it treats the whole building as a foundation the sloping doesnt stop at ground level (of the house) and that leads to some undesirable looks if the slope is too deep. I guess limiting the max slop value on the lot would help, but it kinda goes against the idea of having a foundation (that is really deep to allow steep slopes).

Quote from: callagrafx on March 17, 2013, 02:52:08 AM
Another thought, did you use the updated modelnames.ms script file?
Yes, I had updated it.

andisart

#12
For future reference I just wanted to add my final conclusions on this subject.
Basically I adapted c.p.'s aforementioned technique of rendering the building and the foundation each as a prop while using an empty object as the building in the lot.
This allows nightlights, which I think is really nice to have on the base as well.

What turned out important was to set the LODs of the foundation part to 0,01 meters below zero in the Z axis. Before I did that, the lot would show glitches in the overlay or base textures. Basically the foundation was mixing through where it wasnt supposed to be seen. Setting the LODs just below zero fixed that. Interestingly enough a value of 0,005 meters didnt do it, apparently wasnt enough.

Another finding is that it's hard or even impossible to perfectly allign vertical elements in the Lot Editor that reach down from the building into the base. I'm refering to the white mullions. So maybe it's best to make the design so that the foundation is more independent from the building.

This is the final house design, including the foundation (foundation level is the dark brown area).
Building and foundation have different size LODs.


This is the night view (dark nite)


And this is how it looks ingame



And lastly for comparison sake here a shot of the lot on all-flat terrain-
This is where the texture glitch would show promintenly before I lowered the LODs of the founation below zero.
Now there is a clean separation between the building.