• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Making Models for Transit Networks: Some General Specifications

Started by Tarkus, February 22, 2008, 05:33:12 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

mtg

TGI's are clear now thank you!  :thumbsup: can't wait until you get back to your PC and tell me all about RUL's

mtg



mtg

QuoteYes that looks correct

&hlp

Now lets get to the fun stuff, RUL's. are there any tutorials on that or can you guys get me informed on that?

Korot

You've got this [linkie], which will be useful for the override in the drag-able area, though I'm not sure about the path section. Thing is, this does not cover making (multitile) puzzle pieces, nor pathing your pieces. And it doesn't cover starter pieces, or more precisely: the part where they start overriding the network.

Regards,
Korot

Jonathan

Read this document: http://www.wiki.sc4devotion.com/index.php?title=Network_Specs/IntersectionOrdering_RUL
it is about the puzzle pieces RUL file (commonly called RUL0 and it's IID is 10000000, and is located inside the networkAddonMod_Controller.dat)

It should be pretty comprehensive so just make a list of question and I'll do my best to answer. If it turns out that isn't easy to understand at all then I'll write an entire guide to it :)

Jonathan

mtg

Thanks Jonathan, i'll get to that when i get home tonight (I'm at work now)

mtg

hmm looks all very difficult I'll try to get to know what all of this stuff means but

QuoteIt should be pretty comprehensive so just make a list of question and I'll do my best to answer. If it turns out that isn't easy to understand at all then I'll write an entire guide to it Smiley

maybe you can start writing that guide  :)

Jonathan

*Deep breath* Ok...

You puzzle piece must have a number, this is called a HID (stands for Hex ID)

The HID is what helps link the puzzle pieces when you press TAB and Home/end in game. A TAB ring is the groupof puzzle pieces which come under an icon in game which you TAB through, for example the NAM elevated Road puzzle pieces in the NAM that are in the same Icon are a TAB ring.

At the very top of the RUL0 file is a list/table of all the puzzle pieces you access through an icon in the menus in game.

A puzzle piece can be referred to as a RUL. Each rotation of a puzzle piece is actually a seperate RUL, but we refer to them as the same Puzzle piece (and sometimes RUL) to make it easier.

Lets take simple piece, the NAM ped amlls:

Quote
;;;;;;;;;;;;;;;;;;;;;;;;;;
;PEDESTRIAN BUTTON SECTION
;PEDESTRIAN BUTTON SECTION
;PEDESTRIAN BUTTON SECTION
; 0x6###
;ped Puzzle Pieces Button

;ped mall
RotationRing = 6000, 6001, 6002, 6003 ;ped mall tile 1x1 centre pole
AddTypes = 6070, 6071, 6072, 6073 ;ped mall tile 1x1 open paved
AddTypes = 6080, 6081, 6082, 6083 ;pedxCobbleStone
AddTypes = 6090, 6091, 6092, 6093 ;pedxPavement
AddTypes = 60E0, 60E1, 60E2, 60E3 ;pedxSandstone
AddTypes = 60A0, 60A1, 60A2, 60A3 ;pedxGrass
;footbridge
AddTypes = 60B0, 60B1, 60B2, 60B3 ;ped footbridge start/end section puzzle piece
AddTypes = 60C0, 60C1, 60C2, 60C3 ;ped footbridgexblank straight puzzle piece
AddTypes = 6030, 6031, 6032, 6033 ;ped footbridgexstreet puzzle piece
AddTypes = 6010, 6011, 6012, 6013 ;ped footbridgexroad puzzle piece
AddTypes = 6020, 6021, 6022, 6023 ;ped footbridgexrail puzzle piece
AddTypes = 6040, 6041, 6042, 6043 ;ped footbridgexoneway puzzle piece
AddTypes = 6050, 6051, 6052, 6053 ;ped footbridgexavenue puzzle piece
AddTypes = 6060, 6061, 6062, 6063 ;ped footbridgexgroundhighway puzzle piece
AddTypes = 60D0, 60D1, 60D2, 60D3 ;ped footbridgexgroundlightrail puzzle piece
AddTypes = 6300, 6301, 6302, 6303 ;Ped OnSlope Puzzle Piece
;mountain trails
AddTypes = 6400, 6401, 6402, 6403 ;mountain trail - straight
AddTypes = 6410, 6411, 6412, 6413 ;mountain trail - curved
AddTypes = 6420, 6421, 6422, 6423 ;mountain trail - T intersection
AddTypes = 6430, 6431, 6432, 6433 ;mountain trail - + intersection
;to be moved into highway puzzle piece menu
AddTypes = DC90, DC91, DC92, DC93 ;Ped Mall x Elevated Highway Puzzle Piece

Firstly, everything after the semi colon is a comment and is not used by the game, they are just there to easily identify it in the RUL file.

We put puzzle pieces in groups, just because it's easier for the user if all the puzzle pieces of the same type are in one place (for example it wouldn't be very easy if the Elevated Road puzzle pieces were in the same TAB ring as the rial pieces and monorail ones, would it?)

The pedmall icon in game links to the puzzle piece using an exemplar (a different Exemplar Type to the one used for the model)



So the properties of the exemplar:
SubmenuKey: Networks: Road Menu - Pretty self explanatory, this property means the icon goes in the road menu, the value should be 0x00000000.
Plop Cost - Doesn't have any affect on anything ingame, not sure why it's there tbh.
Item Icon - The IID of the picture Icon that appears in the menu (the icon is in standard PNG foramt not FSH)
Item Order - How close to the top of the menu should icon be? 0x00000000 is closer than 0x00000004 (and it can go beyond 4 and below 0)
Item Button ID - This is what links the exemplar to the RUL.  (I'll explain below)
User Visible Name Key - The TGI of the LTEXT file which contains the title of the icon (when you hover over an icon the title is the bold writing at the top of the speech bubble)
Catalog Monthly Cost(float) - Same as plop cost
Item Description key - the TGI of the LTEXT file which contains the main text which appears in the speech bubble when you hover over the icon.

The Item Button ID:
As I said above this is what links the exemplar, and therefore the icon, to the RUL (the TAB ring)
As you can see the value in the above exemplar is 0x6A476000. this is split up into:
6A47 and 6000
The 6A47 is just something Maxis decided to have there. There's no reason for it, but it must be there.
The 6000 is the HID of the first HID in the RotationRing line (in the code above it is highlighted in red)

So for example the first HID in the RotationRing in the SAM Section/TAB Ring is 6700, therefore the value of the SAM's icon exemplar is going to be:
0x6A476700

Now if puzzle pieces just new what shape they should be and how much they should cost and what network they were based on everyone's lives would be easier but they don't so...

The actual RULs:
The 6000 HID also links to Puzzle piece RUL (which are all further down in the RUL file)
now the 6000 HID (highlighted in red above) only related to the bit I've bolded below:
Quote[HighwayIntersectionInfo_0x00006000]
;Added by Tropod 06/14/04.
;PedxCentrePole
Piece = 0.0, 0.0, 0, 0, 0x55267100
PreviewEffect = preview_ped_malls_tiles_001

CellLayout =.....
CellLayout =..a..<
CellLayout =..^..

CheckType = a - road: 0x00000000

ConsLayout =.....
ConsLayout =..+..<
ConsLayout =..^..

AutoTileBase=   0x55267100
ReplacementIntersection = 0, 0
PlaceQueryID = 0xB0006005
Costs = 10

[HighwayIntersectionInfo_0x00006001]
CopyFrom = 0x6000
Rotate   = 1
[HighwayIntersectionInfo_0x00006002]
CopyFrom = 0x6000
Rotate   = 2
[HighwayIntersectionInfo_0x00006003]
CopyFrom = 0x6000
Rotate   = 3

The first line is what is linked to the HID:
[HighwayIntersectionInfo_0x00006000]
This line always starts with HighwayIntersectionInfo, even if the puzzle piece has nothing to do with Highway.

The next to lines are comments and are not used by the game, they just say who made the puzzle piece and when and what the puzzle piece is (it's helpful if the name of the puzzle piece is the same as the name after the RotationRing/AddType line). If someone else made the textures/models and your just making the RULs then you put who made the models/textures there as well.

The next line is used to define how the preview is shown (the preview is the semi-transparent model that appears before you click and place the puzzle piece)
Piece = 0.0, 0.0, 0, 0, 0x55267100
It always starts with piece but the first number ('0.0') is the offset of the model on the X-axis, the next 0.0 is the same except the y_axis. The 0 following that is the rotation of the preview model (it can either be a 0,1,2 or 3 (where its the number *90 gives you the degrees it is rotated (so 3 means it is rotated 270)) The next 0 after that is the flip which is 0 or 1, if you want to flip the preview then you type 1 here. However you rarely have to use these numbers and almost always they are all just 0s.
The number following that that looks like an IID is not used by the game, but there must be number there else it won't work (this was used in he Original SC4 (non rushhour) but has been replaced by the next line). We generally make this the IID of the EffDir file (don't worry I'll explain in a bit) to make it easy to find the EffDir.

The next line is the name of the preview effect this links to the EffDir file you have to create (well copy an existing one and edit) The "preview effect" is basically a posh name for the preview model, I said about in the previous line. I'll talk about the EffDir at the end because it's quite boring.


The next lines:

CellLayout =.....
CellLayout =..a..<
CellLayout =..^..


This defines the shape of the puzzle piece, and helps define what network each tile is (if you plop a puzzle piece in game and then hover the query tool over it you will see it will have have a network name in the query tool, this is what help defines that, though it's not just for the query tool it affects what speed the cars can go on the tile based on the traffic simulator and other such things which I don't understand)

basically each character after the equals sign on each line represents a gridsquare/tile in game. A full stop is just a gap/filler and means that tile is not actually part of the puzzle piece (the maxis definition of a full stop in the Cell layout is  'Don't care')

When you go to plop a puzzle piece in game you'll notice the square that is attached to the cursor has a white border around it. Why that tile/square not one of the others?
Because of the ^ and < symbols in the CellLayout. if you draw lines from them vertically and horizontally respectively the grid/tile where they meet is where that white square is. (in the above code they meet in tile/square with the 'a' in it.

Note: there Can be more than one of the same letter in the CellLayout but they will both have the same CheckTypes(this is very useful)
Note2: A is different to a.

The next line is the check type:
CheckType = a - road: 0x00000000

This is simple. The a in the above line corresponds to the a in the CellLayout. The Road means that tile is based on the road network. Then there's the 0x00000000 (which looks like an IID but isn't, its called a RulFlagByte, but we mostly refer to it as the CheckType):

This is split up into four parts (we always ignore the 0x btw)
00/00/00/00
S/E/N/W

The first 2 digits are for South side of the tile/gridsquare, the next 2 are for East, the next 2 are North, and the last 2 are West, so:

00 means there is no connection on that side of the tile/gridsquare
02 means there is a Orthogonal (straight) connection
01 means left at 45 degree angle (diagonal)
03 means right at 45 degree angle (diagonal)
04 means median (for avenue and Highways mostly, the median is the side where the tiles of the Avenue/Highway network touch, in game on the Avneu there are flowers and lights on it)

*INSERT PIC HERE*

There are then other keywords you can put after the RULFlagBytes, like optional but I won't go into that right now.

The next lot of lines:
ConsLayout =.....
ConsLayout =..+..<
ConsLayout =..^..

They must be the same shape as the CellLayout section (I think), I don't really now much about this bit they are meant to define how the terrain is levelled and sloped, but I don't understand which characters do what, you'll have to ask someone like Alex (Tarkus) or Blue.

the next line:
AutoTileBase:
This defines what models are on the puzzle piece...

I'll stop here for the next two days as I'll be away but ask questions about what I've written as I'll have my phone with me, I just won't have everything I need on my PC to write the rest of the tutorial.

Jonathan






mtg

WOW!  :thumbsup:
Now that's a great tutorial! thanks allot!! and I think I'm not the only one who's thanking you for this!
I just red it briefly but i'm going to read it a view time more now, I think I get most of it and be able to get to work on it tonight!!

Jonathan

Well I haven't finished it yet, but I just found out Alex (Tarkus) has written a tutorial, so hopefully he'll post that as well, and it will fill in the gaps of mine :)

mtg

Ok this is what I've got right now, I think I'm on the right way
My piece should eventually show up in the Ramp ring of the RHW by using 0x00005100,
In the CellLayout I used 0x02000200 because my piece is going from North to south in a straight line.
Is the line "CheckType = a – RHW/Dirtroad: 0x02000200" allowed should I use RHW, dirtroad or doesn't is matter (or should I use something completely different?)






[HighwayIntersectionInfo_0x00005100]
;by MTG, textures by Tarkus, Tutored by Jonathan 02/16/2010.
;RHW double-elevated-ramp
Piece = 0.0, 0.0, 0, 0, 0, 0x55267100
PreviewEffect =

CellLayout = a
CellLayout = a
CellLayout = a
CellLayout = a
CellLayout = a <
CellLayout = a
CellLayout = a
CellLayout = a
CellLayout = a
CellLayout = a
                 ^
CheckType = a – RHW/Dirtroad: 0x02000200

ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =
ConsLayout =

AutoTileBase =
ReplacementIntersection =
PlaceQueryID =
Costs =

mtg

I've also been working on the exemplar some blanks still have to be filled




Blue Lightning

#193
On the RULs...

should be dirtroad, as RHW is a NAM coined term.

CellLayout should be (changed in bold)
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a<
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout=^

The . marks are for padding, and Im pretty sure the < mark needs tiles in its column (normally . (blank, ignore) tiles.

conslayout should consist of | marks (means terrain should be altered as if it was an ortho N/S network)

AutoTileBase is the IID table base
ReplacementIntersection should be set to 0,0 or left out (I usually leave it out)
PlaceQueryID is the IID of the LTEXT file that contains the plop description
Costs is the cost in simoleans to build this piece.

Also known as Wahrheit

Occasionally lurks.

RHW Project


mtg

So it should be like this



[HighwayIntersectionInfo_0x00005100]
;Added by MTG textures by Tarkus Tutored by Jonathan and Blue Lightning 02/16/2010.
;RHW double-elevated-ramp
Piece = 0.0, 0.0, 0, 0, 0, 0x55267100
PreviewEffect =

CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a <
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = a.
CellLayout = ^

CheckType = a – Dirtroad: 0x02000200

ConsLayout = |
ConsLayout = |
ConsLayout = |
ConsLayout = |
ConsLayout = | <
ConsLayout = |
ConsLayout = |
ConsLayout = |
ConsLayout = |
ConsLayout = |
ConsLayout = ^

AutoTileBase =
PlaceQueryID =
Costs = 150


QuoteAutoTileBase is the IID table base

This I don't understand jet

QuotePlaceQueryID is the IID of the LTEXT file that contains the plop description

Also this is not really clear jet.


Jonathan

you also need to add full stops to the right side of | in ConsLayout.

AutoTileBase (ATB):

This is what sets the IID of the models for each tile in the puzzle piece. Quite simply the IID you put after 'AutoTileBase = ' is the IID of the top left tile of the puzzle piece.

Then for every tile down you add 10 and for every tile right you add 100, so say your ATB is 0x53405000 (thanks to superhands for the table :)):
[tabular type=1]
[row] [head]Base:[/head] [head]
X
[/head] [head]
X
[/head] [head]
X
[/head] [head]
X
[/head] [head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head][head]
X
[/head] [/row]
[row] [data]+n[/data] [data]000[/data] [data]100[/data] [data]200[/data] [data]300[/data] [data]400[/data] [data]500[/data] [data]600[/data] [data]700[/data] [data]800[/data] [data]900[/data] [data]A00[/data] [data]B00[/data] [data]C00[/data] [data]D00[/data] [data]E00[/data] [data]F00[/data][/row]
[row] [data]00[/data] [data]0x53405000[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]10[/data] [data]0x53405010[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]20[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]30[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data]0x53405430[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]40[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]50[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]60[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]70[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]80[/data] [data]0x53405080[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]90[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]A0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]B0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]C0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]D0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]E0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[row] [data]F0[/data] [data]0x534050F0[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data] [data].[/data]  [/row]
[/tabular]

Because F is highest digit (hexadecimal) which is 16 in Decimal that means there is a 16x16 tile limit on puzzle piece.

You should be able to work out what you model IIDs should be once you have decided an ATB for you puzzle piece. To get one in the RHW range you need to speak to Blue or Tarkus.

I'll carry on later :)

Jonathan

mtg

So the ATB (in your example 0x53405000) is the IID of the puzzlepiece? not of the models position on the piece?


mtg

I understand the table below, but how do those numbers connect to the models?