SC4 Devotion Forum Archives

SimCity 4 Devotion Custom Content Showcase => Network Addon Mod (NAM) => NAM How-Tos and Tutorials => Topic started by: jplumbley on September 26, 2007, 07:49:10 PM

Title: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on September 26, 2007, 07:49:10 PM
A Guide to Texture Overriding

0. Intro

This is a tutorial that is intended to help those wanting to learn the RUL 0x10000002.  In this tutorial you will learn the very basics of transit modding.  This includes determining how to make an override of a side by side texture setup, determining what rotations do, how mirroring works, etc.  It is recommended that you are understanding of how to use SC4Tool's Texture Creator, iLive's Reader Texture Viewer and the basic functions of iLive's Reader.

Requiremetns:

Intermediate Modder
iLive's Reader
SC4Tool

1. Finding Textures

This section will explain how to find textures, their IIDs and their 0 position.  You will be using iLive's Reader and SC4Tool in this section.

A. iLive's Reader -.Texture Viewer

Lets start by learning about some of the basic uses of iLive's Reader in Transit Modding.  Probably one of the most important skills is learning how to use the Texture Viewer.  It is very simple to use.  To open goto Tools -> Texture Viewer as shown below:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F2759%2Ftextureviewer1km9.jpg&hash=c5dbb0a5ccb4b4b414423875dd06b65da01e27aa)

Texture Viewer has 2 main sections Transit Textures and Other Textures.  The only limit to the Texture Viewer is that is only show the textures from the SimCity_#.dat files in you MAXIS\Sim City 4\ folder.  You will notice when you select the first section Street/Road/Rail/Highway the 5 zoom levels will show up and you will have to choose one of the following zooms to view the textures.  I tend to always choose Zooms 4 or 5 because they are the easiest to see.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F7696%2Ftextureviewer2he3.jpg&hash=30859a98ba14bba70b16e84b3858f72791fe1bc6)

Once you choose your zoom you will have textures show up in the right area.  These will be all the textures for a given network.  You will notice on the left under you zoom level that all the Networks have been shown (Street, Road, OWR, etc.).  Since I have been working on SAM a lot lately lets go with the easiest one, Streets.  Streets have the fewest number of textures.  This is because any major intersections are found under the Network that the Street is intersecting with, and that there are no diagonals.

Now, Texture Viewer shows all the textures in 0 position.  We will get to that later.  But, the Texture Viewer is good for 2 things, finding a texture and its IID and finding which position the game considers 0 position.  Also, it shows all 4 wealth levels of the texture.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9157%2Ftextureviewer3mu0.jpg&hash=b6cc94ebdb571cc8092b4e9c21338a0b829ba960)

B. SC4Tool -> Texture Creator

Now, iLive's Reader is great for finding texture created by MAXIS, but what if you are looking for a texture that has been added later in NAM or SAM or RHW.  Well this is where SC4Tool is handy.  It is not as great as iLive's Reader but it is still good for its use.

So, lets see how this works.  It's a little different, when SC4Tool loads use the Tool selection screen and choose Texture Creator.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F665%2Ftexturecreator1lm1.jpg&hash=df41693bf691e64baad2da4bcaca42401ba1fa29)

When the Texture Viewer loads you will then have to click the Folder icon which allows you to browse and open the file in which the texture is in.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9851%2Ftexturecreator2ho8.jpg&hash=fae9f8c5f948248a5ecaeea28dd943c8f63c3b56)

When the file has been loaded you will see a long list of folders with numbers next to them.  These numbers are the IIDs of the texture set.  By selecting one of the folders it will show you all 5 zoom levels of the corresponding texture.  As shown it will tell you some information about the texture in the right and it will also preview the texture in 0 position.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F4968%2Ftexturecreator3yp9.jpg&hash=887af9ae120bc61247c0add4955cdc42555582a6)

2. Rotation Determining

This section will explain how to determine the rotation of a texture.  This is a critical part of writing RULs because if you have the rotations wrong the override will either not work or it will show up improperly.  Determining the rotation is fairly simple, but sometimes it is hard when trying to figure things out when the textures are side by side.

A. Rotation of a single texture.

To start there are 8 total positions of a texture, the 4 rotations (0, 1, 2, and 3) then there is the mirror of the texture (I will explain mirroring later when we get to the RUL code).  The next four pictures show the T-Intersection for Asphalt Streets made by Hableurg in its four rotations.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F5422%2Ftintersection0nx6.jpg&hash=d2000254a159f749e80beea671e118e5b427f739)
Rotation 0

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F4188%2Ftintersection1re2.jpg&hash=d056f63b065d2199451a1bf02781761ad5088708)
Rotation 1

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F8594%2Ftintersection2yp9.jpg&hash=0b344203fb5f7c8d144921f979dcb5974aa13a04)
Rotation 2

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F2850%2Ftintersection3xd8.jpg&hash=872c0c194e737ba275b7b3a5bb976d2411bf2ca4)
Rotation 3

The rotation of a texture happens in a clockwise progression in 90 degree increments.

B. Side by Side Textures

Now we are going to start getting into the juicy stuff.  Side by side textures are how RUL 0x10000002.  This has to be shown, its close to impossible to explain.  I will do one example with a few small exercises.

Example:
We are dragging a straight street into a street that is perpendicular making a T-Intersection.  Now, instead of the original MAXIS textures we are writing an override RUL for a SAM texture set.

Obviously for this there will be multiple variations, but lets start with the Straight Piece on the left and the T-Intersection on the right.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9725%2Fstraight1ni0.jpg&hash=5995e56532f5c2c3ac7ba0eb23a54724adcaba38)  (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F8594%2Ftintersection2yp9.jpg&hash=0b344203fb5f7c8d144921f979dcb5974aa13a04)

As shown above this is the result we are looking for.  But how do we get here?  Well we must look at each texture individually.  Lets start with the T-Intersection first, if we look at the previous section we will notice that the 0 position of the T-Intersection is facing the opposite direction.  Now, visually in your mind take the 0 position and rotate it in 90 degree increments clockwise until it is in the position you want.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F5422%2Ftintersection0nx6.jpg&hash=d2000254a159f749e80beea671e118e5b427f739)
Rotation 0

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F4188%2Ftintersection1re2.jpg&hash=d056f63b065d2199451a1bf02781761ad5088708)
Rotation 1

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F8594%2Ftintersection2yp9.jpg&hash=0b344203fb5f7c8d144921f979dcb5974aa13a04)
Rotation 2

As you can see, to match the resultant we want we must rotate the texture 180 degrees.  This will give us rotation #2. So, this means the the Straight Piece will be next to a T-Intersection in Rotation #2.  We are half way there.  We now must determine the rotation of the Straight Piece.  Use iLive's Reader Texture Viewer and look for the Street Straight Piece to find out what the 0 position is.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F691%2Fstraight0in9.jpg&hash=2f2691c8d63795408c5b78417bdfb8ddd9bb832b)

You will find that the 0 position the Straight Piece runs up and down.  As shown above.  So, what rotation(s) will the Straight Piece line up with the T-Intersection in Rotation position #2?  Rotate the Straight Piece 90 degrees clockwise 3 times and find out.

You will find that when the texture is rotated 90 and 270 degrees it will fit the result shown in the original example.  This means Rotations 1 and 3 both work.  Which one do we choose?  We choose both and write the code for both to get all variations of the intersection.

So, your results are:
Straight Piece, Rotation 1 beside T-Intersection, Rotation 2

and

Straight Piece, Rotation 3 beside T-Intersection, Rotation 2

Now you know how to determine texture rotations.  Lets try some small exercises.  The answers are "whited out", just highlight them to uncover the answer.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9725%2Fstraight1ni0.jpg&hash=5995e56532f5c2c3ac7ba0eb23a54724adcaba38)  (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F25%2F90turn1ge1.jpg&hash=191472a5c6bc0d90af3deffd02eecf8b5574b6e7)

Answer: Stright Piece, Rotation 1 beside 90 Turn, Rotation 1

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F4467%2F90turn3fa6.jpg&hash=16a61ee24ba0161871dbafae8562a2a4f7a889a5)  (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F2850%2Ftintersection3xd8.jpg&hash=872c0c194e737ba275b7b3a5bb976d2411bf2ca4)

Answer: 90 Turn, Rotation 3 beside T-Intersection, Rotation 3

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F4188%2Ftintersection1re2.jpg&hash=d056f63b065d2199451a1bf02781761ad5088708)  (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F594%2F90turn2hg4.jpg&hash=9cba4788977f33b53ca7c9878151ec6d09e40a2c)

Answer: T-Intersection, Rotation 1 beside 90 Turn, Rotation 2

3. RUL Coding for RUL 0x10000002

Well now we get to the least interesting part for most, but the most interesting for myself.  This is how we tell the game to make a certain texture beside another turn into two new side by side textures.  Lets go with something we are already familiar with, turning the MAXIS Straight Piece next to the MAXIS T-Intersection into the SAM Asphalt textures of the same.

I will start by explaining the parts to the RUL Code for RUL 0x10000002:

Basically there are three parts of importance to a line of code:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F2994%2Fruls1jy6.jpg&hash=00e304a5a6f04c434f259e62823a67af3d6f6191)

Texture IID = this is the Instance ID of the texture (figure this out by finding the texture in iLive's Reader -> Texture Veiwer)

Rotation = this is the rotation of the texture, this value is 0, 1, 2 or 3 (figure this out by following section 2)

Mirror = this is something I havent talked about yet.  The way mirroring works is when the texture is in 0 Position it is mirrored (if need be) and then rotated.  This is not used often, but it is used with textures like the 90 Turn Transition Piece from Street to Road.  This value is 0 or 1 where 0 = not mirrored and 1 = mirrored.

This is a line of code that could be created:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9465%2Fruls2gf2.jpg&hash=3dea7627a0c936758dac39eb9c124b035ecf7180)

Textures 1 and 2 are the original side by side textures you want to override.  And Textures 3 and 4 are the new textures you want to replace the old ones with.

So for our example MAXIS Straight Street next to MAXIS T-Intersection Street being converted to SAM Asphalt Straight Street next to SAM Asphalt T-Intersection Street.

First step, find the IIDs and the 0 Position:
MAXIS Straight Street = 0x05004b00
MAXIS T-Intersection Street = 0x05005700

SAM Asphalt Straight Street = 0x5e54b700
SAM Asphalt T-Intersection Street = 0x5e557700

Second, find out the Rotations you will need for all 4 pieces:
MAXIS Straight Street = 1 or 3
MAXIS T-Intersection Street = 2

SAM Asphalt Straight Street = 1 or 3
SAM Asphalt T-Intersection Street = 2

Will there be any mirrors?  Not for this case.

Write the code for each texture:
MAXIS Straight Street = 0x05004b00,1,0     or     0x05004b00,3,0
MAXIS T-Intersection Street = 0x05005700,2,0

SAM Asphalt Straight Street = 0x5e54b700,1,0     or     0x5e54b700,3,0
SAM Asphalt T-Intersection Street = 0x5e557700,2,0

Which texture should be Texture 1?  MAXIS Straight Street
Which texture should be Texture 2?  MAXIS T-Intersection Street
Which texture should be Texture 3?  SAM Straight Street
Which texture should be Texture 4?   SAM T-Intersection Street

So, now you have all the information to write the whole line of code. Now, when you put it together you will have 2 variations of the was this intersection can be formed.

MAXIS Straight Street in Rotation #1:
0x05004b00,1,0,0x05005700,2,0=0x5e54b700,1,0,0x5e557700,2,0

and

MAXIS Straight Street in Rotation #3:
0x05004b00,3,0,0x05005700,2,0=0x5e54b700,3,0,0x5e557700,2,0

There you have it.  All the information needed to write RULs in RUL 0x10000002.  Please, use this information carefully and if you plan to make any modifications, contact members of the NAM Team for approval and help.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on September 26, 2007, 11:30:21 PM
Pssst, you didn't explain mirroring,

Otherwise nice tutorial.  I'm definetly keen to give it a go.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Serkanner on September 27, 2007, 03:34:26 AM
A very well written tutorial, not to mention the excellent illustrations to visualize the whole process  which I alwats find a great help when learning new things. If time permits I just might try this myself one day. The least I can do is give you a big THANK YOU for composing this document and I am sure more people will start making their own street/road mods from now on.

Excellent work!  :thumbsup:
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: RippleJet on September 27, 2007, 04:50:01 AM
A very well written and comprehendable tutorial, Jplumbley! &apls

If somebody wants to create their own street textures, I suppose the IID's (0x5xxxxxx) are maintained and distributed by the NAM team?


Quote from: Diggis on September 26, 2007, 11:30:21 PM
Pssst, you didn't explain mirroring,

Actually I think he did:

Quote from: jplumbley on September 26, 2007, 07:49:10 PM
Mirror = this is something I havent talked about yet.  The way mirroring works is when the texture is in 0 Position it is mirrored (if need be) and then rotated.  This is not used often, but it is used with textures like the 90 Turn Transition Piece from Street to Road.  This value is 0 or 1 where 0 = not mirrored and 1 = mirrored.

He didn't show it with pictures, but it isn't that difficult to understand how it works. ;)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on September 27, 2007, 04:56:10 AM
Quote from: RippleJet on September 27, 2007, 04:50:01 AM
If somebody wants to create their own street textures, I suppose the IID's (0x5xxxxxx) are maintained and distributed by the

Yes, the NAM Team maintains the 0x5xxxxxxx range of IIDs for textures.  SAM uses the 0x5e5xxxxx range and a structure has been given to it to allow for the best possible usage of the range of IIDs.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on September 27, 2007, 09:57:14 AM
Excellent tutorial, it has cleared up several issues I had already.
:thumbsup: &apls &apls
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on September 28, 2007, 06:07:55 AM
OK, sorry one further question...

There are 4 different textures for each piece, depending on wealth.  Do we have to do all 4?  or just the first one (0) like you did here?
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on September 28, 2007, 06:40:23 AM
Quote from: Diggis on September 28, 2007, 06:07:55 AM
OK, sorry one further question...

There are 4 different textures for each piece, depending on wealth.  Do we have to do all 4?  or just the first one (0) like you did here?

Well, this is a good question and I am not 100% sure.  I have noticed though that if I only had the 0 Wealth Texture it would drag and show properly.  I think in my first test of OWR-5 that it was possible to zone next to it and the 0 Wealth Texture stayed.  But if you have the 0 and the 1 Wealth textures but not the others, the other 2 wealths will be shown as a blank tile.  This is my experience.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on September 28, 2007, 06:59:17 AM
So you have to write it for all 4 wealths?  I figure it's just an situation of find and replace, but still...
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on September 28, 2007, 07:22:51 AM
Sorry, I misunderstood you question.

The Texture IID always ends in 00 for the RULs.  The RULs do not care about Wealth or Zoom levels because it only deals with the "family" the textures belong to.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on September 28, 2007, 09:10:47 AM
Ahhh, OK, so you have to do textures for all wealth levels, or only 0 wealth, but only have to RUL for the 00 textures.  Excellent.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on September 29, 2007, 02:40:29 AM
I guess for models the 0 postion is is what it looks like in the preview in reader?
Or have draggable 3D networks not been done before?
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on September 29, 2007, 02:52:49 AM
I think this if for texture networks.  For the 3D ones, you would probably need to go to T21's/
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on September 29, 2007, 03:15:18 AM
It is possible to have this with 3D netoworks as long as the base network is 3D
So it is not possible (as far as I know)
To have a 2D network drawing from a starter piece and turning into a 3D network
however it is possible to have a 3D network drawing from a starter piece and turning into a 2D network
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on September 29, 2007, 10:54:02 PM
I have not worked with the 3D models as of yet.  It seems from your progress on HSR that it is possible to do overrides with 3D models.  I would assume that the 0 position is the model preview in iLives Reader.  It would make sense atleast anyways, then you will be rotating the model clock-wise for each rotation.

You can make 2D textures for a 3D model network, this is what Draggable GLR has done.  Draggable GLR is a starter piece where the base network is the El-Rail (a 3D Network) and had it drag textures out of it.  So, this is possible but the reverse, I dont think is possible, but you never know until you try.  You might be able to fool the game by using T21s but then you would only be able to use one T21 per network piece, the one that has the model you want to use.  The easiest way to find out if this is possible would be Draggable Elevated Road Pieces.  The models already exist.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tarkus on September 29, 2007, 11:18:28 PM
Actually, you can do the reverse as well.  I was successfully able to make an Elevated RHW and a Double-Decker RHW draggable with the ANT network.  The trick is that you need an special exemplar with a Network Specific Group ID (NSGID) with the same IID as the model.  Only one is necessary, the other zoom levels are referenced in the exemplar by using Resource Key Type 3 instead of Type 0 like standard puzzle pieces.  All the standard, non-override 3D networks also operate on this same principle.

Here's the list of known NSGIDs:

Road-0x2821ED93
OWR-0xCBE084CB
Street-0x6534284A
Rail-0xE8347989
El-Highway-0xA8434037
Gr-Highway-0xEBE084D1
Avenue-0xCB730FAC
Light Rail-0x2B79DFFB
Monorail-0xEBE084C2
Dirt Road/ANT (RHW)-0x6BE08658

I haven't figured out the NSGIDs for the Subway network and the pseudo-networks (power poles and water pipes), and those networks operate somewhat differently than the ones listed above.

Hope that was somewhat helpful.

Excellent job on the tutorial, Jason!  :thumbsup: I should get off my rear and put some tutorials up myself. ;)

-Alex (Tarkus)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Shadow Assassin on September 30, 2007, 08:50:28 PM
QuoteTo have a 2D network drawing from a starter piece and turning into a 3D network
however it is possible to have a 3D network drawing from a starter piece and turning into a 2D network

It should be possible to have 2D turning into 3D, because the "2D" network is technically a 3D network, it just uses a flat plane.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on September 30, 2007, 11:21:04 PM
A 2D network is not a 3D network that is a flat plane only seemingly 2D puzzle pieces are a 3D flat plane.
Tarkus just said it possible to have 2D network draw as a 3D network but not because of you said. Hope that makes sense.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on September 30, 2007, 11:45:13 PM
If I recall (if my memory serves), the RUL 0x10000002 file handles textures & 3D models. The only difference between the 2, is that when a model is involved the RUL 0x10000002 file makes reference to the Exemplar that handles the model. It's the same for all RUL files (some exceptions; some RULs only handle Models).


Tarkus : the PowerPoles Exemplar GID should be 0x088E1962. Subways has one, but I don't recall what it is. From memory though, it's pointless as the subway network is hardcoded & runs off one of the road-based network Ruls.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on October 01, 2007, 08:51:45 AM
QuoteTarkus : the PowerPoles Exemplar GID should be 0x088E1962. Subways has one, but I don't recall what it is. From memory though, it's pointless as the subway network is hardcoded & runs off one of the road-based network Ruls.

Is it possible to make subway puzzle pieces?*
And does that mean it is possible to have starter pieces for power poles?
* If it isn't possible to make subway puzzle pieces is it possible to make water pipe puzzle piece?
The mirrors are also used in diag-orth transtions at least.(for monorail don't know about other networks)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on October 03, 2007, 12:27:38 AM
Subway puzzle pieces (probably shouldn't have said it was pointless); it's been so long, off-hand I don't recall. I do recall however using subway function in the Interchange RUL to create roads over bridges, with some limited success. So it is a recognised network function in that RUL (again, if I recall). The problem with using the subway function, is that anything with the subway function needs to have Exemplars/Models, because if it is allowed to go back to its network specific (subway) RUL (for example using Optional function with Subway function) it will show the Road network. And this is because the subway network is hardcoded & works from the road ruls when drawing the subway network.
Starter pieces for power poles; if the Interchange RUL recognises the powerpole (or whatever it is) function, then I can not see why not. Same applies to waterpipes. The thing to be aware of here, is that powerpoles/powerlines are hardcoded to a big degree. I had tried using powerpole function & a few other variations with no success. Does not mean I did not miss something though.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on October 04, 2007, 09:52:05 AM
Sorry for another question, Is it then possible to create side by side (RHW style) RULs
Thanks for your answers already though.

EDIT: what are these IIDs with 4 or 3 numbers after the 0x? (eg 0xc00)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on October 05, 2007, 01:56:08 AM
Any two tiles adjoining each other should be possible to code for in the Overrides RULs. There's a couple of rules relating to bridges (like the ends for example) if I recall. Some restrictions may exist though, like some stuff being handled by the exe (though I doubt it) or the INI Networks file conflicting with some rules (though I would imagine this very rare).
As for the IIDs with 3 or 4 numbers after 0x, could you be a little more specific? I don't see any active code like that in the Overrides RUL, though there is code like that in other RULs; in those cases, best that I can tell/remember is that Maxis got a little lazy & used short-hand (in most cases, just add 0000 in between 0x & other 4 digits of hex). Kind of like the Interchange RUL; where any referecning of the 4 digit hex in the ordering section is done with full 8 digit hex.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on October 05, 2007, 03:07:45 PM
I meant to say RHW type RULs for subway, are they possible?
If we know the IIDs of the tiles, it should be possible to create overrides? (We can get the IIDs from the Road Rules RUL?)
Thanks I meant in RULs in general.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on October 05, 2007, 05:02:57 PM
Being how the subways are hardcoded to a big degree, I doubt it. That's not to say it's not possible though (it's not one of those things I have looked at). I can't imagine though trying to use any road code to code for subways in the Overrides RUL, since it would affect both (& more likely only affect road). Still though, if one is able to find out which subway textures/exemplars require referencing, then may be possible. But personally not sure I see the point, since subways are all underground.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: SmartRoss on December 09, 2007, 06:36:44 AM
Where do you input the RUL code? I can't find the input box  :'(.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on December 09, 2007, 07:17:42 AM
Quote from: SmartRoss on December 09, 2007, 06:36:44 AM
Where do you input the RUL code? I can't find the input box  :'(.

The RUL code is entered into the RUL file 0x10000002 in the NAM controller dat file. If you are looking for an input box that is in game there is no such thing, as the plugins are not "live". They are loaded when the game is started so anychanges made to plugins while the game is being played will not have effect until the game is restarted.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on December 10, 2007, 01:09:29 AM
Quote from: Tropod on October 05, 2007, 05:02:57 PM
Being how the subways are hardcoded to a big degree, I doubt it. That's not to say it's not possible though (it's not one of those things I have looked at). I can't imagine though trying to use any road code to code for subways in the Overrides RUL, since it would affect both (& more likely only affect road). Still though, if one is able to find out which subway textures/exemplars require referencing, then may be possible. But personally not sure I see the point, since subways are all underground.

The one thing that would be cool would be able to change the colour of the lines to help map them.  :P
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: RebaLynnTS on February 04, 2008, 05:20:44 PM
Blue line leaving on track one :)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on February 04, 2008, 11:51:04 PM
Quote from: Diggis on December 10, 2007, 01:09:29 AM
The one thing that would be cool would be able to change the colour of the lines to help map them.  :P


How do you mean exactly? In the city itself, region view, undergroundview, dataview map, etc.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on February 05, 2008, 12:48:27 AM
In the city.  Imagine the SAM for subway where each different variation had a different colour so you could see where your lines ran.  Much like the London Underground (http://www.tfl.gov.uk/assets/downloads/Standard-Tube-map.gif).
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on February 05, 2008, 01:48:49 PM
oh right. Well that's probably a no go. None of the networks really have a way to distinguish different colours for same network either in the city overlay itself, dataview map or region view. To my knowledge.
Although, and this is a (somewhat) long shot........it may be possible to manipulate the INI file making use of one of the (texture/shadow) remapping sections. It may not give you exactly what you're after, but worth having a look maybe.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: RebaLynnTS on February 05, 2008, 03:27:36 PM
Diggis is talking about having different colored models for the subway lines them selves. Right now they are all the same color. Plop a starter piece, and the track tunnel is blue, another and it is green, so on.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tarkus on February 05, 2008, 09:22:02 PM
It would be nice to be able to do that, but the Subway network has been notoriously elusive.  There's no sections defined for it in any of the RULs (or the INI), so I'm not sure if it's possible to produce any sort of override for it, or even a puzzle piece.  We've never nailed down the NSGID for it either.  I believe GoaSkin tried to make a Subway puzzle piece at one point, but it caused a CTD.

I'm not going to say "never", though.  A lot of things deemed impossible have been added in, and we're able to essentially make "new" networks now (though with many of the same limitations as existing networks), but the Subway's been a tough nut to crack.  I'd love to be able to override it though--it would open up a lot of possibilities. :)

-Alex (Tarkus)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on February 06, 2008, 12:59:33 AM
I was just hypothesising.  I know subway has been elusive so I'm not complaining.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: memo on February 06, 2008, 07:23:06 AM
Alex, actually, there is a RUL file for the subway network. I don't remember its IID at the moment, but it contains the very same Rules as the Road RUL file. However, I think you can't do anything with it, since it, I assume, only defines the possible intersections of the Subway network, but not any textures or paths. Though, I didn't really look into it much. There's also a RUL file for water pipes, btw.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on February 06, 2008, 07:59:28 AM
Does that mean there is possibly one for the power lines too?
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: memo on February 06, 2008, 08:24:05 AM
No, to my knowledge, there isn't. For power poles, there's only one small section in the Network INI file which links to the different power pole models, but you won't need to change anything of that. Power lines are entirely hard-coded and, apart from the models, cannot be modified, unfortunately, as far as I know.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: RebaLynnTS on February 06, 2008, 08:34:01 AM
I just had a thought. Would it be possible to make a draggable network for pedestrians with power lines on the lots? Like a side walk next to power lines.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Diggis on February 06, 2008, 08:36:40 AM
Draggable pedestrian networks have posed some issues as there isn't a default Pedestrian only network.  Additionally while you may be able to do it visually you wouldn't be able to get it to transmit power.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on February 06, 2008, 09:18:34 AM
It is possible to create Subway RUL overrides, the road RUL file controls the subway. But an override would have to be made the old RHW way (pre v13) side by side. These RULs would effect the Road, Subway and Pipe networks.
I dont know the NSGID for the subway or Pipe, but Tropod may be able to find some more possible IDs.

This a PM from Tropod

QuoteWaterpipes; possible Network GroupID Exemplar
0xA951171C
(1C1751A9)

0x82C2FF49
(49FFC282)


Subway; possible Network GroupID Exemplar
0x8A15F3F2
(F2F3158A)

0x8A15EE13
(13EE158A)

0xC17BB329
(29B37BC1)

When using the above IDs, use the ones with *0x* in them. The ones in brackets are just for reference purposes.

I haven't tried to test any of these, so I can not say with any certainty if any of them will work or not. The limited stuff I have managed to pull from the exe & use for the game (DirtRoad IID for the cursor images, Dirtroad GID, Street GID) have been achieved through trial n error.

Also I searched for files IIDs range 06000000 - 06ffffff in all the dats and it came up with some FSH and S3D files in Simcity_locale.dat but I couldn't find the locale file they were in.


I hope some of this has helped someone figure something out.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: JoeST on February 06, 2008, 10:29:32 AM
You know who I really want to hug right now....  :o :o :o :o OMG, thats great

Joe
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides New theory on NSGID
Post by: Jonathan on February 06, 2008, 10:47:07 AM
Okay... Pipe network doesnt neeed any form of NSGID, just the IID of the model must be in the same range as current models.

Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tropod on February 06, 2008, 12:37:53 PM
Something that just occurred to me; it is quite possible that there does indeed exist a RUL IID file address specifically for Subways, and that the road rul is just a fall back. It wouldn't be the first occurrence for something like this to take place in the game.

Warrior;
Those IDs you've mentioned; this in relation to referencing (making use) in any specific RUL? ie overrides / interchange RUL.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on February 06, 2008, 12:42:57 PM
This is the only RUL I added to make it work:

06009999 being the underground highway piece.

0x4b00,0,0,0x4b00,0,0=0x06009999,3,0,0x06009999,1,0

The 0x4b00 references Road(00004b00), pipe(06004b00) and subway(07004b00) pieces

0x06009999 refences 06009999 and 07009999 and possibly 00009999 somehow.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: RebaLynnTS on February 06, 2008, 01:48:57 PM
I have a feeling that if we put our minds to it, we could make a game of our own :)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Tarkus on February 08, 2008, 11:29:00 AM
Now that is absolutely amazing, Warrior.  This is a real discovery here!  I think you've just opened the floodgates . . .

And thanks for correcting me memo--I hadn't run across that file in my search attempts in the past.  I must have missed it. ;)

-Alex (Tarkus)
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Lollo on March 30, 2008, 11:43:53 AM
First of all, thank you! This is a brilliant and easy-to-understand tutorial.
I'd like to know if it is possible to make an override on 3 side by side textures (texture1 beside texture2 beside texture3)?
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on March 30, 2008, 01:50:42 PM
Unfortunately it is not, it would be great if it was though.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Lollo on March 30, 2008, 02:10:13 PM
Buahh! it would be nice.... really...
And what about overriding an override?
texture1,texture2=texture3,texture4
texture4,texture5=texture4,texture6
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on March 30, 2008, 11:45:26 PM
That is definately possible, That is how quite a lot of HSR works.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Lollo on March 31, 2008, 04:19:44 AM
Good! thank you for clarifying this.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: videosean on May 30, 2008, 07:24:53 AM
I was trying to figure something out and make sense of this by looking at an example:
1,00,02,02,00
3,0,0x00000F00,3,0
;Modified for Road Turning Lanes
1,00,02,02,02
3,0,0x5F005700,0,0

I don't see how that matches up with:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9465%2Fruls2gf2.jpg&hash=3dea7627a0c936758dac39eb9c124b035ecf7180)
First I assume that the ;comment refers to the line(s?) directly below it.  Second there is only one texture being RULed.  So.... why is it x,x,IID,x,x in my sample code? What is the other line that is x,xx,xx,xx,xx?

0x10000002 is the IID the RUL needs to have?  All RULs from Maxis are in simcity_1.dat?

;overrides for ave road (head to head)
0x04009800,0,0,0x04007300,2,0=0x04009800,0,0,0x04009900,0,0
0x04009800,2,1,0x04007300,0,1=0x04009800,2,1,0x04009900,2,1
0x04009800,3,1,0x04006100,3,0=0x04009800,3,1,0x04005800,3,1
0x04009800,1,0,0x04006100,1,0=0x04009800,1,0,0x04005800,1,0
0x04005800,0,0,0x04006100,2,0=0x04005800,0,0,0x04005900,0,0
0x04005800,0,0,0x04006100,0,1=0x04005800,0,0,0x04005900,0,0
0x04005800,2,1,0x04006100,2,0=0x04005800,2,1,0x04005900,2,1
;overrides for ave street (head to head)
0x04009700,0,0,0x04007300,2,0=0x04009700,0,0,0x04009900,0,0
0x04009700,3,1,0x04006100,3,0=0x04009700,3,1,0x04005800,3,1
0x04009700,1,0,0x04006100,1,0=0x04009700,1,0,0x04005800,1,0
0x04009700,2,1,0x04007300,0,1=0x04009700,2,1,0x04009900,2,1


0,0(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F3535%2F0x0400980400ga1.png&hash=411f7d969423bb2af0b3424b3a0b4823a6156255)0,1(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F5527%2F0x0400980401mr5.png&hash=bf864216dfe2e8d455617037a2f0c220354e9cb3)
1,0(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F9831%2F0x0400980410sr7.png&hash=b7b3daf72ea98afe8b185a6ff768258654eaf4d2)1,1(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F9006%2F0x0400980411gv8.png&hash=66405900a33976dc21ca3b98d22cbe8614f027c2)
2,0(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F9790%2F0x0400980420ns1.png&hash=990444fb947e9e572f5feaf441c2413c83025dc1)2,1(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F4720%2F0x0400980421of0.png&hash=a998e7a05b26fc853295354969e07800832f3e57)
3,0(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F4229%2F0x0400980430wp1.png&hash=835d71f91ae00bf18e02380fb94b36b9e999bfbe)3,1(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F8247%2F0x0400980431cp1.png&hash=1a3eb2ecaa192d29604ad9ca27b3d38df4ee612c)

In this case, mirroring produces an incorrect diagonal for driving on the right.  So... can I simply get rid of all the 1s?
;overrides for ave road (head to head)
0x04009800,0,0,0x04007300,2,0=0x04009800,0,0,0x04009900,0,0
0x04009800,2,0,0x04007300,0,0=0x04009800,2,0,0x04009900,2,0
0x04009800,3,0,0x04006100,3,0=0x04009800,3,0,0x04005800,3,0

I don't know what textures 4007300 and 4006100 are yet but I'll find out somehow :)
They are the curved pieces that show up when you (for instance) connect a OWR to one lane of an ave... with NAM installed.
If that's workable... it's still going to create a problem of some kind I'm sure since you wouldn't be able to connect the road to one lane of the ave after I do that?  I'm going to try it and see what happens... and yes I will be making my RUL file in the DAT file I've made with my new textures... not editing the existing Maxis simcity_x.dat files.

Even if this code works at all the question is still going to be what IIDs should I use for new textures with proper diagonals?

*edit*
haha getting rid of the 1s made it so I can't drag any road to avenue connections :D
No... I don't know what I did wrong yet... crap.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: Jonathan on May 30, 2008, 07:44:53 AM
QuoteI was trying to figure something out and make sense of this by looking at an example:
Code:

1,00,02,02,00
3,0,0x00000F00,3,0
;Modified for Road Turning Lanes
1,00,02,02,02
3,0,0x5F005700,0,0

I don't see how that matches up with:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F9465%2Fruls2gf2.jpg&hash=3dea7627a0c936758dac39eb9c124b035ecf7180)

Your right it doesn't match up, you are looking in the wrong RUL file.


Quote0x10000002 is the IID the RUL needs to have?  All RULs from Maxis are in simcity_1.dat?

Yes, and No.

0x10000002 is the correct IID (RUL 10000002 is not the same RUL as you put in the code box above.
Yes all the maxs RULs are in Simcity1.dat but only one RUL file can exist at the same time time that has the same IID, so the NAM RUL files also contain all the Maxis RULs, if you do add RULs, you must add them to the NAM RULs otherwise quite a lot of stuff in the NAM won't work. This means you can't put a RUL file in your dat( you can put it in your dat while it stays on your PC but when you release(I presume you are) the dat, you'll need to remove it from your dat and give it to the NAM team who can then update the NAM with your RULs.


I'm not entirely sure how mirroring works but 0,0 is sometimes mirrored vertically and sometimes horizontally,  And then the mirror rotated 90 for each number.

So 0,1 will be 0,0 mirrored
1,1 will 0,1 rotated 90  (Not rotated 90 then mirrored) So that's: 1,1 is 0,0 mirrored and the rotated 90.

Reading my post over I make it sound much more complicated than it really is. ;)
Hopefully you'll understand some of it.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: videosean on May 30, 2008, 08:02:08 AM
Quote from: Warrior on May 30, 2008, 07:44:53 AM
This means you can't put a RUL file in your dat( you can put it in your dat while it stays on your PC but when you release(I presume you are) the dat, you'll need to remove it from your dat and give it to the NAM team who can then update the NAM with your RULs.
Well crap.  So much for testing my theories.  I really don't want to go messing around with my NAM files.  Since I copied the RUL from simcity_1.dat and edited it after it was in my DAT it has the same IID still... and that is why I can't do anything in the game now I guess... conflicting IID.

As far as releasing goes... if I can get this to look and work to the point where I can't find any faults in it and people like it I'm more than willing to hand it over to the NAM team... let someone else handle the stuff I don't want to deal with kind of a thing I guess :)

I'm probably better off just making the alternate diagonal textures and letting NAM team experts deal with the RULing and IIDs if they want it.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jplumbley on May 30, 2008, 08:10:16 AM
@Videosean

Im somewhat confused as to what you are trying to do.  I have seen in another thread that you are replacing the Road to Avenue textures.  You should start by replacing the 4 textures that are already in the original set by MAXIS as full IID replacement.  Meaning you should have 4 textures with the same 4 IIDs, then you dont have to worry about RULs at all.

Now, if you so happen to have made a transition that is 3 tile instead of the 2 tile one originally created by MAXIS we can use the RULs to add the extra textures and it will be much, much easier to do so if you have replaced the original MAXIS IIDs first.
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: videosean on May 31, 2008, 06:53:26 AM
Quote from: jplumbley on May 30, 2008, 08:10:16 AM
Now, if you so happen to have made a transition that is 3 tile instead of the 2 tile one originally created by MAXIS we can use the RULs to add the extra textures and it will be much, much easier to do so if you have replaced the original MAXIS IIDs first.
It would have to be a 3x2 tile set so you could do the RULs?  ()testing()
Title: Re: RUL 0x10000002 - Tutorial to making texture overrides
Post by: jondor on July 07, 2011, 08:50:26 PM
Woo, thread necromancy at its finest.  One little thing that's always bugged me about this tutorial is the lack of a visual chart showing the order and direction of flipped tiles.  Working on diagonal ruls is a nightmare without one, so I made one:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fwww.thedwarfers.net%2Fotherstuff%2Frandom%2Fsc4%2FRotation%2520and%2520Flip%2520Cheat%2520Sheet.png&hash=7578939a5a4388a456003c133c245d70954a3b38)

As you can see, first the rotation is applied, then a horizontal mirror.