• Welcome to SC4 Devotion Forum Archives.

Uniform street lighting add on

Started by xannepan, October 30, 2010, 11:39:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xannepan

I'm trying to make a mod to create a more uniform streetlighting instead of (or additional to) the light cones. Just a very subtle homogenous lighting of the street/road surface
(a bit inspired on the pictures here; http://www.boston.com/bigpicture/2008/08/london_from_above_at_night.html)

I have created a simple 16x16 rectangular model in BAT (height very low) (model is essentially the same as the LOD). Next I'm trying to create a semi transparent texture map for this model, pretty much similar to the ones of the light cone model, only much simpler... WHat I end up with is a prop pretty much the same as that of a light-cone. (Not yet done but getting there :S... need some help on the appropriate TGI?)

I'm struggling with the following however; how can I make sure that this prop shows on each road (or street) tile?


-alex


Andreas

I think the "easiest" way would be to create a mod that modifies the existing streetlight props in a way that they all point to your new model. For "normal" props, you just need to change the model ID in the Resource Key Type 1 property of the prop exemplar file, but as far as I know, streetlights use a slightly more complicated setup. It might be still possible to use the same principle, though.
Andreas

xannepan

Andreas,

Is there a tutorial on how to add street properties?

Thanks,
alex

cogeo

We had a discussion with Adam (Ennedi) sometime ago about this, and we exchanged some ideas. Here are some points:
- Why BAT the lightcone model? Just use a simple rectangular (planar) model with 1 S3D file (just like the maxis ones), not 20 (BAT-exported ones).
- I'm not sure about that "very "low" height. Check how your model behaves on (steep-) sloped terrain (it may hide partially underground). Also check the passing vehicles (automata).
- For the above reasons I thnk it would be best to place them well above the ground, eg 4 or 5 meters - check the current lightpoles height, and make sure that the lightcones (well, planes) are below the lantern level.
- As they will be at some height this time, and because of the game's viewing angle, they will look offset. This is easy to fix, just shift the model (make it somehow ex-centric) so as to offset the apparent shift. As for 1-S3D models the game always shows the same aspect for all rotatations and zooms, it will just look the same in all cases, and you won't need specific models for each rotation.

Good luck!

tag_one

^ I Agree with Cogeo that S3D files would be better for this job than normal BAT props. With S3D files it's also easier to change the color of your light cones as they're determined by a single FSH texture. This makes things much easier and makes your mod more flexible for possible future changes. You can probably use one of the existing S3D files that can be found in the NAM and give it another TGI and texture.
As far as T21's concern (to get them on the roads), have a look at this tutorial: http://sc4devotion.com/forums/index.php?topic=70.0. But I think Andreas' method is less time consuming.

Anyway good luck with this project. I'm really looking forward to the result. This will make SC4 much more realistic at night.

xannepan

#5
Thanks guys.

Here is how I got sofar with my experiment. Currently I'm still working on a lot so I can focus on the visual aspects. I''m using 3ds models indeed instead of bat props (one one view, not 20 of them because the'll have to look the same in all directions). I once created my own light cones for the first version of gare du nord, but my modding knowledge is a bit rusty. Some good points you made - which I just also learned myself during the experiment. Flat models (square) placed directly on the surface don't work well on slopes. I'll try your suggestions.
Also in the current model only the road tile is illuminated, and the illumination ends abruptly which doesn't look good.
Probably I'll have to fall back on a cone like model... we'll see.

MandelSoft

I hope I understand you right, but does the following look simmilar to what you try to achieve?



Best,
Maarten
Lurk mode: ACTIVE

xannepan

#7
@Maarten: A bit like that Maarten, the subtle difference is that i want to achieve a more uniform illuminated. Currently illumination is limited to the (too small imo) cone. Whether it is possible remains to be seen, but I remain hopeful that with help of this community it might be possible.

So here is how far I got today: First I create my 3ds model and FSH file  (a square plane at 8m height). Then I created a prop from this  model so I could create some lots to do some experiments (first two screenshots). In the mean time I also added my model as a replacement for the light cone (third screenshot). Not quite there yet, and I'm affraid I am reaching the limits of my modding skills. The problem with the standard light cone replacement is that the light poles are not uniformly placed along the streets, as a result of which the uniform streetlighting effect is lost, that I was able to create on the test lot. Also on the lot I duplicated the prop to play a bit with the illumination strength (one prop was a bit too subbtle). As you can see in the last screenshot the lights are relatively weak if I use them as a replacement for the maxis light cones.

So, I'm still not sure whether to use my 3ds model as a replacement for existing cones, or add the model as a "T21 prop" that shows on each single road tile. I think by adding my 3ds model in the centre of each road piece would get in the right direction.

Just to continue the experiment I have tried the entire day to create an add-one that shows my 3ds file on each road/strett tile, but without much success  :'(
Can anyone provide some assistance? I have included the 3ds and fsh file in the attachment (please ignore the exemplars in the dat file). I want to achieve that this model shows up at every road (and/or street etc) tile, to see how it would look like.



cogeo

I think it would be easiest to test your work directly on networks, not lots. This is really simple, you just need to mod the ingame streetlight props, not the networks (T21 exemplars). Here are some links you may be interested in:
- Creating Custom Working Light Props, an Omnibus tutorial, helpful for understanding how the Resource Key Type 4 property works.
- My Street Light Colour Pack V2 on the STEX. Use it to easily find which props you need to mod.

Tip: For editing the RKT4 property easily, do not edit it in the reader (the list is long and confusing). Instead select the whole content in the "Values as Text" box, and paste it in notepad. Check the Format/Word Wrap option, if it's not checked already and resize the notepad window so that you have exactly 8 reps in each line. This looks much better. After done editing, paste the values back in the "Values as Text" box and click "Apply".

I like maarten's work. Consider working together, so that you finally release one package. Maybe add a... cone again... (much smaller this time) to the flat model, I think it will look better.

If you want to make a pack with many colour selections, I could help with the installer. Such an installer requires scripting, as it doesn't simply copy (all) files under the installation folder, instead it installs files selectively. NAM's installer just displays a "tree" with options, but I have made some changes to the SW, making it possible to use drop-down combo-boxes with image-lists, so that you can display preview images there. Take a look at the RTMT installer, to see what I mean.

MandelSoft

Quote from: cogeo on October 31, 2010, 11:29:56 AM
I like maarten's work. Consider working together, so that you finally release one package. Maybe add a... cone again... (much smaller this time) to the flat model, I think it will look better.
Erm... I already released my stuff. Check out the LRM Prop Pack 01 on the STEX.
Lurk mode: ACTIVE

xannepan

Cogeo: I did use your work as an example, as a matter of fact: the last screenshot shows the standard maxis light cones, replaced by my 3ds model (and fsh), similar to how your streetlight colour pack works.
I also tried to mod the  kPropertyID_NetworkPlacementPattern of standard maxis street lights to increase the frequency of light pole placement, but unfortunately I could not identify the T21 exemplar for street lights (I did find the ones for post-box, firehydrant etc... just no idea where to find the streetlights T21 examplar)

The idea of combining a cone with the flat model is exactly what I'm trying to achieve  ;D.. that's why i wanted to leave the maxis light cones untouched (instead of replacing them) and indeed add my flat model to the network pieces.... I'll keep trying



tag_one

Well you can also make a mod that adds more streetlights to the streets and roads. Like adding a streetlight to the network lot with for example a bench or firehydrant ;)


cogeo

Changing the streetlights' pattern is really hard, and I would suggest that you don't attempt it yourself. Instead ask the NAM Team. This requies a good general overview of how the whole thing is setup, not just changing some exemplars. Btw I don't like the current scheme, actually I think it's broken! For roads, streets and SAM you have the streetlights appearing normally only when first lay the networks and the zones. Then, as zones develop, they are replaced with fire hydrants, benches, planters, post-boxes or simply... nothing. It doesn't look good at all, you may get streetlights every four, five, six or even more tiles! So either someone broke the whole thing, or they were that bad from the start (btw does anybidy use SC4 without NAM?). And when you lay ("plop") a 1x1 road or street tile over the existing network, the props are... changed! But a fix would be nice anyway. Streetlights on roads and streets should rather be "persistent", just like the ones on avenues. And if someone wants benches, planters etc too, we could rather consider making T21s with both the streetlight and the aforementioned props on them - but the streetlight pattern should be preserved in any case.

xannepan

Thanks for the warning cogeo!.. I'll stay away from it  ;D

Andreas

The change of props if you re-draw the roads is some kind of built-in "feature" that always happens if you have prop families in the T21s (which is more or less the norm for most things, like the hydrants/benches etc., or the various street tree mods). I'm not sure if something (the NAM?) broke the streetlight pattern, or if this was messed up by Maxis already. If only there was some kind of visual TE editor, I'd dig into this much deeper, but I simply don't have the time (and will) to do everything manually with the Reader, switching back and forth to the LE in order to change prop layouts. There's so much potential in the T21s, but they are an annoying beast to deal with right now...
Andreas

Tarkus

I played the game completely vanilla for about 2 years before I discovered the community and the NAM--I remember quite vividly that the fire hydrants, garbage cans, etc. that cogeo brought up as displacing the streetlights are from the vanilla Maxis setup.  I've looked in all the main NAM .dats (NetworkAddonMod1-5.dat) in the Reader, sorting them to get all exemplars of GID 0x89ac5643 (T21s) together.  All the IIDs on these exemplars are in the 0x5####### range, which means they apply to NAM items, even in NetworkAddonMod1.dat, where most fixes to Maxis items are located. 

Quote from: Andreas on October 31, 2010, 02:10:08 PM
There's so much potential in the T21s, but they are an annoying beast to deal with right now...

My thoughts exactly.  I've gotten familiar enough with the setup of the LotConfigInfo lines that I can usually tweak things without going into LE, though it's still not a piece of cake by any means.  A T21 editor would be a lifesaver.

-Alex

cogeo

Quote from: Tarkus on October 31, 2010, 03:19:53 PM
I remember quite vividly that the fire hydrants, garbage cans, etc. that cogeo brought up as displacing the streetlights are from the vanilla Maxis setup.  I've looked in all the main NAM .dats (NetworkAddonMod1-5.dat) in the Reader, sorting them to get all exemplars of GID 0x89ac5643 (T21s) together.  All the IIDs on these exemplars are in the 0x5####### range, which means they apply to NAM items, even in NetworkAddonMod1.dat, where most fixes to Maxis items are located.
So you point out that this problem originates from the vanilla SC4/RH. But still, do you think a fix would be worth? Personally I do think so. I hate that "random" appearance of streetlights, and I like the "persistent" streetlights on avenues. As for the existing T21s, some could be somehow "redefined", so as to contain fire hydrants, trashcans etc together with streetlights and/or make them appearing on the tiles (or the side of the road) that wouldn't contain streetlights. I have also noticed that the problem gets worse in the case of different density (zone-type and development) and wealth types are mixed. Personally I prefer to develop neighbourhoods of a single wealth and density type, eg medium-density R$$ only, but for quite long periods of a city's growth, lower-density or -wealth development may coexist, until it reaches its development potential or target (I mark lots historical, to keep them from upgrading to a higher than the desired wealth level).

Quote from: Tarkus on October 31, 2010, 03:19:53 PM
I've gotten familiar enough with the setup of the LotConfigInfo lines that I can usually tweak things without going into LE, though it's still not a piece of cake by any means.  A T21 editor would be a lifesaver.
I think the T21 "lots" are fairly simple, to ever need an editor. Maybe a T21 "browser" or "analyzer" (eg find which T21s refer to a specific network piece) would be more beneficial imo.

Andreas

Quote from: cogeo on November 01, 2010, 03:35:21 PM
I think the T21 "lots" are fairly simple, to ever need an editor. Maybe a T21 "browser" or "analyzer" (eg find which T21s refer to a specific network piece) would be more beneficial imo.

Well, they aren't that complicated to make, but it's just annoying to handle them. The creation process could be so much more streamlined with just a simple editor that lets you do the necessary edits with a single interface, rather than doing every single step manually.
Andreas

Blue Lightning

Well, the thing is, Maxis has all of their T21s not at the same IID of the network tile (The exemplar's IID doesn't matter at all, its the NetworkTileID. So in order to redo all of them, one would first need to nullify them.

On the note of patterns though, theoretically one can have patterns larger than 4x4, as the method Maxis used (bit = tile) could support up to 256 tiles (0x00-0xFF). Though the engine might not like that. Once I get my disk back (left it at my dad's) I'll test this out.

And yes, a T21 editor (even if its as crude as Maxis's built in one (which doesn't save)) would be a lifesaver.
Also known as Wahrheit

Occasionally lurks.

RHW Project

xannepan

No update from my side to this project. I lack the modding skills to continu :(

I just wanted to post a link to another topicthat kodlovag started.
http://sc4devotion.com/forums/index.php?topic=12101.msg356473#msg356473

He has managed to achieve almost what I intended to do. Maybe some of the more experiences modders can have a look at his topic and the specific questions he has.. (his topic is placed in the best sellers... which is perhaps an unlike place to draw the attention of the modding community)

Alex