Menu

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

Author Topic: SC4 Model Tweaker Development/Support thread  (Read 78781 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
SC4 Model Tweaker Development/Support thread
« on: April 11, 2009, 04:54:33 PM »
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.
« Last Edit: May 13, 2009, 01:52:54 PM by BarbyW »

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 #1 on: April 11, 2009, 04:57:11 PM »
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.

Offline Pat

  • when life tosses you lemons, make lemonade!
  • 3RR Team
  • Forums Legend
  • *
  • Posts: 8812
  • Total likes: 6
  • Reputation: 45
  • SC4D Podcast, You Know You Wanna Hear IT!!!!
  • CL: ()pathfire() gettin' it right!
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #2 on: April 11, 2009, 06:01:35 PM »
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

Offline mattb325

  • BSC Team
  • Forums Parliamentarian
  • *
  • Posts: 1704
  • Total likes: 5619
  • Reputation: 26
  • CL:
    SC4D Housing Authority
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #3 on: April 11, 2009, 06:45:31 PM »
This looks like a great idea....I know of plenty of under/overscaled items that would benefit from such treatment

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #4 on: April 11, 2009, 07:58:02 PM »
Quote
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 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. ;)
 
« Last Edit: April 12, 2009, 09:18:04 AM by null45 »

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 #5 on: April 12, 2009, 02:41:39 AM »
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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #6 on: April 12, 2009, 09:09:14 AM »
Quote
Sure 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.    ;)

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 #7 on: April 12, 2009, 11:57:17 AM »
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 )
« Last Edit: April 12, 2009, 11:59:24 AM by wouanagaine »
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 JoeST

  • Forums Guru
  • *
  • Posts: 2648
  • Total likes: 15
  • Reputation: 10
  • fbstj
  • CL: Not your average...
Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #8 on: April 12, 2009, 12:10:59 PM »
fantastic sounding tool Cogeo :) thanks for sharing :)

Joe
Copperminds and Cuddleswarms

Offline jeronij

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #9 on: April 12, 2009, 12:39:19 PM »
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


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 #10 on: April 12, 2009, 05:13:29 PM »
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.

---

Offline Ennedi

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #11 on: April 12, 2009, 05:28:00 PM »
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

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 #12 on: April 12, 2009, 05:31:57 PM »
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?

Quote
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.

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

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 #13 on: April 12, 2009, 05:41:12 PM »
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.

Offline Ennedi

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #14 on: April 12, 2009, 05:57:54 PM »
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

Offline SimFox

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #15 on: April 12, 2009, 06:44:14 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.

Offline Ennedi

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #16 on: April 12, 2009, 06:54:31 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

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 #17 on: April 13, 2009, 03:20:03 AM »
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

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 #18 on: April 13, 2009, 11:23:06 AM »
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.
« Last Edit: May 10, 2009, 05:53:14 AM by cogeo »

Offline SimFox

Re: New Custom Content Tool - SC4 Model Tweaker
« Reply #19 on: April 13, 2009, 02:29:19 PM »
so, no transparency enable in this release?