Jump to content
Sign In to follow this  
Karybdis

DISCOVERY: File Formats, The Positioning formats (RUL, and Sc4path)

176 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 
As everyone probably expected, RH adds a new SC4Path file version 1.2. This file seems very similar to 1.1 path files, except that there are never any of the -- car_3_1 type lines in it. Where those lines used to be, there are just numbers now.
 
Also, several of the RUL files appear to be INI files, but they have the RUL TID and GID. It seems instance ID's in the range 0x00 through 0xFF are normal RUL files, instance ID's in the 0x1000's are special RUL files that define bridge specializations, and instance ID's in the 10000000's are INI files.
 
DatGen recognizes these files as follows:
 
IID's 0x00 through 0xFF: RUL File
IID's 0x1000 through 0xFFFF: BSPEC File
IID's 0x10000000 through 0x100000FF: INI File
 
I named the files of IID's 0x1000 throgh 0xFFFF BSPEC since they are all bridge specialization files.

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Hmm....what makes BSPEC different from normal Sc4paths? Are they all 1.2 or just different structure in general?

    Man I am so left in the dust without my copy 22.gif22.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    BSPEC is related to RUL files, not SC4Path files. They have a structure all of their own, which is different from RUL files. I'll post some content when I get home, to give you guys something to work with. 1.gif

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Ahhhhhh. My apologies 1.gif

    I'll be interested in getting a look at the new data when you get home 1.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     
    these wont take much figuring at least, straight from the file itself
     

    # Sections

    #

    # These are chunks of tiles that can be included into bridges. The

    # syntax for specifying pieces:

    #

    # piece <instance, rotation> Simple piece

    # piece <instance, rotation, htdelta, yoffset> Sloped piece with the given height change over the tile and model Y offset

    # piece <instance, rotation>:depth Simple piece with support column (: syntax also works for long form)

    # piece section-name Reference a section

    #

    # You can specify more than one piece/section in a line and you can

    # also reverse a section while referencing it:

    #

    # piece rev(foobar)

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Complete Spec compiled for BSpec via this info and stuff Hayly told me in chat

    Waiting for sc4path 1.2 info 1.gif

    ------BSpec specification

    Maxis definitions of how to write a BSspec file combined with stuff derived from a Bspec. Saves us a lot of the trouble :D

    Sections
    --
    section bridgetype_piecetype_pieceposition (IE warren_undertruss_start)
    (piece definitions)
    end
    ------------
    piece Simple piece
    piece Sloped piece with the given height change over the tile and model Y offset
    piece :depth Simple piece with support column (: syntax also works for long form)
    piece section-name Reference a section
    ------------

    Bridge Blocks
    --

    length 5
    piece definedsectionfromabove
    piece repsofpiece*definedsectionfromabove
    piece rev(definedsectionfromabove)
    end

    ---------------------------------

    That about does it 1.gif

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Here is the new SC4path 1.2 filetype 1.gif


    ----Header

    SC4PATHS
    1.2 - vers
    3 - Blocks in file
    0 - Sim/Stop blocks in file
    1- terrainvariance

    ---- Blocks

    1 - Transport type
    1 - Class/Path type.
    2 - Entry side
    3 - Exit Side
    0 - U1
    4 - Coordinate lines
    8,4.093335,15.843066
    4.371101,0.485801,15.843198
    -2.012599,-5.977500,15.843198
    -3.939568,-8,15.843173

    ------------------

    This specification is not tested so dont take it as word of course since I dont have a copy of the game. It should be correct however based on what I've seen so far.

    U1 is the only currently unknown value. Of course I've never seen it with a value of anything but 0 so I have no way of judging 1.gif

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Just the U1 as far as I can tell

    The Class/Path variable may also have a different reference table than 1.0 and 1.1 though. That will remain to be seen 1.gif

    Sims/stop value may also not be this and may be related to the U1, though I dont have a reference file to work with since I dont have the expansion yet.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Confirmed. All data but U1 is the same as always

    Files may contain stop and normal data

    U1 is the "junction" key. This means that its put to use where paths contain a junction such as where a rail track splits and goes in 3 directions. This is only used where the path originates at a side with one exit, and exits a side with more than one possible path

    This concludes our pathing thread again 1.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     
    good job guys 16.gif
     
    given all of this information, would it be possible to make a program to generate these? I am kind of assuming that is the next step for all of this 9.gif
    perhaps a viewer/editor, there are a couple places in a couple tiles that I feel could use some smoother transitions. I know DM that you were working on a viewer for DatGen, I cant wait to see how it comes out 1.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    I have started trying to do some bugfixes on the sc4paths which have bugs (and are not allowing proper traffic flow).
     
    In that process, I have noticed that the 'path class number' in our specification needs to be updated.  There are many more, for what I'm not sure, but I have noticed more than simply a, b, and c for one way roads and avenues.  When I get a better handle on it, I'll let you know.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Yea. there are a lot more I know

    the problem is we need a visual editor in order to see visually the positions they're all in.

    The spec is done really but these things deffinitely need to be made into an updated table and updated into the specification as we go. I daresay that RH includes some new ones also over the original types as well. No worries though. Using existing values should work fine in most situations at the moment I believe though. Its just the highly complex stuff that need the full table values.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    DarkMatter - concerning your editor, I have discovered some things, and was wondering if you knew any more that could help me out.
     
    It has to do with one way roads/avenue tiles.  There are some avenue intersection tiles which are used for one way roads OR two way roads, which means that there is something in the programing which 'flips' or ignores some of the paths for one way roads.  I have been unable to determine how this occurs, which is what has held up my second transit bug fix, but if I find any more specifics I'll let you know.  If you know more about this, please let me know.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I would think that this would be done in two ways. Instance and Class

    Instance would have an instance ID that is possibly dual related instead of just being for streets or one ways. Actually the path tile may just be considered Avenue for all intents and purposes which brings us to class

    Using a new RH class type, they could theoretically have say m,n,o. Path m and N would show the two lanes for one ways. Path o would assume its a road and flip to the other direction.

    Path is always what determines stuff like this though. For instance in a lot of files you will have a class for american right side driving, and a class for UK left side driving, which is how the game calculates the routes for both. It would make sense that this could simply be applied to an intersection like this with two network types.

    The values could be exemplar based or hard coded to the exe depending. Unfortunately I'm siding to EXE

    Just some random mumbling. I dont think you should take this as anything serious but hopefully it will help somehow.

    Random thought that the junction key could be substituted for a situation like this too.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Karybdis/7th....I'm not entirely sure what your talking about, or what the context of what your talking about is. 1.gif I'm still trying to get a deeper understanding of SC4Path files (it kinda comes as I program), but I don't have a complete and unhampered understanding of them yet.
     
    By avenue intersection tiles...what do you mean? A tile can mean many things in SC4....from simply an FSH image to a collection of FSH, RUL, and SC4Path files working together, depending on the context. From what I've learned of SC4, there is very little that is explicitly hard-coded for a single thing. The games engine was designed to be extremely flexible, through exemplars primarily. So its very unlikely, at least the way I look at it from a programmers perspective, for this "flip" thing to be a hard-coded feature of the .exe. The thing about SC4Path and RUL files is they arn't really something that works alone. The transit system is extremely integrated, using all the files together, including exemplars, to make everything happen as its supposed to. That kinda makes it a difficult system to reverse-engineer, particularly pathing quirks like this.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Sorry, I'll try to be more specific.
     
    Example:
     
    SC3path file at instanceID 0x04008800
     
    This is an avenue intersection piece where a road or one way road is going through an avenue and terminates at at least one side.  The path file is written as if the connecting road is a two way road.  BUT, if you draw a one way road, it does not allow traffic in the other direction.
     
    So, in this example, depending on which way the one way road is going, one of the following is either ignored or reversed:
     
    Car_c_3_0
    Car_a_0_1
     
     
     
    edit- how's the path viewer/editor coming?  huh huh? huh huh? 14.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Oh, its comming along. 1.gif I have some questions though. First, what area's worth of tiles does each path define? Just one tile, or many tiles? Second, whats the range of the coordinates in a path, and does the 0.0,0.0,0.0 coordinate represent the lower right corner of a tile or the upper left, or the very center? These are the first things I'll need to know to write a viewer. Right now I'm relearning 2D coordinate system transformation. If the 0,0,0 position of the path coordinate system represents the center of a tile, the transformation code will be a little more complex than if it were at one of the corners. But before I can plot any points at all, we need to know the range of a paths coordinate system. By that, I mean we need to know what the maximum and minimum coordinates within a single-tile constraint are. Once I know those values, transforming path coordinates into pixel coordinates is easy.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    ----------------

    On 10/3/2003 2:53:03 AM DarkMatter wrote:

    Oh, its comming along.
    1.gif
    I have some questions though. First, what area's worth of tiles does each path define? Just one tile, or many tiles? Second, whats the range of the coordinates in a path, and does the 0.0,0.0,0.0 coordinate represent the lower right corner of a tile or the upper left, or the very center? These are the first things I'll need to know to write a viewer. Right now I'm relearning 2D coordinate system transformation. If the 0,0,0 position of the path coordinate system represents the center of a tile, the transformation code will be a little more complex than if it were at one of the corners. But before I can plot any points at all, we need to know the range of a paths coordinate system. By that, I mean we need to know what the maximum and minimum coordinates within a single-tile constraint are. Once I know those values, transforming path coordinates into pixel coordinates is easy.

    ----------------


    Sure thing, DarkMatter.  here's the specs:

    X,Y - 0,0 is the center of the tile.  Range is -8 to +8 for both X and Y coordinates.

    Z - 0 is ground level, or 0 height added or deleted from the terrain height.

     

    SC4Paths define all FSH/Exemplar network tiles at thier corresponding instanceID for all zoom and wealth levels.  For instance:

    SC4Path at instance ID 0x00004000:

    Exemplar/3dm IDs:

    0x00004000

    FSH IDs:

    no development:
    0x00004000
    0x00004001
    0x00004002
    0x00004003
    0x00004004

    low wealth:
    0x00004010
    0x00004011
    0x00004012
    0x00004013
    0x00004014

    med wealth:
    0x00004020
    0x00004021
    0x00004022
    0x00004023
    0x00004024

    high wealth:
    0x00004030
    0x00004031
    0x00004032
    0x00004033
    0x00004034

     

    Hope that helps!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Cool, thanks. 1.gif Thats all I need for now. I have to write a brand new control for this, so it will be a few days, maybe a week before you see anything on it. Writing a control (fyi, a control, in windows terms, is a collection of visual elements that performs a task. An example is the file listing in windows explorer. It shows icons, has scrollbars, lets you arrange icons in several formats and change the viewing mode from large icons to small icons and even a detail view. Thats a control.) is a complex task, because you have to do the following:
     
    write rendering code
    write keyboard handling code
    write mouse handling code
    write code to handle possible errors
    write code to fire events (an event is like a mouse click)
     
    The control I'm writing is a point and line plotting system. Basically, it will allow me to input an array of items that each define a point and a connection to another point. The control will render each point and the connection as a dot and a line. I figure it should suffice for plotting paths. Eventually I will add the ability to select, move, add, and delete points and connections from a path file using this control, too.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    DarkMatter-
     
    Reading the first part of the networks INI file,  it appears that all paths get reversed for the UK version.  But, there are separate manually reversed paths written for one way streets which the UK version uses so that when it reverses them, it's still correct.
     
     
    Everyone-
     
    I've been having some difficulty fixing the last known bug with avenue/one way street intersections.  I'm trying to fix the RUL files so that it will allow a T intersection between a North or Southbound one way road, and an avenue extending to the west.  Currently this cannot be built.
     
    I have isolated the network tile in question, it's at instanceID 0x091a5500.  However, there is no mention of this ID anywhere in any of the RUL files, even though it can be built in other orientations.
     
    I thought all network tiles had to be mentioned in the RUL file somewhere.  What am I missing???

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    It has to be in a rule if its used in the game

    If its impossible to use in the game which is what I think you're saying, then that means they never created a rul entry for it accidently so you'd have to create one from scratch.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    sorry, I'll try to be more clear:
     
    It IS possible to use in the game.  However, there is one rotation which it should be able to be used and it doesn't work properly.  The other 3 rotations work fine.
     
    However, I have looked through all the RUL files, and haven't found any mention of that hex anywhere.  So, I'm confused.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    hmm.... check the first 4 characters only of the instance

    Given that its an avenue interaction section, it may not have a direct instance reference since it covers more than one tile. This happens in other places

    Otherwise check the INI files under the RUL category which might have more of it. More by semi-instance than a full instance ID though I'd guess.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    well, I extracted all the RUL files and the INI file governing networks into text files.  Then I searched for 91, 1a, a55, and 5500 with no luck.  What is going on?
     
    I actually cannot find any refference to any tiles between 0x091a0200 through 0x09aa1100.  These are all tiles which are intersections or transitions between one way roads and other network types (road, avenue, and street).  Where are these tiles controled from?  Again, the specific tile I'm looking for is 0x091a5500.
     
    I suppose there could be some sort of masking going on,  using the same RUL file since the instance IDs for these tiles might have some part symilar (last 5 digits?) to road tiles, I'll have to check into this.  Any other ideas?
     
    [edit] well, there doesn't seem to be any correlation that I can find.  I guess I go to bed stumped once again 15.gif [/edit]

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    This is also stumping me too... maybe by exemplar? ~_~

    Fraid I'm out of ideas until we get a graphical editor up and running

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Well, I think I've figured at least something out, but if I'm right, the news is not good:
     
    It seems that any transitions (intersections or not) between different network types (street, road, one way, avenue, rail, el train, el-freeway, ground freeway) are not handled in the RUL files or the one INI file we know about.  The previous INI file (before rush hour) handled these intersections and transitions.  However, in Rush Hour, those have been removed, and I assume placed somewhere else, but I don't know where.  There are likely MANY more transitions since there are so many new above ground transit types, so I'm not really surprised that they moved them, but I haven't found where they moved them to.
     
     
    Bottom line - There must be another positioning file format established for Rush Hour.  Has anyone figured out those AB files yet?  Maybe that's what we're looking for.
     
     
     
    [edit]
    Does anyone know why there are several RUL files which look very symilar but are slightly different?  Why the duplicate data?
     
    This set is very symilar, and governs road pices without intersections:
     
    file #61 instance 0x00000003
    file #121 instance 0x00000007
    file #154 instance 0x0000000b
    file #204 instance 0x00000013
     
    This set is also symilar, and seems to govern Road-Road intersections:
     
    file #81 instance 0x00000004
    file #130 instance 0x00000008
    file #148 instance 0x0000000a
    file #159 instance 0x0000000c
    file #208 instance 0x00000014
     
    [/edit]

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     
    I will throw this out simply so someone can use it work against, did they hardcode the one way roads because their system couldnt use them...?
    As I said, I'm with you guys, I doubt they did that, as it would be against their whole system, what we need is a way to search all files in the data for those 4 bytes, some way to scan the dat.......I'll work on this.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections