Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat

Author Topic: SC4 Model Tweaker Development/Support thread  (Read 78782 times)

0 Members and 1 Guest are viewing this topic.

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #20 on: April 13, 2009, 04:33:50 PM »
Replies to your posts:

@Jonathan: Pls get the tool as is, and take a look. Then it would be easier to describe what exactly you want. Changing the texture for Group 0 (or Group X, in general) is quite risky - assumes that all S3D files contain the same number of Groups, ie groups of the same order (with the same number) in each S3D file contain a "similar" model. This is not a safe assumption for normal BATs (20 Z/R) as the model(s) may be split into more than one groups for closer views; actually this may occur with 1-Z/R models too. Btw by "grouped" I meant grouping of 20-Z/R S3D files into one, as you can see in the pic (the minimum object that operations can be applied on is the whole model, ie in the case of a 20-Z/R model, they can be applied on the whole model only). Also by "merging" of models I meant append one model to another. Generating previews is something similar, though a bit different, ie requires also shifting of the models to be appended.

@wouanagaine: I see. Could you describe in more detail what exact transformations you want? Also send me a sample file, if you have a unmodded version and a modded one, so much the better.

@SimFox: not yet, but I'm working on it  :)

Offline buddybud

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #21 on: April 13, 2009, 06:33:51 PM »
wow this awsome...thanx alot  :thumbsup:

bud

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 5
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #22 on: April 14, 2009, 02:15:33 AM »
Cogeo, I downloaded it very nice work  :thumbsup:
What I'd like to be able to do is,
set the Wrap mode U & V(or any of the other settings I showed in that picture) to clamb (for example) on all the S3Ds I select.
Changing the texture of a group is more a network model thing, but could be like:
If material name = xxxx then change material IID to 0x12345678
or could be like:
If material IID = 0x12345678 then change material IID to 0x87654321

Jonathan

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #23 on: April 14, 2009, 03:15:58 AM »
You can see it in my lake picture on 3RR, I've took a plopable water S3D that I scaled by 100, however if I left the UV the result is ugly as the such a magnification result in horrible pixelisation of the FSH used. I then scale the uv by 100 also and set the UV wrap method to "mirror". Same method can be used on NAM pedestrian tiles, scale it by 10 and scale it by 10 also on uv
This is of course very specific and only interesting for such S3D files.

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

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 5
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #24 on: April 14, 2009, 03:55:01 AM »
There's a mirror setting on S3D files?
EDIT: That's what I meant, in the reader I only have clamb and repeat?
So that's how you did it ;)


Jonathan

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #25 on: April 14, 2009, 03:57:53 AM »
There's a mirror setting on S3D files?
So that's how you did it ;)
There is a mirror setting on the UVs on how to handle UV outside the 0..1 range

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

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #26 on: April 15, 2009, 03:53:26 PM »
Hi again,

A new version of the tool is going to be made tomorrow. The Set Transparency command appears to work , and generates a report with all actions taken. Also the list is now sortable (by Num, IDs and Z/R), and the selection remains highlighted while setting the options.

@Jonathan: Still don't understand, while setting wrap modes is simple, the other operations you are asking for are a bit tricky, I would say, and rather not well-specified. What's the point of setting the materials for ALL models to the same value? Won't you still have to go and edit them one by one? Also the material name is not realiable information, often modders change the TGI only, and not the name. Maybe a more meaningful operation would be to set the material for the selected items to be the same as the Instance IDs (and Group IDs, for 20-Z/R models). I think you will have to specify in more detail not only the operations, but the tasks (procedures) you wish to automate. Also you said about some features that you think they are not in the Reader's UI. Could you be more specific, it would be interesting to examine them in some more depth.

@wouanagaine: Can't find them! Pls provide some links, and specify the operation(s) in some more detail. If it's something simple, it could be done even tomorrow.

I would welcome any help from anybody having a deeper knowledge of S3D files. The programming interface is quite strange. It returns a list of materials (groups), for which you can set the options, but each of these elements then contains another... list, which makes little sense to me, I mean it should rather be a single element. The reader's UI is implemented this way too, ie you can onlt have one mat (TGI/name) for each mat group, no a list! I checked the models in simcity_1.dat, and in almost all of them the aforementioned list contains exactly one mat (TGI/name). I have found some few ones with no mats (?) in the second group, ie these appear to be empty!. Also I'm not sure if the number of vertex blocks must be the same as the number of Anim and material blocks (1:1 correspondence). Again, this IS the case for most models, but in quite a few ones, these differ. Is this OK, or instead a result of programming/modding errors?

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 5
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #27 on: April 15, 2009, 04:55:28 PM »
Well when there are transit models often you need to change multiple mats to a certain texture.
For example overpasses, changing the networks that go under them, you copy the first S3D (so the mats are in the same order, have the same ID and same Mat name) and then have to manually change each mat to the next network that goes under the overpass. Get my example?
I'm not sure what you mean by tasks and not operations?

A setting not in the reader's UI I found(not sure if anyone else has found it though?)
Quote from: from me in the NAM board
On the rail under maxis hwy the alpha has the gradient displayed properly but on other models (such as el-rail and monorail over rail) it doesn't even though all settings in the reader's UI are identical, I now found the byte(?) that change to get the gradient so you have edit the file manually using hex.
Top(monorail) is before, bottom(el-rail) is after.

Right Click S3D file,
Hex editor(decoded file)
Scroll down to the MATS section (says MATS on the Acsii column)
Then find the texture needed to be changed, in this case "STR Orth"
Then go back up along the hex till you get to"FF 7F" then change the 7F to 00 (The FF didn't seem to have any effect, but in the highway over STR model both FF and 7F were 00s, so the affect of FF needs to be tested further)


Maybe there is some option in there to make the brightening not occur?

Jonathan

Changes how the alpha is used (allows the greys, so semi opaque)

Jonathan

Offline sithlrd98

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #28 on: April 15, 2009, 05:11:46 PM »
Hello Cogeo ,
I have been trying out this new tool , hoping that it would save me the frustration of model resizing. However , since I am not a BATer , I am stumbling with how to downsize a model that I think is way too big. I don't fully understand how to do this since I am not exactly sure that this tool can do it.I know enough to know that I don't know what I'm doing and this seemed to possibly be easier than the MODding rendered SC4Models tutorial.

Jayson

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #29 on: April 15, 2009, 05:20:24 PM »
It shouldn't be so hard:
- Backup your model (or dat) file
- Open the file (or drag-and-drop it on the tool)
- In the list, select (highlight) the model(s) you want to resize.
- Click the resize menu or button, and specify the scaling factor.
- Save the file and exit.
- Open the file in the reader and save it again (newer versions won't requir thiis).
These should be enough. Make sure that no copies of the (old) model exist in your installation (possibly overriding the modded one).
Pls let me know the results.

Offline sithlrd98

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #30 on: April 15, 2009, 05:53:08 PM »
OK , at least I know I was doing it correctly  :)

So , I had already done this the other night and here is what I noticed:first , I was'nt sure which direction to go so I chose decimal factor of .75
Of course I saved and , using DatGens model viewer ,  checked out the first S3D of the resized and the original and noticed that , on my default zoom 3 , there visually is a difference as the changed model does appear smaller although both model files are the same size.(checked in reader , re-building the dir). Opened up in LE and even though the model looks smaller , the "bluebox"foot print is still as large as the original...(my explanation make sense?) So , I decided to manually change the XML that PM uses to create a new .desc.....no luck.
LE:


Here is the model in reader , original on right , so the model is smaller! Just can't fill in the blanks!


Jayson

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #31 on: April 15, 2009, 06:15:23 PM »
I see. Some notes:
- There is no difference in which form of scaling factor you choose. Use the one that's mostly conenient to you. The 0.75 factor could instead be entered as a 3/4 fraction, it's the same.
- Completely forgot about the XML. However, the only thing this affects is the (default/original) prop/building size set by the PM - only the PM apprears to use this, and you can change this in the reader if you wish.
- To change the footprint of your building or prop (gray and blue rectangles, respectively) use the reader and change the Occupant Size property accordingly. There is no propblem if you specify a different (usually smaller) size, actually this technique is used by many BATters/modders for making overhanging props (in this case the actual model is much larger than what Occupant Size saiz). The only thing this affects is the size of the rectangle in LE (Tip: never make it exactly as large as the Lot, this may cause the dreaded Immortal Lot Syndrome). It's impossible for this tool to chaeck ALL exemplars that may be referencing the model (and it wouldn't be desirable either), so you have to make this yourself.
- Changes won't be reflected immediately in the (old) lots, for props you have to delete them and place them anew, while for buildings click Replace (and select the same building again).
Hope this helps.
« Last Edit: April 15, 2009, 06:22:05 PM by cogeo »

Offline sithlrd98

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #32 on: April 15, 2009, 06:35:35 PM »
OK , so I forgot about the Occupant size ,I feel real dumb right now!  It worked almost perfectly as I see that I'll have to tweak the model size slightly , but thank you so much for this tool!!!!!! Its right up there as a much valuable as any tool I've used!

Jayson

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #33 on: April 16, 2009, 11:31:46 AM »
Hi again,

I have just uploaded a newer version of the tool.

The download address is <Get the official version from the LEX>


Features and changes:
- The Set Transparency command is implemented, and generates a report with all actions taken.
- The list is now sortable (by Num, IDs and Z/R), and the selection remains highlighted while setting the options.
- The Help file is updated, all the default/unused entries were removed, and there is some introductory help on using the commands (though not yet in detail).
- The View->Toolbars and Docking Windows->Customize and Window->Windows commands now work.
- Several bugs of the previous versions were removed.

Still need to be implemented:
- 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.
- More detailed help.
- Installer.

Some Notes:
- 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.

INSTALLATION
- There is no installer for the time being, you have to copy the files under a new folder and create a shortcut manually.
- If you had installed the previous version you will have to open the registry editor (in your Windows Taskbar select Start->Run, and type-in regedit), go to  "HKEY_CURRENT_USER\Software\Cogeo\" and delete key "SC4 Model Tweaker" (and its subkeys). This step is required before installing the new version, otherwise some menu commands may not be displayed, as the program stores there the "personalisation" oprions of the old version. Then overwrite the installed files with the new ones.

Please provide your feedback or suggestions.
« Last Edit: May 10, 2009, 05:51:56 AM by cogeo »

Offline jeronij

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #34 on: April 16, 2009, 03:37:51 PM »
Hello cogeo,

First let me thank you for the development so far of this fantastic tool  :thumbsup: . As soon as I saw this sentence: "- The Set Transparency command is implemented, and generates a report with all actions taken." I downloaded and tested it  ;D

I havent had any problem during the installation and execution of the tool. I could open my model and set the transparency for all the zoom levels. The tool did its task quite well, and the model was correctly set to transparent.

However, I have an special need for my current models (transparent plopable water) because they will be placed in a way that they may overlap, and we dont want to see these joints  ::) . I used to manually set the "Depth Func" property to "Less than", which gives me the best result for my models, making the joints almost invisible... would it be possible to add some more options to the transparency tool, which would allow for a more adjusted parametrization, like the one that I am mentioning...  ;D ?

Anyway, thanks for your efforts, and for giving us a so fantastic tool, which will allow a much richer modding environement  :thumbsup:
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


Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #35 on: April 16, 2009, 04:55:07 PM »
Replies to your posts:

@jeronij: Thanks for the nice comments! One question, are these files normal BAT models, ie w/ 20 Z/R views, or with just 1, using the kSC4BuildingModelRotationProperty? (this makes much more sense to me, as these are just flat shapes). This would be quite easy to change, ie the DepthFunc value could be parametric. The transparency tool should be changed too, to allow setting transparency for 1-Z/R models as well.

@jonathan: I still don't understand what you need a "filter" for, like "If material name = xxxx then change material IID to 0x12345678" or "If material IID = 0x12345678 then change material IID to 0x87654321", shouldn't it be enough to set the material for selected items (I mean don't you have control over it)?. As for those things that are not in the reader's UI, I would need the modded and unmodded file, to see what that FF really does.

@wouanagaine: Pls specify the desired opetations in more detail, and send me a unomoded and modded example. I don't know what the "mirror" setting is (value pls?), it's not in the reader's UI either.

Offline jeronij

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #36 on: April 16, 2009, 05:16:05 PM »
Replies to your posts:

@jeronij: Thanks for the nice comments! One question, are these files normal BAT models, ie w/ 20 Z/R views, or with just 1, using the kSC4BuildingModelRotationProperty? (this makes much more sense to me, as these are just flat shapes). This would be quite easy to change, ie the DepthFunc value could be parametric. The transparency tool should be changed too, to allow setting transparency for 1-Z/R models as well.

The models are standard bat models, 20Z/R. I never tried to use one single model for this... not sure how the game would handle the textures across the different zoom levels in that case.

However I think that anticipation is good, and allowing transparency for 1Z/R models would be much appreciated... just in case...  ;D

Also expanding the transparency parametrization options would be an excellent asset, if it is not too complicated and time comsuming  :thumbsup:
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


Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #37 on: April 16, 2009, 05:38:57 PM »
Using 1-Z/R models can actually be advantageous, because you get rid of BAT and all the distortions it causes (namely the blurring and the "jaggies"). Take a look at network piece in the game, you can see how much better the textures look (against models), despite still being low-res. Ie resolution is not an issue for these, and the model actually uses far fewer resources. They are displayed through such flat models. You can find such models in NAM's ped-mall tiles, they are 16x16 models containing just four vertices. These are quite easy to be enlarged, and use larger textures (or maybe tiled textures). As for the farther zoom levels, I think there would be no problem, but there is still one Resource Key Type X property, specifying a separate model for each zoom level.

What changes dramatically is the development procedure, ie this is not modelling, but actually just texturing - and you can immediately see the effects of this texturing in your models, not wonder and pray about what BAT will finally export.

Offline SimFox

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #38 on: April 17, 2009, 05:40:02 AM »
Sadly this tool doesn't seem to work in 64 bit Vista Ultimate.
It opens fine, but once I've set all the desired transparencies it appear to be working but then this message pops up:



and program shuts down...

I checked the file I was working on later and no transparencies were set...

Offline jeronij

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #39 on: April 17, 2009, 09:45:16 AM »
Using 1-Z/R models can actually be advantageous, because you get rid of BAT and all the distortions it causes (namely the blurring and the "jaggies"). Take a look at network piece in the game, you can see how much better the textures look (against models), despite still being low-res. Ie resolution is not an issue for these, and the model actually uses far fewer resources. They are displayed through such flat models. You can find such models in NAM's ped-mall tiles, they are 16x16 models containing just four vertices. These are quite easy to be enlarged, and use larger textures (or maybe tiled textures). As for the farther zoom levels, I think there would be no problem, but there is still one Resource Key Type X property, specifying a separate model for each zoom level.

What changes dramatically is the development procedure, ie this is not modelling, but actually just texturing - and you can immediately see the effects of this texturing in your models, not wonder and pray about what BAT will finally export.

It sounds like a promising way to study  ;) . I never dealed with s3d's and the Reader, everything looks so confusing when you open all those tabs, compared to a simple exemplar or texture...  ::)  $%Grinno$%  :D :D

I'll make some tries with this time permiting  ;D
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