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?

July 24, 2021, 06:45:57 PM

Login with username, password and session length

Author Topic: Tutorial: SC4 Automata As Props  (Read 10151 times)

0 Members and 1 Guest are viewing this topic.

Offline cogeo

  • NAM Team
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Tutorial: SC4 Automata As Props
« on: December 15, 2009, 03: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
2. Basic Knowledge
3. Example: Orthogonal and Diagonal Bus Props
    Notes



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



4) Now we have to rotate our copied models as needed. Download and install SC4 Model Tweaker 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.



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



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.



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



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:

  • The Is Ground Model property has been set to False, because otherwise it generates strange shadow effects. Plus the model already contains a shadow model (Group 2). This looks quite OK, but it's different to the shadows cast by the "normal" BAT models. However other models might be OK, and for these you may want to set Is Ground Model to true (for these you should also remove the modelled shadow, if your model contains one).
  • I have left the Light property to True, although these models do not have nightlights. Furthermore, I'm not sure if this technique works for models with 1 Z/R, and I don't know even if such models actually exist. Some testing on your part can prove this.
  • If you are going to release prop-packs using the simcity automata models, I would recommend that you open a development thread, so as to avoid duplication.
  • The technique is not limited to automata models, instead it can actually be used to make props using any kind of 1-Z/R models, like monorail tracks. Or maybe ploppable water; by not involving the BAT in the process, chances are that their appearance could be considerably improved (jeronij  %confuso).
  • If you find this technique interesting, you may also want to take a look at my PedMall-Compatible Transit-Pack. It uses special models, referncing directly the very same NAM texture used in the Ped-Mall Tiles, thus achieving a perfect match between the ped-mall textures and the lots.

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.
« Last Edit: January 26, 2016, 10:44:15 AM by vester »

Offline RippleJet

Re: Tutorial: SC4 Automata As Props
« Reply #1 on: December 15, 2009, 04: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... ::)

Offline nerdly_dood

Re: Tutorial: SC4 Automata As Props
« Reply #2 on: December 15, 2009, 04: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)
My days here are numbered. It's been great and I've had a lot of fun, but I've moved on to bigger and better things.
—   EGO  VOBIS  VADELICO   —
Glory be unto the modder and unto the fun and unto the city game!

Offline Gwail

Re: Tutorial: SC4 Automata As Props
« Reply #3 on: December 15, 2009, 04:38:26 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 ;)?
My misc works thread:
GWL workshop

Offline petitecherie1981

Re: Tutorial: SC4 Automata As Props
« Reply #4 on: March 01, 2010, 05: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?

Offline cogeo

  • NAM Team
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: Tutorial: SC4 Automata As Props
« Reply #5 on: March 02, 2010, 01:37:44 PM »
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.