• Welcome to SC4 Devotion Forum Archives.

How to create T21 exemplars (Swamper77's way)

Started by jeronij, December 10, 2006, 04:10:13 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

jeronij

This short tutorial is posted thanks to Swamper77  :thumbsup:, who made it and gave me permission to publish it here.

What is a T21 exemplar ?¿.  These are the lot configurations used by the transit networks to show props on them, like the streetlights. This is an advanced tutorial. You need some advanced knowledgement about transit networks to understand what is explained here  ;)


THE TUTORIAL

Quote
NETWORK PROPS
To do this, you will need the Reader and the Lot Editor. I'm also assuming you know how to use the Reader, as this is intermediate modding.

This is my method of working with Type 21 Exemplars, aka Network Lots:

- Save a copy of one of the simple park lots the game has (either the grass lot or the cement lot)
- Now exit and load the lot in the Reader.
- Locate the network lot that you wish to edit. This is easily done by loading the SimCity_1.dat file from the section labeled "SimCity DAT" in the left pane and opening the Exemplar Analyzer (magnifying glass with "EX" on it). Under "Filter", have only "21 Network Lots" selected. Close the Filter Dialog Window and click "Search". After a brief moment, you should have a list of items. Now, click the "Lot" button and then click one of the items in the list. The Lot Window will show you what the textures for that network tile are, so you can see what texture the props are being placed on.
- Once you find the network lot you want, select all the "LotConfigPropertyObject" Lines. These are the props/flora that appear on that tile. Copy them to your lot you saved in earlier in the Lot Editor and then select "Re-Index LotConfig". This last command will make sure the lot displays properly when you go back to the Lot Editor to edit it. Save your lot and quit the Reader.
- Load your lot in the Lot Editor and arrange the props as you prefer. NOTE: The images you saw in the Lot Viewer in the Reader are actually 180 degrees to the actual network tile. Keep this in mind as you place the props on the lot. I build a mock-up of the network tile with the default overlays to represent the roadway of the particular tile I'm working with.
- After you have arranged your props to your liking, save and quit LE and open the lot in the Reader. Also relocate the network tile from the SimCity_1.dat file as before. Write down the number of the exemplar (the Instance ID or the FilePosition number). Now locate the number in the SimCity_1.dat file. If you wrote down the Instance ID, use the GoTo command (CRTL+G) and enter the Instance ID number into the dialog. Otherwise, you will have find the file manually as the GoTo command doesn't locate files by their number.
- Once you have located the file, copy it to a blank DAT file. Save this new DAT file with a name that you will be able to recognize, incase you need to delete it later.
- Now, delete the "LotConfigPropertyObject" lines from the network lot and copy the properties from your lot to this network lot. Lines starting with "0x00000001" or "0x00000004" are the only ones that can be on network lots. The others won't work. 0x00000001 lines are props and 0x00000004 lines are flora.
- Re-Index the LotConfig and then save and exit the Reader.
- Run the game and test out your customized network lot.

A few things to note:
- Network Lots can be setup to appear in certain zones at certain wealth levels. (Charts below)
- If you don't want to replace an existing network tile, assign a unique Instance ID to the following: the Exemplar's Instance ID and the property "Exemplar ID". The property "kPropertyID_LotConfigNetworkTileID" determines which network texture/model this exemplar will appear on.
- The tiles seem to be chosen at random when multiple network tiles are assigned to the same texture/model. Keep clicking with the network tool and yours should show up eventually.

Zone Mappings:
0x00=None
0x01=Low Density R
0x02=Medium Density R
0x03=High Density R
0x04=Low Density C
0x05=Medium Density C
0x06=High Density C
0x07=Agriculture/Farming
0x08=Medium Density I
0x09=High Density I
0x0A=Military
0x0B=Airport
0x0C=Seaport
0x0D=Spaceport
0x0E=Landfill
0x0F=Civic/Plopped

Wealth Mappings:
0x00=None
0x01=Low
0x02=Medium
0x03=High

I hope you find this tutorial as useful as it was for me  ;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


bat


mjig_dudy

Thank you very very much ;D I
was just looking for this :thumbsup: .


royal

Thanks for this tutorial swamper, it helps me a lot :)  &apls
I have one question.
I`ve made new signals for the railroad crossing, most of the works great. But those diagonals are difficult for me.
One picture :
http://www.myimg.de/?img=NeueStadt17Feb00118639b09c.jpg
The crossing below works good, the barks are on the right side of the road. But the crossing above seems to be false. The barks are on the wrong side and no signal appear.
In the simcity1.dat I`ve found only one Typ-Exemplar for diagonal crossing of street and railroad.
At all there are 2 different Type21-Exemplar for street crossing railroad, ortogonal and diagonal.
But why doesn't the other crossing works fine ?  %confuso

Greets,
royal  :thumbsup:
Member of the SimForumBatTeam (SFBT)

jeronij

Quote from: royal on September 26, 2007, 04:16:08 AM
Thanks for this tutorial swamper, it helps me a lot :)  &apls
I have one question.
I`ve made new signals for the railroad crossing, most of the works great. But those diagonals are difficult for me.
One picture :
http://www.myimg.de/?img=NeueStadt17Feb00118639b09c.jpg
The crossing below works good, the barks are on the right side of the road. But the crossing above seems to be false. The barks are on the wrong side and no signal appear.
In the simcity1.dat I`ve found only one Typ-Exemplar for diagonal crossing of street and railroad.
At all there are 2 different Type21-Exemplar for street crossing railroad, ortogonal and diagonal.
But why doesn't the other crossing works fine ?  %confuso

Greets,
royal  :thumbsup:

Maybe you can play with the properties:
kPropertyID_FlipsAllowed
kPropertyID_RotationsAllowed
which I am almost sure are the key, but I have no clue about how they work actually. I never had to use them  ::)
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


MIncroabl

You need to set the "kPropertyID_FlipsAllowed" property for the T21 to 0x01, then create a new T21 with flipped prop configuration and set the same property to 0x02 for it. Everything else should be the same as the original exemplar.

Diggis

*raises hand*

Yes over here, I have a question...  How do you find the IID for a lot that doesn't have T21's already?  IE SAM lots?

jeronij

The ID is ID of the smallest FSH file for that tile ... I hope I explain myself  ::)

For the transit tile with the texture AAAAAAA0 to AAAAAAA4  the T21 should be associated to the ID AAAAAAA0  . I hope this helps  ;)
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



memo

#10
Yesterday, I found out how some of the other properties of Type21-Exemplars work, so I want to disclose the mystery of them and explain how they basically work.


The property FlipsAllowed works like this:
0x00 is used, if the T21-Exemplar refers to both versions of a tile (the mirrored one and the non-mirrored one)
0x01 is for mirrored tiles only
0x02 is for non-mirrored tiles

Mostly this property is set to 0x00, since it is not necessary that the flipped version differentiates from the non-mirrored one in most cases. I noticed that 0x02 is only used, if there is also a T21-Exemplar that refers to the flipped version of the same tile (0x01).

Quote from: memo on January 19, 2008, 02:24:11 PM
Something else that is important, in order that the props appear on flipped tiles, is that the Exemplar files of the props refer to non-flipped models as well as to flipped models. Usually, the latter is not the case though. So you have to modify the exemplar file that links to the models of the props. It could look like this one, for example:



You have to copy the Property "ResourceKeyType1" and paste it into the same Exemplar file. Then open the pasted property via double-click and change the "name" by clicking on the arrow next to it. Change it to "ResourceKeyType1xm". Hit Apply and Reindex LotConfig. The exemplar may look like this one then:



Possibly, additional changes to the prop layout are needed. I'm sorry, I don't know, since I didn't test this. However, a T21-Exemplar that can be flipped doesn't necessarily have to have the Property FlipsAllowed set to 0x01 and another T21 set to 0x02. Since 0x00 as FlipsAllowed-Property can refer to both, it may be sufficient.


Now it gets a bit more difficult. The Property RotationsAllowed of course defines in which rotation directions the T21-Exemplar applies to the tile, so you can control whether the props shall appear or not depending on the rotation of the network tile.
You need to be creative somehow in order to find out the right value for this property. I try to explain how I imagine it.
There are four directions - North, East, South, West - which are arranged in this order. Important! North is the standard direction of every network tile i.e. this is how it is displayed in the texture viewer. Now you need to create a 4-digit binary number, consisting of one digit for each direction, but starting at the end of the aformentioned sequence, so you have to start with "West" and then go backwards. The digit 0 stands for "rotation disabled" and 1 for "rotation allowed".
For instance, 0001 stands for North only; 0010 for East only; 0100 for South; 0101 for North and South, etc.
Next you need to convert the binary number into a hexadecimal number (for example with the Windows Calculator), e.g. the value 0x01 is North, 0x02 is East, 0x04 is South, 0x08 is West and 0x0F stands for "all rotations allowed" (North, East, South, West).
The latter value (0x0F) is nearly always used, since nearly always all rotations are needed. But I have also had particular situations where I had to differentiate between the four rotations, so that I had to create a T21-Exemplar file for each.


The property Pattern Size defines the size of a grid pattern. Usually, this value is set to 0x04 (or less), so the grid would be 4 x 4 in size (or smaller respectively). That means that after four tiles the sequence of props on the network tiles is repeated. For instance, this can be applied to street lights which shall only appear on one of four tiles. The pattern size must not be bigger than 0x04 because it would not work properly then or only with certain limitations.
So now you basically have a 4x4 square with 16 tiles which is always repeated again and again. You can exactly control to which of these tiles the T21-Exemplar shall apply. So if there is the network tile the Exemplar is referenced to, you can control whether the props shall appear on that particular tile of the 4x4 square.
This works similar to the "RotationsAllowed"-Property using the NetworkPlacementPattern-Property. Normally there are four values in this property. The first one defines the first/highest row of the square. It consists of 4 tiles. The next value is linked to the next row, etc. If there are four values, but the square is smaller than 4x4 tiles - 3x3 or 2x2 for instance - just leave the forth or the forth and third value untouched or change them to 0x00.
Now you have to create a 4-digit binary number again, starting at the right of each row. (If the row consists of 3 or 2 tiles only, the binary number has only 3 or 2 digits.) Again 0 stands for "disabled" and 1 for "allowed". If you for example want the props to only appear on one of two tiles, you get the binary number 0101, which is 0x05 in hex. For the second row you may get the number 1010, so the value would be 0x0A.
Very often all four values are set to 0x0F, which means that the T21-Exemplar applies to every tile if the particular network tile is placed, or basically it appears on every network tile of this kind.


All the properties, which I have explained, only control, if the placement of the referenced network tile suits in order that the props can be added to the tile. They do not control whether the network tile can be placed or not! You can usually always place it, only sometimes the props do not show up depending on how one sets up the Type21-Exemplar file.

I don't know, if this can ever help anybody because it is already very specific and only rarely required. However, if you need this sometime, I hope my explanation was plausible and helpful. :)


jeronij

This is a very much welcome information memo  :thumbsup: ¡¡¡

I think it may be really useful for some of us  ::) , however I still cant make a mental image of your explanation about the NetworkPlacementPattern Property... but I got more or less the idea  ;D ....

Now a question, relatively related to this.... would it be possible to control if a T21 must appear in a tile, if near this tile there is another determinated one?. I mean, lets imagine I make a T21 which should show in all the straight tiles of a network, unless the next tile is an intersection or a crossing....could this be done?¿
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


memo

#12
Quote from: jeronij on January 02, 2008, 09:57:30 AM
Now a question, relatively related to this.... would it be possible to control if a T21 must appear in a tile, if near this tile there is another determinated one?. I mean, lets imagine I make a T21 which should show in all the straight tiles of a network, unless the next tile is an intersection or a crossing....could this be done?¿

Unfortunately, this is not possible via Type21-Exemplars. &mmm But it can be done with RULs more or less easily. There are even at least two different methods to achieve this, by overrides or by IndividualNetworkRules. However, you would have to integrate this into the NAM then due to compatibilily issues...

Quote from: jeronij on January 02, 2008, 09:57:30 AM
I think it may be really useful for some of us  ::) , however I still cant make a mental image of your explanation about the NetworkPlacementPattern Property... but I got more or less the idea  ;D ....

Then I will try to demonstrate it with pictures. ;) At first, imagine a 4x4 grid pattern on the whole map. These 4x4 squares are again and again repeated like this:

In the corner I have marked the tiles on which the props should be placed, so the first value of NetworkPlacementPattern is 0101 which is 0x05 in hex. The second value is 0x0A, so you get the NetworkPlacementPattern-Property 0x05,0x0A,0x05,0x0A. See the result:


Now I wanted to move the props next to each other. For that I got the values 0x0F,0x00,0x0F,0x00

Of course this works only for north and south, but not for east and west as you can see in the right example in the picture. So I had to work with the RotationsAllowed-Property as well.



- I changed the images links to make the post more easy to see  ;D  ;) - jeronij -

jeronij

 ??? ... collecting the brain from the floor.....  ::)  :thumbsup:  - It took me a while to figure everything out, even with the images  $%Grinno$% .... but I think I understand better how this works. I am glad I didnt knew all that when I created the Street Side Mod  :D  :D

I have some ideas rounding my mind since a long time, and one of them could be done using this knowledge  ;)

Quote
Unfortunately, this is not possible via Type21-Exemplars. &mmm But it can be done with RULs more or less easily. There are even at least two different methods to achieve this, by overrides or by IndividualNetworkRules. However, you would have to integrate this into the NAM then due to compatibilily issues...

I will PM soon and I'll try to explain you my idea...  $%#Ninj2 , and you will be so kind tell me if it is feasible or not  ;D  :D :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


Diggis

OK Question on this.  If I wanted lampposts on every 4th tile would I add them to every T21 but with the network placement pattern set to every 4th or would I create a T21 with them and assign that to every 4th?

Andreas

Quote from: Diggis on January 05, 2008, 06:57:19 AM
OK Question on this.  If I wanted lampposts on every 4th tile would I add them to every T21 but with the network placement pattern set to every 4th or would I create a T21 with them and assign that to every 4th?

You create one T21 exemplar file for a given texture (say, a straight SAM cobblestone street texture), which contains the prop layout (aka "network lot") - said lamppost, for instance. Then you edit the network placement pattern for the desired repeat distance, either two or four tiles. IIRC, the Maxis streetlights are repeated every four tiles, but alternating with a shift of two tiles on the other side of the streets as well, so every other street tile gets a streetlight.
Andreas

memo

But if want to have other props, too, that shall appear on every tile and only the street lights on every 4th, you have to create two T21-Exemplars. One for the street ligths, e.g. with a NetworkPlacementPattern value of 0x01,0x02,0x04,0x08; and one for the other props with the property set to 0x0F,0x0F,0x0F,0x0F.

Diggis

OK so a network is able to have more that one T21 on a tile?  OK cool sounds good.

MIncroabl

Quote from: Diggis on January 09, 2008, 12:46:16 AM
OK so a network is able to have more that one T21 on a tile?  OK cool sounds good.

Well, you can have several T21s for a single type of tile (NetworkTileID), but a single tile can only display one T21 at a time. If there are more than one T21s assigned to the same NetworkTileID and has the same pattern settings, one of them is chosen randomly.

Memo, thank you for figuring out those properties! I've already applied your clear tutorial to some T21s I did recently.

Diggis

OK, now I'm confused.  :P (easy i know)

If I want lamp posts to show up on every 4th tile then I do a t21 with only lampposts and they will show up on every 4th (using the pattern set by memo) but with nothing else on them unless I place them in the same T21?  In which case every lamppost tile would have the same props unless I used families etc, or multilple T21s with lampposts?