SC4 Devotion Forum Archives

Sim City 4 Devotion Tools => Tools - General Discussion => Topic started by: mrbisonm on May 08, 2014, 06:07:29 AM

Title: Underground BATs Problems
Post by: mrbisonm on May 08, 2014, 06:07:29 AM
I am styill working on my MFP1 Project and slowly drawing to an end, but as usually, I always face new problems as I continue to expand propset. Here I realized that some BATs that are fully or partially underground have a strange shadow problem as shown in the picture below. It seems that double shadows appear on these models, opposite of each other.
Now, I did the very tight LOD modeling, so tight you wouldn't be able to slide in between a papersheet, then making several different renders and nothing changed. As soon as something gets underground it has 2 shadows, and when I keep the LODs only above ground, I loose a lot of details of the inside of these liquid manure tanks.

Is there anything else that I could do that I haven't tried? Turning off the shadows with the Reader doesn't look good at all.
Using gmax.

Thanks
Fred

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fs28.postimg.org%2Fi5o63jsod%2F532455.jpg&hash=1419e50316c70c74cb23628611473bc8fd747f3c)

Title: Re: Underground BATs Problems
Post by: Rayden on May 08, 2014, 06:14:07 AM
I can't remember very well but I think you can tackle that on the prop properties under the isGroundModel section. I think you have to put false on that or the opposite, can't remeber very well. Just give it a try, I'm at work so I can't do anything to help you more.
Title: Re: Underground BATs Problems
Post by: memo on May 08, 2014, 06:14:54 AM
I honestly am not a BAT expert (not even an amateur), but maybe this post (http://sc4devotion.com/forums/index.php?topic=15500.msg454265#msg454265) by Jasoncw is of some help in clarifying the problem.
Title: Re: Underground BATs Problems
Post by: FrankU on May 08, 2014, 07:14:10 AM
Quote from: Rayden on May 08, 2014, 06:14:07 AM
I can't remember very well but I think you can tackle that on the prop properties under the isGroundModel section. I think you have to put false on that or the opposite, can't remeber very well. Just give it a try, I'm at work so I can't do anything to help you more.

If you change the "Is Ground Model" property to "false" all shadows are put off. So indeed, th undesired shadow disappears, just like the desired one.  :(
Title: Re: Underground BATs Problems
Post by: c.p. on May 08, 2014, 07:50:41 AM
If you slice the model in half, so the above-ground section and below-ground section are separate models, then you can use IsGroundModel=true for the part above ground, and IsGroundModel=false for the part below ground.  In 3dsmax this is easy to do by selecting all the objects that cross the ground-plane, and adding a slice modifier.  I assume you could do the same in gmax, as it also has a "slice" modifier.
Title: Re: Underground BATs Problems
Post by: FrankU on May 08, 2014, 07:55:49 AM
Brian,

That might work, but it ruins my habit of making prop variation sets for my lots, because of course in most cases the upper half will not match the underground half....
Title: Re: Underground BATs Problems
Post by: c.p. on May 08, 2014, 08:21:34 AM
Good point.
I haven't experimented with it, but it's possible to put multiple models into one prop, using an RKT4.  When flora use an RKT4 with multiple models, the game will only use the shadows from one of the models.  I don't know what happens with shadows when you show multiple models simultaneously, via RKT4, in a prop.  Does it only show shadows for one of the models?  If so, that might be one possible solution.  (OK, that's a longshot, and probably more trouble than it's worth, but I thought I'd throw it out there).
Title: Re: Underground BATs Problems
Post by: Rayden on May 08, 2014, 09:39:31 AM
Quote from: c.p. on May 08, 2014, 07:50:41 AM
If you slice the model in half, so the above-ground section and below-ground section are separate models, then you can use IsGroundModel=true for the part above ground, and IsGroundModel=false for the part below ground.  In 3dsmax this is easy to do by selecting all the objects that cross the ground-plane, and adding a slice modifier.  I assume you could do the same in gmax, as it also has a "slice" modifier.


Thx for the info Brian, I didn't know how to solve that issue in one of my models. And as I work (modelling) with sketchup, I didn't want to go back to it and then had to retexture and lighten everything again in Max. ;)
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 08, 2014, 09:41:28 AM
Thanks Rayden, but like FrankU says, it also cuts off the "wanted" shadow. I tried this before and it didn't solve the problem, but creating another. :(

memo, nice try, but this didn't help me much neither, big Thanks though. ;)

c.p. ,I found the slice modifier in gmax, but I can't figure out how the darn thing works....and I am not sure that it will bring up a good looking 2 part model, since the inside of the tank may well get distorted because of the slice unless, there'a a "right way" to do the slicing, which I haven't found yet. Some detailed help on this would be appreciated. This is VERY new to me. ;)

Btw, what is RKT4?

Thanks sofar, everyone

Fred



Title: Re: Underground BATs Problems
Post by: MandelSoft on May 08, 2014, 09:52:21 AM
RKT4 = Resource Key Type 4. It's a object descriptor in SimCity 4 that allows multiple objects to appear as a group, e.g. streetlights. I think there are some tutorials on ST to cover that (can't explain it myself at this very moment).
Title: Re: Underground BATs Problems
Post by: xannepan on May 08, 2014, 11:15:52 AM
Not much time for sc4 these days :(

Don't use the slice modifier on your model. Use it only on your LODS. Then render twice, once for the upperpart, second time for the lowerpart (use different names). Create props for both models, turn off shadows for your lowerpart. Then combine the props on your lot. You can also instead of props create a building exemplar for the upper part and a foundation exemplar for the lower parts and make sure the building exemplar points to the foundation exemplar (can all be done in maxis pim)

Good luck!
Title: Re: Underground BATs Problems
Post by: c.p. on May 08, 2014, 12:12:42 PM
If you were willing to make that particular model a "building", xannepan's idea would be the easiest solution.  Also, he's probably right about slicing only the LODs.

Anyway, here's a little slicing tutorial for Fred.  The procedure would be the same, whether you are slicing LODs, or the model itself.

This is the foundation for a small elementary school.  Let's say I want to slice off the bottom at 8m, for some reason.
First I select everything that crosses the 8m depth.  Then I select "Slice" from the modifier list.
That gives me this:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FBapG4bz.jpg&hash=a60f8df535cdf41aaea111b0749207259fca95fa)

Then, I click on the + to the left of "Slice" (circled in red).
Then I click "Remove Bottom"

However the slice plane is not exactly where I want it, so it slices off too much of my model.

So I highlight "Slice Plane" (in the modifier list), I make sure the Move button is selected (circled at upper left), and then I can move the slice plane up or down to where I want it in the model views, without moving the model.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FR8AZJ6C.jpg&hash=59de71a588df548a4ac2167a6e355cc2108da301)

When done, you might want to click on "Slice" in the Modifier List, to unhighlight the "Slice Plane".


If you are slicing the model itself: the above-ground portion of your model might have pieces that need to cast shadows on the below-ground portion of your model.  What I do for the below-ground model is to keep some or all of the above-ground pieces, but assign them an invisible texture.  (0 opacity).   You can see in the above pictures that there is the ghost of a schoolhouse on top of the foundation.  It is there to cast shadows on the foundation.

One last consideration: when modding the below-ground portion, you should set the AppearanceZoomsFlag to 0x0000001c (or choose Zooms 3, 4, 5 if using the maxis PIM).  This is because BAT makes simple box LODs for zoom 1 and zoom 2, and it is likely to look worse than if you simply don't show the below-ground portion at that zoom level.

Later today, I might experiment with my RKT4 idea, to see if that will work or not.  (If it works, it might help me with some of my projects too.)  I'll let you know what I find.
Title: Re: Underground BATs Problems
Post by: cogeo on May 08, 2014, 03:00:46 PM
First off, the LODshell does not need to span underground. It can start at ground level, even if the scene contains object below ground level. Take a look at my Spirulina Farms pack, it contains a very similar model (the large tubs). Check the model in the reader, you will see that all vertical coordinates (Y) are at or above ground level (≥0). First check if this fixes the problem.

I have found a way to remove this effect, which I have named "negative shadow" (the "correct" shadow is always cast left to right as you view the model, for all four rotations). I have used it for some custom models for RTMT (subway entrances). Take a look at the pics I have posted in Frank's thread here (http://sc4devotion.com/forums/index.php?topic=9146.msg478743#msg478743). The white model is the fixed one. The procedure is very tedious unfortunately. Requires slicing out the parts of the model that do not overlap with the area defined as the projection of the LODshell on the (2-D) texture. These are different for each rotation, so the above procedure might be needed to be repeated up to four times for each model, and each one is exported separately; then parts of the exported models are combined into one (the final/fixed) model.
Title: Re: Underground BATs Problems
Post by: c.p. on May 08, 2014, 03:18:58 PM
lol, you're right.  I didn't look at that picture close enough. :-[  (Fred: Ignore everything I said in the previous posts).

I was successful with my RKT4 test though (i.e. one prop consisting of two models, with one of them casting a shadow, and one of them not.)  If that's of any use, I can post more info, but I think it's not what you're looking for here.
Title: Re: Underground BATs Problems
Post by: Rayden on May 08, 2014, 03:35:13 PM
This just come into my mind, we all know how to render offset models, what about render offset vertically, does that will solve the shadow issue? Say you offset the supposed underground part 8 meters, then on the LotEditor or PIMx pull the prop 8 meters down so the model would get underground, would that cast the weird shadow or not?
Title: Re: Underground BATs Problems
Post by: c.p. on May 08, 2014, 04:07:41 PM
I think it would.  Those shadows show up on an entirely above-ground model if the model is on a steep slope
and the LOD is cutting into the slope.
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 09, 2014, 08:03:34 AM
Why in the world didn't gmax fix that problem in the first place.....? Does 3DS Max have the same problem? And what if I import a 3ds model like this into gmax to render it, will it show that false shadow too?

Anyways, I don't really have the time right now to do all what you folks mentioned, but I surely will this weekend and back here with my results. I also will try some different ways that I have thought off in the last days, just maybe......although I am far from a 3d expert. ;)

Hope I 'll find a way to get rid of the "negative shadow" effect easily.

Fred
Title: Re: Underground BATs Problems
Post by: NCGAIO on May 09, 2014, 04:45:47 PM

Because this "false shadow" has nothing to do with any 3D editor or BAT ... this is not a bug but just the way the shadows were implemented to minimize the cost of processing that was vital at the time of the release of the game ( No commitment 3d) as well as all the other tricks that were used for the graphical part .


The post of Jasoncw (by memo link above) gives a hint of what is considered a bug also examined by Simfox on this other post HERE (http://sc4devotion.com/forums/index.php?topic=52.msg226919#msg226919) but could be better understood by reading of what says the Andrew Willmott  in link below.

"$Deal"$   - Height Map Shadows  (http://www.andrewwillmott.com/tech-notes)


Anticipating what this is about

Quote
Back in the SC4/TS2 was weren't powerful enough GPUs to the proper depth-tested que handled shadows self-shadowing. Projective (cookie-cutter) shadows were it, and even pricey Those Were ....

......
Another hack on SC4 was that building shadows were generated by warping sprite alpha masks from the lower LODs, which meant in terms of generation or additional storage, they were free.

So I think that can not be treated as a bug what one tries to do  skirting the way the game was coded to operate ... alias very common thing to many creators!
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 09, 2014, 10:39:25 PM
Call it a bug or whatever suits you, I don't care, but I think that the creators of gmax should have corrected this "thingie" which is quite annoying, but like many computer programs, unfortunetly nothing is perfect and functioning at 100%..........

I will be trying out a few things mentioned above tomorrow and get back.......

Fred
Title: Re: Underground BATs Problems
Post by: FrankU on May 10, 2014, 06:25:02 AM
Hi Fred,
Of course there is the option of making the models in such away that nothing is undergound, meaning that all silos and basins should be filled to just above ground level. Or you can just ignore the issue. We are used to several disadvantages of the game.
If you take a look at seaport lots and models you will certainly find several props casting shadows the same way. I know of several Pegasus seawall props. And there certainly are more.
Title: Re: Underground BATs Problems
Post by: c.p. on May 10, 2014, 07:09:42 AM
It's hard to tell in that tiny picture, but I don't think the models have to be changed at all.  Just make new LODs.  Either simple boxes or simple cylinders.  Make the top of the LODs flat all the way across.  Make the bottom of the LODs at ground level (z=0).  The game doesn't care whether the center of the gmax model dips below the ground plane or not.  It cares about the LODs.  Keep the LODs above the ground plane, and you should be fine. :)
Title: Re: Underground BATs Problems
Post by: vortext on May 10, 2014, 07:12:21 AM
Quote from: c.p. on May 08, 2014, 03:18:58 PM
I was successful with my RKT4 test though (i.e. one prop consisting of two models, with one of them casting a shadow, and one of them not.)  If that's of any use, I can post more info, but I think it's not what you're looking for here.

Actually, this seems like a rather neat solution to me. The sliced models could be re-assembled in RKT4 to have proper shadows whilst being slope friendly too. Moreover, Frank could still put the RKT4 props into families to his hearts content. Seems like a win-win to me really, unless I'm missing something. ?  &Thk/(
Title: Re: Underground BATs Problems
Post by: c.p. on May 10, 2014, 07:18:39 AM
Quote from: vortext on May 10, 2014, 07:12:21 AM
Quote from: c.p. on May 08, 2014, 03:18:58 PM
I was successful with my RKT4 test though (i.e. one prop consisting of two models, with one of them casting a shadow, and one of them not.)  If that's of any use, I can post more info, but I think it's not what you're looking for here.

Actually, this seems like a rather neat solution to me. The sliced models could be re-assembled in RKT4 to have proper shadows whilst being slope friendly too. Moreover, Frank could still put the RKT4 props into families to his hearts content. Seems like a win-win to me really, unless I'm missing something. ?  &Thk/(

I don't think it's the best solution to this particular problem, but it is a solution to other problems.  I was thinking I'd start a new thread for this when they create the new BAT help section. :)

Edit: And I can confirm that it does work with families.
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 10, 2014, 09:51:58 AM
Quote from: c.p. on May 10, 2014, 07:09:42 AM
It's hard to tell in that tiny picture, but I don't think the models have to be changed at all.  Just make new LODs.  Either simple boxes or simple cylinders.  Make the top of the LODs flat all the way across.  Make the bottom of the LODs at ground level (z=0).  The game doesn't care whether the center of the gmax model dips below the ground plane or not.  It cares about the LODs.  Keep the LODs above the ground plane, and you should be fine. :)

Well, I tried this suggestion first, because it sounded simple (it is as a matter of fact), but it didn't change anything. There is one model though that has a part of it's "false shadow" cut off.......?

I'll continue to try other suggestions this evening, now I've got to do some seedings ion my fields (irl).

Fred

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fs29.postimg.org%2Fglr8si2nr%2F45345.jpg&hash=779f47a072112a85c0a1ecf890906f8124cdc0d5)
Title: Re: Underground BATs Problems
Post by: FrankU on May 10, 2014, 10:12:58 AM
Quote from: vortext on May 10, 2014, 07:12:21 AM
Quote from: c.p. on May 08, 2014, 03:18:58 PM
I was successful with my RKT4 test though (i.e. one prop consisting of two models, with one of them casting a shadow, and one of them not.)  If that's of any use, I can post more info, but I think it's not what you're looking for here.

Actually, this seems like a rather neat solution to me. The sliced models could be re-assembled in RKT4 to have proper shadows whilst being slope friendly too. Moreover, Frank could still put the RKT4 props into families to his hearts content. Seems like a win-win to me really, unless I'm missing something. ?  &Thk/(

I know that you can use RKT4 for seasonal props: meaning two models appearing alternately, but I was not aware of the possibility to add two models and show them together at the same time. Where can I find info on that?
OK, I should search Simtropolis first....
Title: Re: Underground BATs Problems
Post by: c.p. on May 10, 2014, 11:32:13 AM
I wan't able to find much information either, which is why I did the test.  The quick answer is that you create an RKT4 with 16 reps, just as you would with a semiseasonal or other 2-state prop.  However, both groups of of 8 reps begins with 0x00000000.  The TGI of the first set of reps would refer to the above-ground model.  The second set of reps would refer to the below-ground model.  Only the first model will cast a shadow.  You can also add additional sets of reps (of 8 reps each) if you want a state change (such as if you have "abandoned" version of the model).  The rep-sets for the state-change models begin with 0x00000001, and they should be in the same order as non-state-change models.

I'll make a more detailed post about this, hopefully sometime this weekend. :)

Edit: I forgot to mention, only the first model will show up in PIM-X, but both will show up in the game.
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 11, 2014, 08:04:32 AM
Ok, I have tried everything that was mentioned here and anywhere else and nothing works, all last night ('til 3AM) and all morning today. I spent hours and hours of trying other things too, without success.
Splitting the model in half seems to be impossible because every time I try, gmax tells me that an unknown error has occured and will now close the application. And this at least 20 times......... ???
Then it asks, do want to try to save it, I click yes and then the freaking thing tells me that it cannot be saved and gmax closes to desktop....nice. I am so freaking sick and tired of programs that only work "parttime. I've had enough! Spent all my weekend on this, instead of finished my other models.

So, I suppose it is impossible to get rid of the "false shadow"....wow, great achievement.

What can I tell you besides saying Thanks you all for trying to help me again and believe me all your knowledge, willingness to help is actually very much appreciated by me. Everytime you help, I learn something, even if it doesn't solve the problem, and especially with this matter, I had the best of the best BATters standing beside me. :thumbsup: That alone was worth the "stress".

FrankU, you want those models?..... well I guess you have to live with them as they are, because there does not seem to be a valid solution. Sorry.

I will continue to find a solution, not today nor this week though (had enough of this for the moment being) ;) Who knows, maybe someone or even me, find a way one day to have that useless shadow dissappear for good. (there must certainly be a way)

Fred
Title: Re: Underground BATs Problems
Post by: FrankU on May 11, 2014, 10:11:59 AM
Hi Fred,

I can estimate your frustration. But I can assure you: the models are great and I can perfectly live with this flaw, like I can live with a lot of other flaws in this game.
There are many props that have the same problem and I hardly ever hear someone complain. Maybe now we know why.   ;D

So please continue with the other projects and let me fill the lots with your manure props!
Title: Re: Underground BATs Problems
Post by: cogeo on May 11, 2014, 02:42:12 PM
Before giving up, I would like to ask you again. Did you check the link I posted (to Frank's thread)? The model does have a sizable underground part (the stairs), yet it doesn't show the negative shadow (the white one only, the others weren't fixed at the time the pic was taken). The ingame subway station doesn't have the problem either.

Also take a look at my post here (http://sc4devotion.com/forums/index.php?topic=13548.msg390753#msg390753).
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 11, 2014, 04:14:26 PM
Quote from: cogeo on May 11, 2014, 02:42:12 PM
Before giving up, I would like to ask you again. Did you check the link I posted (to Frank's thread)? The model does have a sizable underground part (the stairs), yet it doesn't show the negative shadow (the white one only, the others weren't fixed at the time the pic was taken). The ingame subway station doesn't have the problem either.

Also take a look at my post here (http://sc4devotion.com/forums/index.php?topic=13548.msg390753#msg390753).
Maybe I don't ynderstand what you mean, but I did try the LODs above ground only (see my last pictures) and it didn't do anything like your subway.
The rest of the post in FrankU's concerns more FrankU, since I do nt touch reader, PIM and all those other confusing (to me) tools. I have no idea how to turn off shadows, I only work with gmax.

There must be something else that you to get no false shadows or I am doing something wrong, but don't know what. I don't think that there are dozens of ways to make a LOD, right?

Fred
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 12, 2014, 06:49:55 AM
How do I turn off shadows with ilive reader?
Title: Re: Underground BATs Problems
Post by: vortext on May 12, 2014, 07:12:45 AM
Open the prop exemplar and set 'Is Ground Model' to false (0x00).

(https://dl.dropbox.com/s/qv55ybrwnn6ujty/groundmodel.JPG)
Title: Re: Underground BATs Problems
Post by: FrankU on May 12, 2014, 07:14:08 AM
Hi Fred,

Open the prop exemplar in Reader (I hope you know how to do that...)
Find the entry "Is ground model" and change the property from True (0x01) to False (0x00).
If I am correct this property also has other effects, like the ability to stop automata, but as we do not put our manure props in the middle of a road we do not care about these.

Frank
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 12, 2014, 09:41:25 AM
Thanks vortext and Frank. I will do some testing today, couldn't sleep, have to fix this........there must be a solution!!

;)

Edit: Yes , I know a little more than the basics of the Reader.It is the PIM that I only know how to make props with, the rest I simply don't undrestand since there are no instructions nowhere how to.
Title: Re: Underground BATs Problems
Post by: Rayden on May 12, 2014, 10:28:47 AM
Quote from: mrbisonm on May 12, 2014, 09:41:25 AM
Edit: Yes , I know a little more than the basics of the Reader.It is the PIM that I only know how to make props with, the rest I simply don't undrestand since there are no instructions nowhere how to.

I don't know if you notice Fred, but there is a very thoroughly manual Barbie did with great effort and dedication for PIMx - http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=2257
Title: Re: Underground BATs Problems
Post by: mrbisonm on May 12, 2014, 02:26:54 PM
Quote from: Rayden on May 12, 2014, 10:28:47 AM
Quote from: mrbisonm on May 12, 2014, 09:41:25 AM
Edit: Yes , I know a little more than the basics of the Reader.It is the PIM that I only know how to make props with, the rest I simply don't undrestand since there are no instructions nowhere how to.

I don't know if you notice Fred, but there is a very thoroughly manual Barbie did with great effort and dedication for PIMx - http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=2257

Ho!| Thanks a lot Rayden, didn't know this one. Thanks for the link. I will have a look.

Fred