• Welcome to SC4 Devotion Forum Archives.

How to customize the grass of transit textures

Started by Swordmaster, November 19, 2013, 10:24:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Swordmaster

A quick tutorial from me on how to change the grass textures of your roads, streets, etc. (Note: I did not say to quickly change the grass. . .) This is for relatively advanced users who are comfortable with ilive's reader and an image editor of their choice. I'll be using GIMP (the beggar's photoshop). It also helps if you already know how to batch export textures from DAT files.

People regularly ask how to change the grass texture, expecting it to work similar to the sidewalks. Unfortunately, this is not the case. Here's how the wealthified transit textures look:




As you can see, the grass is "baked" into it along with the transit network. As such, you'll need to edit the textures. (Yes, all textures.) Thus, this is not a quick job you can do in two minutes, but I do have some tips on how to speed it up.


You'll notice the textures are transparent. The transparent parts will show the sidewalk. Unless you want to get rid of all sidewalks, you need to carry this over into your custom textures. Fortunately, the GIMP has a neat function for that.

Let's use this texture from memo's draggable FAR as an example (IID 0x5F091304):




Open the $ version (######14.png) in GIMP. Open the Layers dialog, right click the one layer you have and select "Add Layer Mask".




Pick the "Transfer layer's alpha channel" option.




Layer masks are a special add-on to a layer that contain a grayscale representation of the alpha channel. Thus, the above will transfer our image's transparency to a special layer that we can recycle. Awesome!




What's left in our base layer is of no use to us anymore. Toss it out! (Select all, delete.)

Create a new normal layer (same size, with transparency).




Go back to your textures and open the normal, unwealthified version of our texture.




Select all of it, go back to the image we were working on, and paste it in our newly created layer.




Now, what remains to be done is pick a grass texture of your choice and paste it in the layer that has the layer mask. I'm gonna pick one of those base textures that ship with Gobias' Sudden Valley terrain mod. (It's quite recommended.)




As you can see, we've now relatively quickly recreated a wealthified road texture. All that's left to do is export it to the relevant IIDs. Personally, I like the idea that grass doesn't change color just because folks living there are richer, so I pick the same grass for all wealth levels.



(Yes, that's a train wallpaper ::) )


Use PngToFshBatch to pack it quickly and of course make it load last.




Yeah. . .





Cheers
Willy

MandelSoft

There is another, quicker way, and this has to do with splitting up the alpha and the base texture. For instance, if your texture IID is 0x5F091304, then name the base texture (without alpha) "0x5F091304.png" and the alpha man "0x5F091304_a.png". The Batch PNGtoFSH tool will assign the alpha texture to the base texture as if they were one. This way, you only have to change the base map without changing the alpha maps.

Even better: if you replace all base textures with the grass textures you want, then you can just simply merge the unwealthified base map with the wealth grass. Voila, custom wealth grass textures!

Anyway, NORO can certainly use Sudden Valley wealth textures  ;)
Lurk mode: ACTIVE

memo

Phenomenal tutorial! It is interesting to look behind the scenes of other modders. When I had to create wealthified textures (when I was working on draggable FAR, as you might have guessed), I wrote a small program to create all the necessary textures from the BMP 0x5f091304, its alpha mask and from the alpha of 0x5f091314 (or much rather I hacked jondor's tool to do the job). If you can create those files, I could process thousands of textures with a single click in order to add different grass textures. I'll definitely have to try Maarten's method, too, so I think the final chapter has not yet been written.

gn_leugim

one question,. is it possible, without editing all textures, and in a sidewalk mod compatible point of view, make the grass go away, being replaced only by the sidewalks?? (other than laying everythings as mid or high density ofc ^^)
  :-\
That would be a dream come true for most euro players  :thumbsup:

MandelSoft

The procedure for that, a no-grass sidewalk mod, is in general pretty easy to achieve, but it can be a lot of work. What you do is this:

- First, go to the texture mod you installed and open it with the Reader...
- Then, delete all textures that end with 10-14, 20-24 or 30-34 (and from the 90-94, A0-A4 and B0-B4 range). These are usually wealth textures
- After that, select the textures from the 04 and 84 range (usually the base texture) and clone these textures three times with a IID shift of 10 per clone.
- Repeat this for every file with textures from your texture mod.

Presto! There's your no-sidewalk mod

Best,
Maarten
Lurk mode: ACTIVE

jmdude1

i am just wondering how hard it would be to change the sidewalk textures/under rail textures for light rail?
what steps would i have to take to do that?  thanks!

Swordmaster

The confusion arises from the use of sidewalk for all these type of things. Technically, a sidewalk is only a specific texture that appears through transparent areas of a transit texture. The parts of the transit texture that look like sidewalks aren't actually sidewalks. Such is the case with the GLR. This also means that one can't change that texture without changing the entire transit texture. It's not undoable, but only recommended if you have patience and/or some experience doing this (it's tediously slow when you start out).

Like mentioned before there is a GLR overhaul planned; it's certain that there won't be any such baked in sidewalks in there if we get to that point.


Cheers
Willy

memo

It should be mentioned that the two draggable GLR Extension Sets reference only two FSH texture files as base texture. Everyone can easily customize those two textures to create one's own GLR style. It does not require any advanced modding skills. Still, the default urban and rural GLR sets cannot easily be changed, as Willy explained.

gn_leugim

Quote from: MandelSoft on December 17, 2013, 03:42:33 AM
The procedure for that, a no-grass sidewalk mod, is in general pretty easy to achieve, but it can be a lot of work. What you do is this:

- First, go to the texture mod you installed and open it with the Reader...
- Then, delete all textures that end with 10-14, 20-24 or 30-34 (and from the 90-94, A0-A4 and B0-B4 range). These are usually wealth textures
- After that, select the textures from the 04 and 84 range (usually the base texture) and clone these textures three times with a IID shift of 10 per clone.
- Repeat this for every file with textures from your texture mod.

Presto! There's your no-sidewalk mod

Best,
Maarten

it sounds, hmm, easy, but i'll see when I try ^^

ty

APSMS

So, I have yet to try this out, but since I like my grass to look separate from the terrain (I live in California, so if your grass looks like the terrain, you haven't got much of a yard), I was wondering how hard it would be to, instead of changing the textures to a new one, simply change the reference for the Low wealth grass to the medium wealth grass.

i.e. assign the med wealth roadside grass textures to both $ and $$. Is there a tool that will help me with this, since it's all already done?
Experience is something you don't get until just after you need it.

My Mayor Diary San Diego: A Reinterpretation

vortext

Quote from: APSMS on December 23, 2013, 01:15:17 AM
i.e. assign the med wealth roadside grass textures to both $ and $$. Is there a tool that will help me with this, since it's all already done?

That'd be pretty much the same procedure as Maarten outlined for a no-grass sidewalk mod. Instead you'd delete everything except the medium wealth textures (20-24), clone those and assign low & high wealth IIDs (more on wealth IIDs). You can do this with the Reader.
time flies like a bird
fruit flies like a banana

M4346

#11
EDIT: I have managed to get it right. See UPDATE below.

Hi everyone,

Quick question (and please split this off if this is not the correct thread):

Is there (a) a mod available to or (b) how do I change the 'base texture' of the Single Track Railroad?


What I would like to do is have the base texture (currently that awful sand) be the same as the grass on my current (SFBT darker) rail texture (also shown in the edges of the roundabout).

Since the sand only shows up when you plop something next to the tracks, is it not possible to create an instance of the grass texture with the ID for the sand? If so, what is the ID?

I would like to use the grass texture in urban / developed areas while still having untextured rails in rural areas, so I don't want to modify all the textures en masse.

Any advice or assistance would be greatly appreciated.

M

UPDATE:

In a bid to remove the sand texture from my agricultural zones, I have answered my own question / discovered the solution.

I saw the sand textures in the SMP Sandstone Sidewalk Replacement Mod that I use, and I simply replaced them with the green grass texture.


Attached is the file with the two modified textures.
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine

packersfan

I want to try to do this with Lowkee's Appalaccian Mod...it would be really nice if someone had already done it.  Unfortunately, I can't get FSH Converter to work to allow me to edit the FSH files as PNG...so I'm stuck!  Also, I'd have to edit ALL those textures??!?!?!?  What about this program you wrote MEMO...how does that work?

I wish I could get all my tools to actually work.  Seems my biggest hurdle in doing a little modding is getting the modding tools to actually work on my computer (nothing seems to work on my computer).

memo

#13
Quote from: packersfan on November 05, 2014, 05:39:40 AM
What about this program you wrote MEMO...how does that work?

I recently rewrote that program from scratch, thereby adding a lot of functionality, and packaged it is a usable (command-line) tool. It works on any platform that has Java installed (and Java is available for almost every platform) – my frustration with not getting most of the available FSH tools to work was part of the reason I wrote my own. The drawback is (for many people at least; for experienced users it is an advantage) that it is a command-line tool, so even though it would technically run on your platform, you might have difficulties unless you are comfortable with using the command prompt. This is also why I haven't actively published it; however, I am happy to share it with anyone who is interested.

Basically, it is a tool to convert between PNG and FSH, but usually not one at a time, but hundreds or thousands of images at one go, in order to handle some of the tedious bits of NAM modding. At that, it also handles some of the other annoying tasks, such as IID extraction, mipmapping, wealth textures, slicing, etc.

With regards to your problem, this means that it can generate the FSHs from the 0x######04.png files and the alpha masks of the 0x######14 files, thereby replacing the grass by a custom texture. But still, you'd have to locate all the FSH files that have wealth textures and collect the appropriate image files and alpha masks, which is a lot of work (there are about 230 thousand FSH files in the NAM).

Fortunately, since my last post in this topic, I have written an entire DBPF library of my own, which means I can automate pretty much anything if you give me some time. So, I'd like to offer to try to come up with a little script to do the work – you'd just have to provide the three grass textures.

Edit: The script is finished. Give me the textures, now! :D