• Welcome to SC4 Devotion Forum Archives.

New SC4 Texture Creation Tool

Started by mbsimcity, February 07, 2016, 02:50:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mbsimcity

Hello sc4devotion community,

I've undertaken an ambitious modding project to create a successor to the RMIP2 project for large runways.  Due to the large size of the lots, there are a lot of different textures to create.  This work is time consuming and error-prone.

I want to write a tool that will take as its input a large PNG image which will be partitioned into 128x128 pixel images.  The tool will produce a .dat file containing textures as the output.  The tool will omit creating a texture whose image has already been used.  As an added enhancement, it will also consider whether an image is an exact mirror copy of an existing image before creating a new texture.

I've been reading up on the DBPF format described here.  I'm writing my code in GO and I plan to upload it to GitHub as an open source project (link to come once I've created the repository).  I would appreciate if someone could share some of the source code that write .dat files.  Specifically, a library that can compress file entries.  That way I can port it to GO for my tool.

Cheers,

SC4 - Large Airport Builder project

mbsimcity

#1
I've searched on GitHub.com and found a decent Java library that I should be able to port to GO.  In my research, I've also heard of a tool called GoFsh, but that tool doesn't seem to offer what I want.

From my past attempts at producing sets of modular lots (like RMIP2 or my project SC4-LAB), the lot textures cannot be drawn in isolation, because the seams never line up correctly.  Instead, I find it easier to draw a large image containing all of the lot prototypes, and then I carve out the 128x128 pixel images from that larger image to produce the textures that I need.

For example, this is the image that I'm presently working from to produce the first batch of lots for SC4-LAB.


Of course, with this approach, there's a lot of duplication.  So far, I've relied on my memory and my eyes to avoid creating duplicate textures.  Instead, I'd want a tool that I can just feed it this huge image, and have it partition it into 128x128 pixels images, then for each image, it would check if an equivalent image (that's an exact copy, a mirror copy, or a rotated copy) has already been added, if it hasn't, it would create a FSH entry in the output .dat file.  Finally, a report would also be generated that would indicate the assigned texture IID for every single cell in the input image.  This should greatly help when actually creating the lot in the LotEditor tool.

I'm still wrapping my head around the DBPF format and especially the QFS compression.  Once I have some kind of skeleton application, I'll create a GitHub.com repository and share the link.  If this isn't the right forum to be posting this in, please let me know.

Cheers,

Moderator: Image width fixed. Please keep width to 1024px max. FrankU

SC4 - Large Airport Builder project

Themistokles

Nice! Such a tool I believe can simplify a lot for people who create big lots with lots of textures, and, although I'm not directly among those, any simplification for them means more lots for me to use :D I know way too little to tell whether this would be a good way to do it, but, upon identifying available id's, should there be an option to replace old textures, if, for instance, one would be making replacement textures?
Come join me on a hike to St Edmea!

Latest update: 7

"In the end, our society will be defined not only by what we create, but by what we refuse to destroy." - John Sawhill

Simmer2

This tool would be an absolute asset!! 
I just finished creating a bit over 1200 128x128  textures the old fashion way, I wish I would have had this app.
I approve  :thumbsup:

Simmer2
________________________________________________________________________________

rivit

There are ways of doing this now to some extent with a combination of tools

1. Using a Photoshop batch it is possible to slice an image up into arbitrary sizes and number them
2. Using GoFSH all of these shards can be converted to .fsh and resultant .dat in one fell swoop (including all of their mips)

this method would not find duplicates or mirror duplicates but given the biggest job is actually getting it in-game to see what it looks like its a (fast) way forward. Other tools like GIMP may also handle the slice and dice and numbering (I don't know)

If you would like some help in setting this up drop me a note and we can try it all out - it looks like it would be a useful process for quite a few people...