• Welcome to SC4 Devotion Forum Archives.

SC4 Model Tweaker Development/Support thread

Started by cogeo, April 11, 2009, 02:54:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cogeo

Hi all,

As I had mentioned some days ago, I'm working on a new tool to aid custom content development. Its name will be "SC4 Model Tweaker". Initially it's going to support two functions:

- Scaling of S3D files. This was initially intented for making HD props, but as SimFox has found another solution (updating the BAT scripts), the feature is currently unneeded for these. But it can find other uses, eg as a general scaling tool. See an example in the next post.
- Setting/removing (semi)transparency setting from S3D files. Now quite a few BATters know how to make transparent BATs, however the process involves a very tedious procedure, ie setting the blending parameters in the S3D files manually. This feauture automates this task.

Below is a screenshot of the new tool:



As you can see, it features a standard user interface, so custom content developers won't have any problem using it.

I could add some more functions if desired. One note though, these can only be of the "S3D files manipulation" type, as the tool is written in such a way. I wasn't aiming at replacing the reader, instead the above features should be better included into the reader, but the reader is rather impossible to be rebuilt (becasue of a missing library).

I could also send intermediate/test versions to anybody interested. The beta version will be ready by the middle of the next week.

If you have any requests, wishes etc, pls post here.

cogeo

Here is an example of use of the model scaling feature:



It's the Maxis nuclear power plant model, scaled x2. I always thought that this model, though quite good actually, is unrealistically small. The people in the pic are two times taller than the door. And the (original) bldg/lot is only 4x4 tiles large, ie quite small for a NPP. I think the new one looks better (as far as the size is concerned), though it could be possible to try other scaling factors too, like 1.5 or 1.7.

Now about the textures, of course they look more pixelated, as they were for a smaller model. But this model was made in just minutes. If some "refishing" is applied too, the textures can be improved, at least the jaggies can be eliminated.

I have attached the model file shown in the pic, together with a propfile, for everybody who wants to take a look.

I had released a set of NPPs in the past. Not any new models (just "lots"), but that pack was quite successfull, basically due to its usefulness (a set of large NPPs, at different capacities and costs). One could make basically the same, but instead using this (magnified) model, and improvong the lots too, eg put some electric trickery, better parking etc. In such a case pls post in some forum, so that we avoid making duplicate work.

Pat

So this tool would still take some knowledge and not for the beginner I take it?

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

mattb325

This looks like a great idea....I know of plenty of under/overscaled items that would benefit from such treatment

null45

#4
QuoteI wasn't aiming at replacing the reader, instead the above features should be better included into the reader, but the reader is rather impossible to be rebuilt (becasue of a missing library).

I assume the missing library you mean is "3dsftk.lib"
That is the 3DS File Format Toolkit

The 3dsftk libraries from the link above were built with Visual C++ 4 so you have to edit the makefile & rebuild.

Or you could use the version linked to by ilive which is http://little3d.free.fr/download/3dsftk.zip.
That version does not need to be recompiled.

After that the reader compiles fine. ;)

Jonathan

You mean you just made it possible to make the reader better!?!?!
Sure you not from EA or Maxis?

Cogeo,
What I was suggesting is in the mats tab (in the reader) there is the option to change several settings, as to how the texture is displayed on S3D file in game. I was hoping you could extend this tool to be able to change the settings of [/multiple] mats in multiple S3D files, saving you going through every S3D file and changing it. Is this possible?

Jonathan

null45

QuoteSure you not from EA or Maxis?

No, what makes you think that? 

As to how I know about the 3DS File Format Toolkit, it was mentioned by ilive over in this thread on Simtropolis.    ;)

wouanagaine

#7
Great job Cogeo  :thumbsup:

The scaling have a great number of applications, thanks for that

One wish, if you can, add a way to tweak the UV mapping when scaling, sometimes I need to scale the vertices, and the uv need to be scale also ( instead of letting them the way they are in 99% of case )

New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

JoeST

fantastic sounding tool Cogeo :) thanks for sharing :)

Joe
Copperminds and Cuddleswarms

jeronij

These are most excellent news  :thumbsup:

I'll follow the development with interest. Specially the "refishing" part  ;)

I am sure you wont forget to include a transparecy manager in this set of fantastic tools as well  ;D  ::)  $%Grinno$%
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


cogeo

Thank you all for the nice comments!

@Pat: Errr... yes, this tool is basically for automating repetitive and tedious procedures that you would normally do with the reader.

@null45: Thanks for the info! Actually I did attempt to rebuild the reader, and the aforementioned library was the missing bit. There is also another point, reading and understanding the reader's code is a quite an amount of work. One would have to understand it in some depth before attempting to implement new functions. For example, some functions depend on the items selected, eg in order to perform a scaling the user should select all 20 Z/R S3D files of a model (if the model has 20 S3D files) otherwise the operation should not be permitted. The reader's current implementation works on individual files though. Instead in this tool, S3D files are grouped, as you can see in the pic, and you can only select a whole model, ie 20 S3D files (or 1 S3D file, for models with 1 Z/R). Rebuilding the reader would require a lot of testing, as it is the main modding tool. But I'm considering making a special release with mininal and local changes, requiring in-place fixes. Point I would like to improve are some annoying little features, like how lists like Occupant Groups, or Transit Switch Entry Point are displayed, ie nothing really "great". These are quite easy and safe to change.

@Jonathan (warrior? - so account names can be changed?): could you pls be a bit more specific? ie which settings you want to change and what are the changes you want to make?

@wouanagaine: I don't understand how you want to change the UV values. These are numbers in the range 0.00..1.00, denoting the realtive position of each point in the texture image, ie even if you resize a texture the UVs should remain the same.

@jeronij: Thanks! - See the button in the pic?

Another function I'm considering is merging of models, there are cases where this is needed, eg it is known that the Resource Key Type 4 property has problems with the shadows, and it might be useful for making models for bridges.

---

Ennedi

This will be an excellent tool cogeo! &apls

I have a request: an ability to rotate the model by a custom angle. Rotating by 45 degrees would be especially useful, but it would be also good to be able to make a model parallel to FAR/FARR network pieces. It would be the best to be able to choose any angle, recalculation of vertices coordinates needs using relatively simple trygonometrical functions.

Would it be possible? :)

Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

Jonathan

#12
Quote@Jonathan (warrior? - so account names can be changed?): could you pls be a bit more specific? ie which settings you want to change and what are the changes you want to make?

Being able to change all these settings, across multiple S3D files (including the actual textures [so like "set all group 0 materials to 0x0ABCDEF9"])


Also now I'm not sure what you mean by grouped, can you choose the groups?

QuoteAnother function I'm considering is merging of models, there are cases where this is needed, eg it is known that the Resource Key Type 4 property has problems with the shadows, and it might be useful for making models for bridges.

One feature that would be amazing, is creating previews, in puzzle pieces it is all split up into 16x16 segments, but the previews have to be all these segments put to together to form one big model. And you have to move each segment by copying the coordinates into excel and then copying them back(after putting a formula on them) which gets a bit boring when doing lots of puzzle pieces.  Is that what you mean by merging models?
btw, I realise not everyone needs/wants this, so if you do at all, put it last on the to-do list :)


Also we've noticed that in game some model display the textures differently (ie how the alphas are done, and if it has gradients) yet have the exact same settings in the reader and the same textures. Which makes you think if there are some settings for S3D files that the reader does not have "in it's UI".

What we really need is a modding tool that can do everything, the best bits from all of them in one tool :)
(and yep I am warrior)

Jonathan

cogeo

Adam, what you are asking for is not possible, I'm afraid. S3D files for normal BAT models (w/ 20 Z/R), contain only the polygons that are visible in each view aspect, ie the "back" faces are removed, obviously for optimisation. So this would only be possible for models with one S3D file, and actually not for all of them, only for those with "full geometry", like the automata models. If someone has a different opiniion or idea, pls post.

Ennedi

You are right cogeo, I checked it. That's a real pity.  $%Grinno$%

Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

SimFox

Quote from: Ennedi on April 12, 2009, 03:57:54 PM
You are right cogeo, I checked it. That's a real pity.  $%Grinno$%

Adam
besides, the FSHs are view dependent. so even if you rotate something and the face is there (for instance for a small angle) the look will immediately become distorted.

Ennedi

Quote from: SimFox on April 12, 2009, 04:44:14 PM
besides, the FSHs are view dependent. so even if you rotate something and the face is there (for instance for a small angle) the look will immediately become distorted.

I was thinking exactly in the same way ie. "what if I would rotate the model by less than 45 degrees?" I rotated the model view and saw the distortion. You are absolutely right.  $%Grinno$%

Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

wouanagaine

Quote from: cogeo on April 12, 2009, 03:13:29 PM
Thank you all for the nice comments!

@wouanagaine: I don't understand how you want to change the UV values. These are numbers in the range 0.00..1.00, denoting the realtive position of each point in the texture image, ie even if you resize a texture the UVs should remain the same.
This is for some special stuff, and UV can  be outside 0..1, that is where the 'UV Wrap' mode "repeat" is interesting



New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

cogeo

#18
Hi again,

I have made a pre-release version, which you can use for testing and evaluation.

It can be downloaded from the following link: <Get the official version from the LEX>


Some Notes:
- Currently only the scaling function is implemented. The tool should successfully recognize all S3D models, and skip all other file types (these should be saved unchanged).
- In almost all cases (as a result of operations) the filesize will need to be changed. The tool doesn't yet rebuild the DIR file automatically. For the time being this should be done in the reader, after you're done. I think the reader does this automatically upon save, ie you don't need to do this explicitly, just open and save. Anyways, the DIR file isn't a critical one, so most tools (and the game) will work normally, even if you don't.
- The help file is the default file generated by the compiler, so many items are missing. But it does contain help for the standard commands.
- The program doesn't change file associations for any file type (it's not a main modding tool, so this wouldn't be right). However it's quite simple to use, you can use the standard File Open command, or drag-and-drop.
- All information in the registry is stored under "HKEY_CURRENT_USER\Software\Cogeo\SC4 Model Tweaker". To fully uninstall the tool, you have to delete those entries too.
- No installer for the time being, you have to copy the files under a new folder and create a shortcut manually.

Please report your findings in this thread.

SimFox

so, no transparency enable in this release?