Jump to content
Psiman

How to mod the appearance of railways tracks? (And roads, streets etc)

17 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

How would one change the appearance of a 1x1 railway track tile? Railway track tiles, as well as streets, roads etc, don't appear in the Lot Editor.

Share this post


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

When you say change the appearance, what exactly are you trying to do here?

Transit Networks are not Lots, they are handled completely differently to growable/ploppable objects. So there is no lot you can edit to place props or textures on such networks. Using something called a T21, you can "attach" a 1x1 lot (Props Only) to a network tile, but that's way beyond anything the LE can handle. A good T21 tutorial exists here if you are interested.

In terms of altering how the rail itself looks, that would require custom rail textures, but is more than possible.

  • Like 1

Head over to my Lot and Mod Shack to keep abreast of my latest developments.

Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

p.s. - I'm MGB over on SC4D and a member of the NAM team.

Share this post


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

    I wanted to try adding randomly-spawning trees/vegetation to the edges of railway track tiles to make them look like tree-lined railway often seen in urban areas.

    Share this post


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

    Two options:

    • A T21 mod that adds those trees to ALL the rail tracks, and it's difficult to use
    • A set of transit-enabled lots with tracks and trees, but that could become a bottleneck if badly modded.

    matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

    "Let us be scientists and as such, remember always that the purpose of politics
    is not freedom, nor authority, nor is any principle of abstract character,
    but it is to meet the social needs of man and the development of the society"

    — Valentín Letelier, 1895

    Share this post


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

    What do you mean by a "bottleneck", in this instance?

    I could try making a lot in the Lot Editor with track and trees to at least see if it would work from a visual perspective.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    33 minutes ago, Psiman said:

    I could try making a lot in the Lot Editor with track and trees to at least see if it would work from a visual perspective.

    That would be a good idea in any case.

    The 'bottleneck' refers to the fact that the lot would have to be transit-enabled to allow trains to pass through, and this requires specifying a certain capacity. If the capacity is below the capacity of the rail line, the lot will effectively become a bottleneck. What's more, transit-enabled (TE'd) lots meddle with the traffic simulator and cannot be plopped right next to one another; they always need at least one regular network tile inbetween.

    I skimmed through the T21 tutorial referenced in this thread, and if I understood it correctly, you can make it so that a given T21 object appears every tile, every 2nd tile, every 3rd tile, and so forth. Sounds logical to me because things like Maxis street lights are probably T21's, too, and you don't see these on each and every road tile, either.

    If you are going for a randomised appearance anyway, I wonder if you could apply the ad-hoc prop family technique to influence the probability of a prop appearing. If you can only enter one prop IID for the T21 object to appear, at least you can use a prop family ID (this time a proper prop family), and you could absolutely make a prop family that contains, say, four invisible props and one visible prop for a 20% probability of this prop showing up. When I modded sithlrd98's curve sidewalk mod, I replaced the reference to one and the same Maxis tree with a reference to a prop family, and the result was randomly appearing trees - check my HD Tree Replacement Mod for a demo screenshot. I don't see a reason why this wouldn't work with railroad, technically speaking. As far as appearance is concerned, there might be too little space, however, at least for taller trees (shrubs and bushes might be ok).

    • Like 1

    -=| You can choose a ready guide in some celestial voice ||| If you choose not to decide you still have made a choice |=-
    -=| You can choose from phantom fears and kindness that can kill ||| I will choose a path that's clear - I will choose free will |=-

    Share this post


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

    I made some quick lots to get an idea of how it might look. First picture is vanilla rail track, second adds random plants/trees, and third has fence plus plants/trees.

    WfBEfVa.jpg

    I think it looks more realistic with the additions.

    Share this post


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

    I'd tend to agree. IRL, you'll often see smaller plants, bushes, and shrubs between the individual tracks and on the tracksides. The additional flora also helps reduce the grid pattern by breaking up the straight lines where the brown rail base texture ends and the textures of the adjacent lots begin.

    TBH, I think you could even get away with placing some of the low flora a bit further inwards, towards the tracks.

    It also occurred to me just now whether a base texture that mimics grass and small shrubs would help. I mean, one method wouldn't exclude the other anyway...

    • Yes 1

    -=| You can choose a ready guide in some celestial voice ||| If you choose not to decide you still have made a choice |=-
    -=| You can choose from phantom fears and kindness that can kill ||| I will choose a path that's clear - I will choose free will |=-

    Share this post


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

    The only downside I can imagine to this would be when changing environments. For example, on a rail station or an industrial yard, you wouldn't like having trees in between the trains and its cargo or passengers.


    matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

    "Let us be scientists and as such, remember always that the purpose of politics
    is not freedom, nor authority, nor is any principle of abstract character,
    but it is to meet the social needs of man and the development of the society"

    — Valentín Letelier, 1895

    Share this post


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

    Yeah, vanilla unadorned track would still be needed.

    Share this post


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

    I wouldn't go the Lot-Based route with TE lots, because whilst two TE lots can be placed next to each other (note: ONLY when SC4Fix.dll is loaded), traffic can not pass between them, you must have at least one tile of regular rail between the TE lots. Without getting into the ins and outs of it too much, that will just lead to a need for many differently sized lots for every possible permutation. T21s are definitely the way to go for something like this. If you've got a handle on the Reader and the LotConfig side of things, T21s aren't all that hard in principle. You have one set for every tile, give it the Ortho Rail ID, then copy/paste the Props from a LotConfig into the T21. I.e. you make a 1x1 lot using LE, but the T21 must have the Props, which can't be edited in the LE directly. The tutorial I linked to before explains all of this in more detail. Having got a T21 working, then you could expand upon it to have more randomness using different patterns or Prop Families, including Ad-Hoc ones, which should work with T21s so far as I know.

    • Thanks 1

    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    20 hours ago, rsc204 said:

    I wouldn't go the Lot-Based route with TE lots, because whilst two TE lots can be placed next to each other (note: ONLY when SC4Fix.dll is loaded), traffic can not pass between them, you must have at least one tile of regular rail between the TE lots. Without getting into the ins and outs of it too much, that will just lead to a need for many differently sized lots for every possible permutation. T21s are definitely the way to go for something like this. If you've got a handle on the Reader and the LotConfig side of things, T21s aren't all that hard in principle. You have one set for every tile, give it the Ortho Rail ID, then copy/paste the Props from a LotConfig into the T21. I.e. you make a 1x1 lot using LE, but the T21 must have the Props, which can't be edited in the LE directly. The tutorial I linked to before explains all of this in more detail. Having got a T21 working, then you could expand upon it to have more randomness using different patterns or Prop Families, including Ad-Hoc ones, which should work with T21s so far as I know.

    How would doing things this way make this new tree-lined rail appear in the buildings menu of the UI interface? Would it be in the transit/route section, alongside normal rail? So one could place either types of rail on the map?

    I was wondering if the upgrade feature of Streets>Road might be able to be utilized? So one could place normal rail, and one could upgrade it to tree-lined rail, perhaps at no cost. Or vice-versa, from tree-lined to normal unadorned. Would save on having to delete the rail if one wanted to change, at least from one to the other.

    Share this post


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

    I don't think this is going to work. You see, streets and roads are two existing networks that are hardcoded in the .exe, and road is coded to be able to replace street. However, a similar kind of two different rail networks, with one being able to replace the other, is simply not implemented in the game.

    However, you wouldn't necessarily need it because you can specify near which zones which T21's are to appear, just like Maxis did. This also means that you can specify no T21 to appear when there's no zone whatsoever touching the railroad track, just like there are no streetlights alongside a road that runs through empty terrain.

    • Like 1

    -=| You can choose a ready guide in some celestial voice ||| If you choose not to decide you still have made a choice |=-
    -=| You can choose from phantom fears and kindness that can kill ||| I will choose a path that's clear - I will choose free will |=-

    Share this post


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

    Indeed, the street to road upgrade works because they are both included networks, the hierarchy of which allows roads to override streets. But no such additional network for rail exists and there is no option to add new networks to the game. You could consider using an RUL2 or Starter Piece override, but you haven't solved anything in the regard of TE limitations, meanwhile it would take an inordinate amount of time and the requisite modding experience to make such a redundant network.

    So all in all, there is no good option that will be part of the in-game menus. Technically a puzzle piece solution would work, but we're (the NAM team), not terribly keen on adding those. But if you could code such a piece in, you could do it that way. But still, whichever solution you go for, getting props on said pieces is going to require T21s, so why waste time on very complex modding?, when you can just T21 the regular pieces, using zoning as a way to control them.

    • Yes 1

    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


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

    What are the zones that one can designate the trees/vegetation to appear on using T21? There is this list from the T21 Tutorial linked to earlier in the thread - are these the zone options?

    "In the file, you will notice a bunch of values which i will explain here:
    LotConfigPropertyZoneTypes defines what zones your props will appear on, make sure to put all the ones you want in the values are as follows:
    0x00=None
    0x01=Low Density R
    0x02=Medium Density R
    0x03=High Density R
    0x04=Low Density C
    0x05=Medium Density C
    0x06=High Density C
    0x07=Agriculture/Farming
    0x08=Medium Density I
    0x09=High Density I
    0x0A=Military
    0x0B=Airport
    0x0C=Seaport
    0x0D=Spaceport
    0x0E=Landfill
    0x0F=Civic/Plopped

    LotConfigPropertyWealthTypes is for wealth:
    0x00=None
    0x01=Low
    0x02=Medium
    0x03=High"

    Would vegetation always appear on both sides or the track, or is each side treated separately according to the adjacent zone type?

    Share this post


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

    Imagine a T21 is simply a 1x1 tile lot of props. But rather than simply one lot, you can have many. You then code the Pattern / Zone Type and Zone Wealths to display each particular lot when those circumstances are met. Each T21 Exemplar has all those settings, the "Lot" part being the lines of the LotConfig Exemplar with the property "LotConfigPropertyLotObject" where the first Rep is 0x00000001, i.e. are props. Useful reference for that here. I think since you've made Ad-Hoc prop families, you'll have enough familiarity with the LotConfig Exemplar, it's just a data file with coordinates of what goes where on a lot.

    I think an example you can see in practise might help, the lights on Ortho street for my SAM11 mod (NAM) are similar enough and reasonably simple to understand. You can find these T21s in the NAM (requires SAM / SAM11 installed):

    SAM - 11 - Type21.dat found in Plugins\Network Addon Mod\Street Addon Mod\Textures

    So for a road with lights which intermittently change from one side to the other, in effect displaying every four tiles on alternating sides, good patterns to use would be:

    • ODD (SAMB_ZonedOdd)
      0x4,0x8,0x1,0x2
    • EVEN (SAMB_ZonedEven)
      0x1,0x2,0x4,0x8

    The Odd T21 has a Prop where a light sits on the left side, whereas Even has a Prop with the light on the right. That prop was added to a 1x1 regular lot, with the street texture upon it, allowing me to line everything up as desired. I then copy/pasted just the correct Prop LotConfigPropertyLotObject line from the Lot to a pre-prepared T21. VERY IMPORTANT: Whenever you alter any of this data, you must right click the exemplar properties pane and select "Re-Index LotConfig". Failure to do so will likely prevent your T21 or Lots from working.

    In terms of the T21s themselves, just find another to use as a template and edit the parts you need. So, if you copied the 2 T21s in the example, then make the following edits:

    • Exemplar Name
      Simply a label, but it's good modding to use clear naming for all your files.
    • Network Tile ID
      The Network Tile ID would be 0x03031500 (Ortho Rail).
      Quote

      Notes:

      • RRW uses a different ID scheme, so your mod will only work for non-RRW users.
      • Find the IDs simply using Reader - click on Tools / Texture Viewer, here you can view all the Maxis included network textures (and IDs).
        • This feature only supported the Maxis content, none of the NAM additions will appear.
        • Texture IDs are grouped together, the first seven digits are the same, but the 8 digit tells the game which zoom texture (MipMap) it is. So whilst you may look at Zoom5 (the largest), which ends in 4, we use the ID ending in 0 for the T21. Because the games code uses the 0 IDs to make everything work.
        • Note other valid ID groups (8th digit) 5-9 and A-E exist in NAM, but to my knowledge were not used by Maxis.
    • Exemplar ID
      The T21 needs a unique ID to work. Typically you'd use the ID of the Network Tile, so 0x03031500 for the first T21, then increment the last digit 1-9, then A-F. If you get beyond 16 T21s for a given tile, you'll need another ID. You need to be careful with T21s, because if existing T21s for a given ID already exist, your mod will conflict with it. In this case, you shouldn't run into that issue. Note that the actual IID of the exemplar needs to match this ID too.
    • Network Placement Pattern
      For a pattern without the 1 tile gap, but using the Odd/Even T21s for variety, use the following patterns:
      • ODD
        0xA,0x5,0xA,0x5
      • EVEN
        0x5,0xA,0x5,0xA
      • Alternately, if you will just use the Zone/Wealths for controlling placement:
        0xF,0xF,0xF,0xF (Every Tile, only one T21 is needed in this case).
    • ZoneTypes
      As per the tutorial, there are 16 zone types. You can have multiple T21s for different zones. This just tells the game when to display the T21, it doesn't care what type of props are in use.
      I'd suggest avoiding using "Plopped", since I figure the Maxis Rail station will trigger it. You want to avoid Trees there no doubt, but you might need to do some testing to be sure, it may invoke wealth too.
    • WealthTypes
      Again the tutorial explains this well, there are four wealth types to choose between.
    • Rotation/Flips
      All network textures may appear in one of four rotations, but that doesn't affect things here, so use all of them. Similarly, those textures may or may not be "Flipped" or "Mirrored", again we can safely select both. When you need to specify these in separate T21s, things get a lot more complex quickly.

    Of course the usage of Wealth/Zone combinations are really down to your requirements. In this example, lights would appear in every situation except when no zoning was present. But, a typical Street mod would use different T21s for Res/Com/Ind and even breaking those down by wealth. So you get nicer trees in richer areas, you could even add some random trash in R$ areas for example, to make things look a little downtrodden. Start small though, you can always edit these later, best to get a simple working T21 in place before expanding upon things. But if you were in the mood to make many T21s, you really could have a huge variety of different looks appearing automatically based on what's surrounding the rails.

    But, with T21s, you can do some amazing things and best of all, there is 0 user effort or menu items, they just appear when the circumstances are right, like this:

    24699032838_b1bc3ac392_o.jpg

    With sufficient use of randomisation, you can even find a way to make them not necessarily appear all the time too.

    • Like 1

    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


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

    Thanks for the info.

    Civic/Plopped would appear to be a large category of lots.

    Is it feasible to also make tree-lined rail appear as ploppable rail in its own right? Basically as a tool for the hardcore person who wanted full control over where tree-lined rail would appear. 

    So one could use the T21 auto-tree-lined rail as default; but then if one wanted manual control over whether tree-lined rail were to appear next to, for example, a particular police station or something, one could delete the default rail and lay instead some of these "manual" tree-lined rail tiles. 

    These are my thoughts on zones that should get auto-treelined rail:

    Tree-lined:

    0x01=Low Density R
    0x02=Medium Density R
    0x03=High Density R

    Not tree-lined:

    0x00=None

    0x08=Medium Density I
    0x09=High Density I

    0x0F=Civic/Plopped

    Undecided:

    0x04=Low Density C
    0x05=Medium Density C
    0x06=High Density C

    0x07=Agriculture/Farming

    0x0A=Military
    0x0B=Airport
    0x0C=Seaport
    0x0D=Spaceport
    0x0E=Landfill

    It will probably be easier to decide on these once the basic mod is made, and then assessing how the tree-lined rail looks visually against each of these zones.

    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


    ×

    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