Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat
Welcome, Guest. Please login or register.
Did you miss your activation email?

December 03, 2021, 02:03:44 AM

Login with username, password and session length

Author Topic: Model Tweaker tutorial  (Read 6390 times)

0 Members and 1 Guest are viewing this topic.

Offline Swordmaster

Model Tweaker tutorial
« on: February 16, 2013, 06:30:21 PM »
Model Tweaker tutorial (scaling models)


Model Tweaker is a nice way to take control over models for people who are too awkward (or in my case too lazy) to use BAT. Here's one way to approach it.

NOTE: Before you edit any model files, make a backup. It's silly to have to download the whole bunch again if you botched up.



It's easiest to learn how to use this tool by picking a model that you have in a single SC4Model file or a small DAT. Let's use this little church here as an example. The model files are in JENX_Antwerp_Cathedral.dat so open that file in Tweaker.


You'll see the main cathedral model listed at the top. Right click and select "Scale Model".




Pick the decimal factor option. A value of 0.75 rescales the model by 75%.




Save the file and you're done!



However, if you want to resize a prop in a bigger pack, you first need to locate it in the pack. Some packs have their models named, many do not. In the latter case, the easiest way to find your prop anyway is to use Lot Editor. Let's try the big Redwood from BSC MEGA Props - CP Vol01. Picking the prop in Lot Editor you can find out the prop's IID which is listed in front of the name:




Now open the prop pack in reader. Don't fill the list just yet - it's a lot of stuff - pick the filter first.




Click Uncheck all, Exemplar, and Refresh.




Now you get all the exemplars in the pack listed. Click the Instance column to sort on that value.




Then hunt down the correct exemplar by refering to the number you got in Lot Editor. Select that exemplar and look at the right hand part of the reader window. Find the Exemplar Name to double-check if it's the right prop.




Okay, now you've got your prop exemplar but that won't do anything. What you need is the model files. Well it so happens that this prop exemplar references the model files (that's its purpose), and it does so through a value called "Resource Key Type" (RKT). An RKT 1 such as this simply lists the Type, Group, and Instance (TGI) of the model in that order. Other types of RKT do it differently, but let's not get into that now. All you need is the TGI of the model.




Now you've got them, go back to Tweaker and open the prop pack. Now sort on the column "Instance" to find your Redwood model.  Repeat the steps in the first part (including the BACKUP !) and you're done. (You don't need to save anything in reader, all you needed it for was to get information.)


Note: some packs have models all with the same Instance. In that case, you need to sort on Group.



Happy modding!



Cheers
Willy

Offline Diggis

Re: Model Tweaker tutorial
« Reply #1 on: February 16, 2013, 07:29:14 PM »
Great tutorial Willy. Only thing, most models should have different group IDs, not instance IDs. Only Maxis models and old BAT models will differ in instance ID.

Offline Swordmaster

Re: Model Tweaker tutorial
« Reply #2 on: February 16, 2013, 07:38:41 PM »
Thanks Shaun. I was already wondering why some packs had it the other way. I'll change the wording.


Cheers
Willy

Offline rambuckel

  • Forums Governor
  • *
  • Posts: 355
  • Total likes: 1
  • Reputation: 3
  • RFR-Team
  • CL:
    Epona
Re: Model Tweaker tutorial
« Reply #3 on: February 17, 2013, 04:18:34 AM »
Thanks a lot Willy! I'll definitely try it the next time I need it!

- Theresa
Angels can fly because they don't take themselves too serious!


Offline Diggis

Re: Model Tweaker tutorial
« Reply #4 on: February 17, 2013, 04:33:08 AM »
Thanks Shaun. I was already wondering why some packs had it the other way. I'll change the wording.


Cheers
Willy

It was something to do with the original BAT scripts. They varied the instance ID not the group ID. It resulted in larger buildings having overlapping IIDs on the fsh files and ending up with streams on the side of a sky scraper.

Offline weixc812

Re: Model Tweaker tutorial
« Reply #5 on: February 17, 2013, 07:42:36 AM »
As a recent user of this tool, I'm so happy to see this. Are you going to post directions for other utilities of this tool, Willy? For example, rotation and move?
Welcome to AL•FERRID(UPDATE 5-District C)
And my other pics at SimCityChina:click here

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3364
  • Total likes: 580
  • Reputation: 23
  • CL:
    Street Smarts
Re: Model Tweaker tutorial
« Reply #6 on: February 27, 2013, 10:07:15 AM »
Great tutorial!  &apls

Two minor things though. .  ;)

Pick the decimal factor option. A value of 0.75 rescales the model by 75%.

The Tweaker clearly states this is factor, not a percentage! The difference being this is a term used in the rescaling algoritm (wherein x=.75, among other variables). Or that's my interpretation at least, maybe Cogeo could shed some light on this. 

Secondly, in my experience it's faster and more convenient to use the Analyser for hunting down props and properties. 



With the megaproppack opened in the Reader, hit the Analyser button, this brings up a new window.



In this new window hit the search button first of all. This fills the list with all the exampler files present in the megapack.
Secondly hit the prop icon to search for a particular property, this again will bring up a new window.



Start typing the name of the property in the search field. In this case 'reso' will do, then select Resource Key Type 1 from the dropdown menu and hit find.
Finally click the top of the Exemplar column to sort by name. The resource key type is listed on the right hand side in the Value column.

Sure, I'm well aware with the Reader there're always multiple routes to get at the same result. Moreover, the Analyser might be a bit daunting at first with all the new windows popping up, however, imho it's a powerfull feature which allows one to quickly scan content and it also allows for quite fast bug tracking. My two cents.  :)
time flies like a bird
fruit flies like a banana

Offline Swordmaster

Re: Model Tweaker tutorial
« Reply #7 on: February 27, 2013, 10:28:25 AM »
Great Vortext, thanks. My method however started from the idea that you don't know what name a prop has or which one exactly it is. But if you do know it, your method is indeed faster :thumbsup:  As for the factor, I don't really know what you mean. Isn't factor 1 = 100%, therefore 0.75 = 75%?

Nick, I'll see if there's anything I can say about the other functions. I've only used 'move' once or twice.


Cheers
Willy

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3364
  • Total likes: 580
  • Reputation: 23
  • CL:
    Street Smarts
Re: Model Tweaker tutorial
« Reply #8 on: February 27, 2013, 11:38:37 AM »
Isn't factor 1 = 100%, therefore 0.75 = 75%?

Apparently not!  $%Grinno$% Kidding aside, I've wondered many times myself what exactly it entails then, so yeah, kind of a mystery.

Anyhow, as for the other functions; both 'move' and 'reorientate' are pretty self-explanatory. The former allows you to move a model alongside any of the three dimensional axes. This is usefull either for offsetting a model or to take an offset model back to center. I've done both on numerous occasions and it's really easy. The latter allows you to rotate a model 90 degrees, which can be usefull for example if you want to create a propfamily but have one model which faces the wrong way. I've done this a few times and again, it's real easy.

The other funtions I'm not familiar with, maybe someone else is?
time flies like a bird
fruit flies like a banana

Offline FrankU

  • It's Frank, the U is just for the suspense
  • BeNeLux Team
  • Forums Guru
  • *
  • Posts: 3348
  • Total likes: 228
  • Reputation: 14
  • Dutch Housing Project
  • CL:
    U Grow It
Re: Model Tweaker tutorial
« Reply #9 on: February 27, 2013, 03:07:31 PM »
Willy,

This is a valuable tutorial. Thanks for that.

But I think there is an important thing that is forgotten in your tutorial.
And that is that if you scale the model with Tweaker you scale it in all your cities and on all your lots. If you do not want to do that, you first have to make a new "model" by copying all S3D (20 of them) exemplars of the original model into a new dat file. Then give these S3D exemplars a new IID or GID (I do use IID and give the fifth digit, which is 0, a new value). Then you can rescale this new "model". I put model in beween quotation marks, because this set of S3D exemplars is not a real model. You need the original prop/model pack with the FSH files in order to see anything in your lot. With this setup you can make as many changes to the model as you like, you can upload it to the community without overwriting someone's work and you conserve the copyrights of the original BATter.
If you like, please elaborate on this for the ones who do not understand this yet. If needed I could do it too, but my time is limited... Like yours, probably.

Frank

Offline Kergelen

Re: Model Tweaker tutorial
« Reply #10 on: February 27, 2013, 03:29:54 PM »
Oh Frank, that's really interesting. &apls

I'm planning to share some content I'm currently working where I use a prop of a re-sized Heblem's sand model (and thought I would have to delete the prop in order to share), and now you give me the key to share resized models! Thanks. :)

Thanks swordmaster for the tutorial. ;)
« Last Edit: February 27, 2013, 03:33:58 PM by Kergelen »


                                    Links to SC4 websites

Offline Swordmaster

Re: Model Tweaker tutorial
« Reply #11 on: February 27, 2013, 05:44:06 PM »
Willy,

This is a valuable tutorial. Thanks for that.

But I think there is an important thing that is forgotten in your tutorial.
And that is that if you scale the model with Tweaker you scale it in all your cities and on all your lots. If you do not want to do that, you first have to make a new "model" by copying all S3D (20 of them) exemplars of the original model into a new dat file. Then give these S3D exemplars a new IID or GID (I do use IID and give the fifth digit, which is 0, a new value). Then you can rescale this new "model". I put model in beween quotation marks, because this set of S3D exemplars is not a real model. You need the original prop/model pack with the FSH files in order to see anything in your lot. With this setup you can make as many changes to the model as you like, you can upload it to the community without overwriting someone's work and you conserve the copyrights of the original BATter.
If you like, please elaborate on this for the ones who do not understand this yet. If needed I could do it too, but my time is limited... Like yours, probably.

Frank

Frank, I wanted to keep at least this first part down to the basics. Some of the things you described can be overwhelming and I'm not trying to scare people off. (I actually made this tutorial for Theresa based on this post.) But you're right. In fact I did this with a couple MMPs; I have different Girafe bush sizes side by side.

On the topic of sharing, that's an interesting and important point you make. But I think it requires some thought and discussion. I stand by the principle of not redistributing model files but that's just me. You're right that the FSHs are unaltered and still a dependency, but that's only part of the story. If this is about credit, yes. If this is about considering custom models a piece of art, then maybe it needs more careful treatment. But I'm not the person to make a decision on things like that.


Cheers
Willy

Offline NCGAIO

Re: Model Tweaker tutorial
« Reply #12 on: February 27, 2013, 06:27:13 PM »
More detailed information about TGI to BAT

“<GEN> and <mGEN> are generated group and instance ID's that are specific and unique to a computer and are designated at the time that particular modding tools are installed.”

“The Group ID <GEN> is the custom GID for the models, textures, exemplars, xml's and pictures created on that particular computer. Its purpose is to add yet another random factor to building design so that buildings don't conflict ”

source: wiki

so ... TGI for S3d BAT is thus

T_ID - 5AD0E817 < common Type >

G_ID "<gen>" - Computer specific BAT Generated S3D model

I_ID -  0x AAAABCDO

          Format =   0x AAAA....B.... C..... D..... 0 – NOT USED
.                               |        |     |      |_ Rotation ( 0-3)
.                               |        |     |_Zoom ( 0-4)
.                               |        |_Foundation Flag (is foundation or not)
.                <mGEN> _|
                        |
Model ID < mGEN > is the first 2 bytes of the Instance ID of models and textures ..
in BAT may also be considered as Bulding family starting in 0001.

Not forgetting that all original models use G_ID - BADB57F1 - (Maybe the reason to change the instances at the beginning of modding.).... and still have to observe other parameters.

<gen> - Computer specific Lot Description XML file
           0xAAAAAAAA
              A = Same as applicable parent file for each of .SC4model, Lot, Desc
                  For example, Model = main S3D, Lot = main exemplar, Desc = main exemplar.

The change in size distorts the information contained in

-   XML  - <DIMENSIONS Width="xx" Height="xx" Depth="xx"> used in Lot editor

Well as property Occupant Size - in exemplar_file that must be corrected.
« Last Edit: February 28, 2013, 10:22:46 AM by NCGAIO »

Offline FrankU

  • It's Frank, the U is just for the suspense
  • BeNeLux Team
  • Forums Guru
  • *
  • Posts: 3348
  • Total likes: 228
  • Reputation: 14
  • Dutch Housing Project
  • CL:
    U Grow It
Re: Model Tweaker tutorial
« Reply #13 on: February 28, 2013, 09:59:21 AM »
Hi Willy,

I can see that it was maybe a good start that you limited yourself in the tutorial. A sequel about renumbering etc would be useful for a lot of people though.

The coyrights matter was not jsut invented by me. I discussed it with Cogeo and Lowkee33 in this thread. Take a look at replies 168 up to 172.
I guess it is OK, and I sincerely hope so, because otherwise I am breaking quite some copyrights with my farm fields, rewards and upcoming farm lots....