SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => Tips, Tricks and Tutorials => Tutorials on Custom Content Creation => Topic started by: cogeo on December 15, 2009, 01:37:20 PM

Title: Tutorial: SC4 Automata As Props
Post by: cogeo on December 15, 2009, 01:37:20 PM
This tutorial demonstrates how to make (static) props for SimCity 4, using the ingame (and other) automata models (no 3D modelling required). Such props had already been released since the early days of SC4 custom content development, so this isn't anything new. However, many modders are still unaware of the option, and this is the purpose of this tutorial.

Table of Contents

1. Introduction (#post_AN1)
2. Basic Knowledge (#post_AN2)
3. Example: Orthogonal and Diagonal Bus Props (#post_AN3)
    Notes (#post_ANN)



1. Introduction

The Simcity 4 dats contain a huge collection of automata, being displayed by the game in normal gameplay and UDI missions. Modders can make props out of these (for use in lots). The quality of these models is superior to the ones generated by the BAT, as the BAT renderer (with all its known problems, like blurring, distortions and loss of detail) is not invloved in the process.


2. Basic Knowledge

Making a prop using an automaton model is a very simple task, with only few differences, compared to BAT models.

The basic difference is that automata models consist of only one S3D file, used in all zoom/rotation views. In contrast, BAT models have 20 S3D files, one for each zoom level and rotation (5 zooms x 4 rotations). The (lone) automaton model contains all model faces (and not only the ones that are visible in each specific view), because the model must be possible to be rotated by any possible angle (eg consider a car turning around on a street-end tile).

The way to reference (display) such a model in a prop exemplar is through the use of the Resource Key Type 0 property. The property's value (just like in the Resource Key Type 1) is the TGI address of the model to be displayed. The only difference is that this property references a model with 1 S3D file, while Resource Key Type 1 references a model with 20 S3D files (BAT-exported models).

You also need to add the kSC4BuildingModelRotationProperty property in your prop exemplar. Without this property, your prop will always display the same (front) side, as you rotate the city view ingame. The kSC4BuildingModelRotationProperty makes the model rotating together with your city. Weird, but the value of this property is ignored, it can be true, false or empty, it makes no difference. Only its presence is required.


3. Example: Orthogonal and Diagonal Bus Props

Now let's see how the above can be applied to make a prop displaying the ingame bus model, in orthogonal as well as diagonal form (as the model has "full geometry", it can be rotated by any arbitrary angle, without quality degradation).

The steps to make such props are:

1) First locate the bus automaton exemplar in simcity_1.dat. This can be done with the help of iLive Reader's Navigator tool. The TGI address of this exemplar (Vehicle_Bus_normal_10620000) is 0x6534284A, 0x096E6739, 0x10620000. The Model Resource Key property specifies the model displayed (we will use it in our prop). So the model's TGI address is 0x5AD0E817,0xBADB57F1,0x10620000.

2) Locate this model in simcity_1.dat, copy and paste it in another datfile. As in our example we also have diagonal props, make three copies. This step (as well as the next two) is not required, if you are not going to make diagonal props.

3) For the diagonal props, assign the copied models different IDs, so that they don't conflict with the original. In our case I have assigned them the following instance IDs: 0x1062FFF1, 0x1062FFF2 and 0x1062FFF3. Not only these are not used in simcity_1.dat, there is also no chance that these IDs can be used by BAT, as BAT uses different IDs (eg the 5th digit can only be 0 or 8).

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi972.photobucket.com%2Falbums%2Fae207%2FCogeo%2FSC4AutomAsProps1.jpg&hash=ebfe91509679f0fe843d36ea994e417429b034d3)

4) Now we have to rotate our copied models as needed. Download and install SC4 Model Tweaker (http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=2072) from the LEX. Open the datfile containing the models, and rotate them by the desired angle (in our case 45°, 22.5° and -22.5°, but you can specify any angle you wish). Save and exit.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi972.photobucket.com%2Falbums%2Fae207%2FCogeo%2FSC4AutomAsProps2.jpg&hash=c142c95d8d69be114ef7466c69a548ecf86931ec)

5) Now we have to make the prop exemplars. These can be generated by the Plugin Manager. This is supposed to guarantee a unique ID for each prop (now how this is done, as there is no a centrally-kept registry, this is another story, but let's believe them). PM can generate prop exmplars only for BAT models (with 20 Z/R), so we can use another model to generate the prop exemplars and then change the properties ourselves. Drag the model onto the "Prop" node in PM, and give the prop exemplars some meaningful names. I have named them Prop_SC4BusAutom_000, Prop_SC4BusAutom_225, Prop_SC4BusAutom_450 and Prop_SC4BusAutom_675 (they will display the bus model at 0°, 22.5°, 45° and 67.5° angle respectively).

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi972.photobucket.com%2Falbums%2Fae207%2FCogeo%2FSC4AutomAsProps3.jpg&hash=269f5314a71a454df1512b296c8af0db6b884dc6)

6) Finally, copy all four prop exemplars into a (new) datfile, and delete the .SC4Desc files. Go to each prop exemplar and change the Resource Key Type 1 property to Resource Key Type 0; and of course change their value so that they reference our (copied) models. Also add the kSC4BuildingModelRotationProperty property. And finally set all other properies (User Visible Name Key, Flammability etc) to meaningful values. In our case the Occupant Size property (this determines the blue prop rectangle size) was set to values calculated from the model's vertex coordinates extremeties (min and max values), thus corresponding to the model's exact dimensions.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi972.photobucket.com%2Falbums%2Fae207%2FCogeo%2FSC4AutomAsProps4.jpg&hash=3c09d49f7c19285dcff3ce72d1457291541278b5)

7) We are done. Now you can use the props in your lots.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi972.photobucket.com%2Falbums%2Fae207%2FCogeo%2FSC4AutomAsProps5.jpg&hash=004012d0b0dadf9d3608325ea354433adc64d43c)

The datfiles made for this tutorial have been attached at the end of this post. You may examine them to see the technique, or use them in your lots privately, but not release lots use them as a dependency.


Notes:


Hope you found this tutorial useful.

EDIT [vester]: Removed the URLs around the images for easier use and replaced it with a width to the img tag.
Title: Re: Tutorial: SC4 Automata As Props
Post by: RippleJet on December 15, 2009, 02:22:28 PM
Thank you, Cogeo! Karma going to Greece! :)

I wonder if I could talk Wouanagaine into allowing the creation of a basic prop exemplar out of any automata model in the next version of SC4PIM... ::)
Title: Re: Tutorial: SC4 Automata As Props
Post by: nerdly_dood on December 15, 2009, 02:30:52 PM
I think there already is one - at Gizmo's site (http://gizmo.lunarpages.com/) you can download SC4 automata as props, and I've used their exemplars to make Tru3D props out of my own police car models. (But I haven't asked permission, nor have I done it for my latest models, so I won't be releasing such props anytime soon.)

Of course, lifting the exemplar from Gizmo's files to use as an automata-as-prop template would require his permission, but as I'm not looking to release props anytime soon, it's not entirely necessary (for me at least)
Title: Re: Tutorial: SC4 Automata As Props
Post by: Gwail on December 15, 2009, 02:38:26 PM
Quote from: RippleJet on December 15, 2009, 02:22:28 PM
I wonder if I could talk Wouanagaine into allowing the creation of a basic prop exemplar out of any automata model in the next version of SC4PIM... ::)
Of any s3d model, perhaps ;)?
Title: Re: Tutorial: SC4 Automata As Props
Post by: petitecherie1981 on March 01, 2010, 03:27:17 PM
Hi Cogeo

First of all thanks for the tutorial.
I wondered if you could help me out, because I think I'm stuck with changing my automaplanes in (static) prop planes.

I finished step 5 correctly and have into SC4 PM props a file named 'test767'
Then step 6
'6) Finally, copy all four prop exemplars into a (new) datfile, and delete the .SC4Desc files. '
I don't see how to copy them, I don't see any copy fonctions? Can I find the 'test767' in the Reader?

Can you please help me?

Kind regards
petitecherie

ps, with this way of changing an automa into a prop file, I can still reskin like I do for the automa files? With the 3Ds files and fsh files?
Title: Re: Tutorial: SC4 Automata As Props
Post by: cogeo on March 02, 2010, 11:37:44 AM
My suggestion of moving the prop exemplars into a (new) datfile does not have to do with functionality, but instead with packaging. This is easy to do in the reader, first open the .SC4Desc file, locate the prop exemplar in the list, right click and in the menu select "Copy file(s)". Then open a new instance of the reader (or select the blank.dat file in the same instance), right-click on the list and select "Paste file(s)". Finally save blank.dat under a different (meaningful) filename.

As for your question about reskinning, this is absolutely possible, of course. A model (S3D file) can be referenced (used) by both an automaton exemplar and a prop exemplar. In such a case, reskinning the model will affect both the automaton and the (static) prop. If you want different skins available (at the same time) as different props, you have to make copies of the S3D file, assign the copied ones different IDs, and apply a different skin to each copy.