Difference between revisions of "Bridge RUL"

From SC4D Encyclopaedia
Jump to navigation Jump to search
sc4e>Blue Lightning
(→‎Format: More info)
sc4e>Blue Lightning
(→‎Format: More info)
(No difference)

Revision as of 10:04, 3 July 2012

TGI Info
Name Bridge Specialization RUL
Format RUL File
Type

Group

Instance

0x0A5BCF4B

0xAA5BCF57

Varies. See below

Bridge Specialization RULs (often shortened to just "bridge RULs") are special files that contain layout information for complex bridges such as arch bridges. They are not like the other RUL files, as their syntax is not INI based.

History

Instances

The bridge RULs have one instance per network. They have the general format 0x0000100N where N is the network ID.
0x00001000: Road
0x00001001: Rail
0x00001002: Elevated Maxis Highway
0x00001003: Street
0x00001004: Pipe (Unused)
0x00001005: PowerLine (Unused)
0x00001006: Avenue
0x00001007: Subway (Unused)
0x00001008: Light Rail
0x00001009: Monorail
0x0000100A: OneWayRoad
0x0000100B: Dirt Road/RHW
0x0000100C: Ground Maxis Highway

Note that some networks currently do not have bridge RULs. The game does not require that a bridge RUL exists to draw bridges. Instead, any complex bridge will be drawn using simple rules dictated by the bridge exemplar.

Game Mechanics

Once the game has decided that a network draw is suitable for bridge placement, the game picks a bridge (the first one that appears in the bridge selection menu) and evaluates it. The game knows the internal ID of the bridge (defined in the Network INI) and checks to see if a bridge RUL for that network exists. If the file exists, it looks inside of it to see if it has an entry for that bridge ID. If one is found, then it evaluates the RUL. The game looks for a layout line that has the same length as the bridge being drawn and produces the output. If the bridge RUL, entry, or layout line with the proper length does not exist the game evaluates the bridge using the exemplar and internal layout system.

Format

The format of bridge RULs differ greatly from the other RULs as they are not INI based. Instead, bridge RULs use start declarations and end tags.

Comments begin with #.

   bridge ID


This begins a bridge section. The ID is the same one in the Network INI.

   section SECTIONNAME
       piece <IID, ROTATION>
       ...
   end


This defines a named segment (SECTIONNAME) of the bridge, consisting of one or more piece lines. Sections/segments are used in making the various length definitions of the bridge to avoid having to list each tile for each line. Piece lines have 4 versions:
1. <IID, rotation>: Simple piece
2. <IID, rotation, deltaHeight, yOffset>: Piece that has a slope. deltaHheight is the change in height across the tile (along the network) and yOffset is how far the model should be offset vertically.
3. 1 or 2 followed by :Depth : Piece with a support column. Depth defines how far down the support column goes.
4. SectionName_1 SectionName_2 ... SectionName_n: Import all the piece lines from SectionName. This type of segment can contain one or multiple section references. Prefixing a reference with a number then an asterisk (*) will repeat that section that number of times (ie, 3*endpiece will repeat endpiece 3 times). Using rev(SectionName) will reverse the section.

When a section contains multiple piece lines, the evaluation depends on the tile width of the network. For single tile networks, each line simply adds another tile. For dual tile networks, every 2 lines adds another tile (two lines make up the two tiles that make up a two-tile-wide bridge).

Many sections are often defined to consolidate sections of a bridge such as having a section for the end piece, the approach, the support, start of the arch, middle of the arch, end of the arch, etc. Sections should be named using a short but descriptive name (although many NAM and Maxis items use rather cryptic names). Uppercase letters don't seem to be allowed, but numbers are.

   length LEN
       piece seg ... seg
   end


The final part of the bridge definition is the number of length lines. LEN tells the game what length of bridge this section applies to.
The piece line here is followed by a number of section references, referring to the section sections above. The same modifiers that apply to type 4 piece references can be used here.