• Welcome to SC4 Devotion Forum Archives.

Creating custom textures

Started by belfastsocrates, October 27, 2015, 11:11:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

belfastsocrates

Firstly apologies if such a thread already exists but I was wondering whether someone could direct me to a tutorial that would explain how you can create custom base and overlay textures?

I'd like to add some rather boring details like drain covers, manhole covers, inspection chamber covers and so on to the paved areas of my city, I think it'll add an aspect of realism that I'm missing and I have a lot of paved areas!

I've seen something similar in a CJ, I think possibly in Benoit's, but I don't think they were ever available publicly. As such I'd like to create some for myself providing it's not too complicated.
A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

vortext

#1
There isn't one definitive tutorial no, and those which do exist are a bit outdated but I can give you a short rundown. First of all you need your own texture IID range for which you can apply here. Secondly you need a graphics program like Photoshop or GIMP to actually make the textures. And finally you need some way to get them ingame, for which I use Batch PNG2FSH. Now for some some technicalities.



  • Lot editor textures are always square and measure either 128x128 px, or 256x256 px. I use the latter dimensions because imho the higher definition at zoom 6 outweighs the increased file size but opinions on the subject differ.


  • Overlay textures contain transparency. Or in other words, overlay textures contain an alpha channel - base textures do not. Depending on which software you use you'll need to flatten the image or remove the alpha channel if you want to make base textures.


  • Lot Editor textures use Group ID 0x0986135E. If you use Batch PNG2FSH, you only need to set the GID once (see the readme). Furthermore Batch PNG2FSH sets the IID if you use it as filename. Very handy indeed.


  • The fifth digit in the IID is the wealth indicator, and can take a value of 0,1,2,3. This sounds promising in theory, however, in practice you want to steer clear off using the wealth indicator because it produces unpredictable results, e.g. textures do not show, wrong texture show. So whatever range is assigned to you, you want to use 4 and upwards as the fifth digit: e.g. 0x0000D000. Yes that's a D. Remember IIDs use hexadecimal count so you can use anything from 4 ... 9 through A ... F


  • The game actually needs 4 additional textures with decreasing dimensions, one for each zoom level, which are known as mipmaps. Batch PNG2FSH takes care of the mipmaps for you, however, they do have an unique IID which is denoted by the 8th digit. In practice this means you can use 4, 9, and E as the 8th digit in the png filename. Conversely 0-3, 5-8 and A-D are reserved for the mipmaps.



If the latter two points about IIDs are confusing you can read more here: Explanation of the Texture IID numbers. So putting it all together my typical workflow is as follows.


  • Create a new 256x256 px document, which I've conveniently set as a preset.
  • Get creative
  • Save the document as png with the IID as filename, e.g. 0xF82041AE.png
  • Drag the newly created png file to Batch PNG2FSH, set the correct compression and hit 'save dat'.
  • Go in the LE, apply the textures to a test lot and check ingame

Note that changes made to a texture take effect immediately. So once you've plopped a test lot ingame, make sure to save-and-exit and you can simply bypass the Lot Editor the next time.

Though you'll probably encounter some frustrations at first, it's a pretty straightforward process.
time flies like a bird
fruit flies like a banana

nos.17

#2
There is, actually, a pretty nice texture tutorial here on the Omnibus that I have used quite recently and found it very helpful. It uses the SC4 Tool, which is quite a bit more user-friendly but may be prone to crash...its still worth it though.

However, if you just want to add manhole covers and the like to some of your lots, Neko has already created some great props to use. You can just place them on your lots of choice. I believe (but am not positive) that there are families too, for greater variation. The props are included in Neko Props set 1 (part1) and (part2). Extract them together and there will be a folder entitled "Manhole" inside. You need only that, if you are not interested in the rest of the props (which, by the way, are fantastic).  ;)

mgb204

One important question in all this, where exactly do you wish these textures to show?

For the type of thing you are talking about, you can indeed use textures when making lots that include such features. I believe Badsim also added a lot of detail on TE and other lots this way. However, if you want these to appear on transit networks, you'll have to think again about textures. For example if you wanted a man hole cover on the straight street piece, it would either be on all of them or none of them, since there is only one straight texture you can work with. That's why Neko would have used props for this instead, they are much more flexible and can be T21d to transit networks or used on lots.

What might be really useful here is a hybrid between the two. So if you make a texture, then convert it to a prop (like my sidewalk S3D props). This avoids getting into batting but will give you the most flexibility for such items being used. If you want to explore this option, it's actually very simple and I could send a template file and more specific instructions.

belfastsocrates

Oh this is great advice, than you very much!

@mgb204, For the minute I'm just thinking of standard lots. I love the idea of regularly placed drains and so on for streets and roads but I think that would be a bigger project.



A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

vortext

#5
Quote from: nos.17 on October 27, 2015, 05:03:43 PM
It uses the SC4 Tool, which is quite a bit more user-friendly but may be prone to crash...its still worth it though.

okay this rant may be definitely is because I've just had couple of courses on usability research so don't take this personally but . . c'mon it's not user-friendly, at all.

First of all opening the program takes two steps (SC4TOOL -> Texture Creator). Once there, you need to open a browser window and navigate to the .dat file you wish to save the textures in. Even if you want a brand new file the program still opens a browser window and requires you to create the empty .dat beforehand. Now with the .dat loaded, you need two more clicks (add texture & open texture) and once again navigate in a browser window to actually select the texture. Then you need to click another button to create the mipmaps and enter the IID, which at a minimum requires a copy/paste action. Finally you can hit 'OK' only to find it brings forth a saved prompt which requires you to actually click 'OK' again, which does nothing except makes the useless prompt go away! I lost count but I reckon half a dozen steps are required for just a single texture and worse, most of them are rinse-and-repeat if you're dealing with, say, two or more textures. And to top it all off, since when is 'prone to crash' considered to be user-friendly?!  ??? :D

On a more serious note though, the SC4Tool Texture Creator does not recognize transparency so if you wish to create overlays you actually need to make a separate alpha texture for it (the omnibus tutorial fails to mention this btw*) which in turn requires even more clicking and navigating. The only reason I can think of why SC4Tool could be perceived as being more user-friendly is that is offers visual-feedback, i.e. you see the texture and mipmaps being made.

*on second read it does mention this when covering transit textures, which for just a single texture takes 9(!) steps with SC4Tool.

For clearity, here's how the Batch PNG2FSH operates.




Even though the 'Group' and 'Instance' frames are empty, it will save everything correctly. The same goes for the 'End format' button, you only need to bother with these if you manually enter the IID. However, provided you use the IID as filename, you can just leave everything as is and it'll process all the textures just fine. Also, by accident I left out the rather obvious step 4, which is that when you hit 'save dat' you'll need to enter the filename and navigate to the location where you want to save it. This is the one and only time you'll encounter a browser window.  ;)
time flies like a bird
fruit flies like a banana

nos.17

Quote from: vortext on October 28, 2015, 08:03:38 AM
okay this rant may be definitely is because I've just had couple of courses on usability research so don't take this personally but . . c'mon it's not user-friendly, at all.

...

()testing()

I see your point. Maybe "user-friendly" was not quite the right term...in retrospect I should have omitted that from my suggestion. It is just that SC4Tool is the program I used to learn. When you learn on your own, rarely do you have the luxury to learn the most efficient method first; I had no idea PNG2FSH existed before your post. Hopefully you can see why I thought that was the easiest method...it was the easiest and most user-friendly one that I knew of.



Quote from: mgb204 on October 28, 2015, 02:21:35 AM
For example if you wanted a man hole cover on the straight street piece, it would either be on all of them or none of them, since there is only one straight texture you can work with. That's why Neko would have used props for this instead, they are much more flexible and can be T21d to transit networks or used on lots.

Not exactly true. From my limited T21 experience, the property kPropertyID_NetworkPlacementPattern allows you to create a pattern for that specific T21 'lot;' e.g. you could have it occur every two tiles, every three tiles, every other tile, or some other combination thereof.





@Belfast, this is what I would recommend: Start with your regular lots, either creating the textures with the manholes on them or using the manhole props (which is easier IMHO). Putting them on streets & roads is indeed a larger project; T21s are a whole nother ballgame.

vortext

#7
Quote from: nos.17 on October 28, 2015, 10:19:14 AM
I see your point. Maybe "user-friendly" was not quite the right term...in retrospect I should have omitted that from my suggestion. It is just that SC4Tool is the program I used to learn. When you learn on your own, rarely do you have the luxury to learn the most efficient method first; I had no idea PNG2FSH existed before your post. Hopefully you can see why I thought that was the easiest method...it was the easiest and most user-friendly one that I knew of.

Yeah no worries, at first I actually used SC4Tool as well. And as I said, the course material was fresh in my mind. Even went as far as make an educated guess of the so-called Index of Performance, or throughput . .  ::)  if interested
time flies like a bird
fruit flies like a banana

belfastsocrates

I've finally stated creating new textures. I think I'll use them for the Passau Island project I mentioned in my CJ

I'm making them in 256x256 but am I right in thinking that Lot Editor can not read those textures and I'll need a copy of the 256x256 texture scaled to 128x128 with the same file name? I can create two separate folders for the 128px and 256px images and resulting .dat files

I know PIMX can read 256px textures but my plugins folder has been going for 10 years and it's absolutely vast and DAT packed.

Am I right in thinking that I can use the 128px texture in LE, create the lot and have the 256px textures in the plugins folder I use when playing and the lot will show the HD texture in-game?
A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

mgb204

Absolutely, so long as both DATs use the same ID's for the textures. All you are doing in the Lot Editor is assigning the texture ID to be shown on the lot.

Quote from: nos.17 on October 28, 2015, 10:19:14 AM
Quote from: mgb204 on October 28, 2015, 02:21:35 AM
For example if you wanted a man hole cover on the straight street piece, it would either be on all of them or none of them, since there is only one straight texture you can work with. That's why Neko would have used props for this instead, they are much more flexible and can be T21d to transit networks or used on lots.

Not exactly true. From my limited T21 experience, the property kPropertyID_NetworkPlacementPattern allows you to create a pattern for that specific T21 'lot;' e.g. you could have it occur every two tiles, every three tiles, every other tile, or some other combination thereof.

Just to pick up on this (missed it at the time). Of course with T21's you can randomise things more. That's why I said it would need to be done this way. But if you simply added such a detail using textures, it would have to be on all or no tiles. You can turn a texture into a prop without too much difficulty, so it's not like you'd have to BAT such a thing. But T21s and Props are the only sensible solution.

vortext

#10
Your method would work indeed, though as far as I'm aware it's unncesearry to do so. Before I released my first texture pack I asked a few people to try them using Maxis LE since I didn't know if it'd handle HD textures, let alone multi-fsh HD textures and I've not heard of any issues. So an easy test would be to grab my base texture set and fire up the LE. There're some nice stone textures in there, if I may say so myself, though might be a bit too worn out for your purposes.
time flies like a bird
fruit flies like a banana

belfastsocrates

Quote from: vortext on April 30, 2016, 07:42:35 AM
Your method would work indeed, though as far as I'm aware it's unncesearry to do so. Before I released my first texture pack I asked a few people to try them using Maxis LE since I didn't know if it'd handle HD textures, let alone multi-fsh HD textures and I've not heard of any issues. So an easy test would be to grab my base texture set and fire up the LE. There're some nice stone textures in there, if I may say so myself, though might be a bit too worn out for your purposes.

Yeah I have those and I love them, planning to use the square cobbles when I completely redo the old town quarter of Passau later this year.

That's interesting though, I only stumbled upon the issue when MGB sent me an HD texture and it wouldn't show in LE, a modified SD version he then sent did. I don't mind making two versions but I just wanted to double check I was on the right track and it would work.

I'm actually rather excited about creating a few things. Now I just need to test them in-game and get the scaling right for both the paving and some additional details like drains and manhole covers to enhance the realism of large paved spaces
A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

vortext

Hm, I guess it depends on how the textures are processed exactly, sometimes I follow the wrong order of steps and end up with inverted colors. . :-\

Also, technically my textures are 'faux-HD'. That is to say: they're 256px PNG files but I use the standard DXT compression for the FSH. The difference with using proper 24/32 bit HD compression is negligible. Besides, even SC4PIM cannot handle proper HD textures, so there's that.  :D

Looking forward what you come up with!  :thumbsup:

time flies like a bird
fruit flies like a banana

belfastsocrates

Seems I don't need to create two different files Vortext, using the PNG2FSH seems to work and I can use the 256px textures in LE.

I was going insane as I couldn't get the PNG's to save as textures and appear in LE and I was pulling my hair out! Seems, like in most cases, I didn't read the instructions properly and neglected to amend the Groupid and instRange .txt files


Anyway...I've started creating new textures and it's very addictive. This is just a quick example, I noticed a problem with one of the textures in-game so I need to revise that in photoshop. I also need to possibly amend the scale of the tree grate and maybe the manhole covers and drains. My problem is trying to balance scale and still make them noticeable details. I also noticed some tiling when in-game, I'll need to address that.

I've a lot more textures planned.



A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

mgb204

Scale can be a nightmare, if you think that each texture represents a 16x16m area, a lot of details simply could never be shown if made according to scale. Sometimes, it's better to accept scale has to go out of the window and just make something so that it works in-game properly. The real goal after all is to make your game look better.

I like the tree grates, although I think I'd make them at least half the size they are now. The manhole/drain probably is a bit large, but I think if you make them smaller, they'll barely be seen, as such I think they are fine as they are.

Good to see your first efforts though. I'm sure now you've started, you won't be able to stop :). Looking forward to seeing what else you come up with.  :thumbsup:

evarburg

Oh, MGB, you've opened a can of beautiful worms ! And a barrel of possible requests ! ;D ; there are a few textures I would just LOVE to have as 1x1 fillers, or even MMPs (beginning with uki's StoneWalls amazing textures). As you know, I don't batlot, but since Kind Souls do, and like it.... ;)

belfastsocrates

I've amended the tree grates to a smaller size, I think they look better as a result. I've also had to adapt my retaining wall textures as the lot is creating a visible line so I'm having strips of black granite to disguise it. I know that'll give a 'tiling' impression but I can't get around it any other way.

I've also added things such as UK-style fire hydrants and recessed access covers for telecommunications, I think I'll tone down the 'brightness' of those telecom access covers though. Thoughts?







A unique nation fusing technological prowess and unparalleled grandeur

"Anyone who lives within their means suffers from a lack of imagination" - Oscar Wilde

Mandarin(a)

I think it looks ... amazing!  :thumbsup:
But (there is always something ...) if I were the creator of those textures, I would change them just a little bit: from far away, for me they look like a recently refurbished wall (that pure grey color) - kind of an effect I don't like.
But if you are satisfied, I would say that those textures are very sophisticated.

Pat

#18
great stuff here and lots of wealth in the info posted.... yes puns intended lol

Don't forget the SC4D Podcast is back and live on Saturdays @ 12 noon CST!! -- The Podcast soon to Return Here Linkie