Jump to content
smf_16

Under the Bridge Project

35 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Exciting project! I like where this might be going.

 

1 hour ago, smf_16 said:

This is hardcoded in the .exe, so it can be changed with "normal" mods.

I presume this is can't be changed with "normal" mods.

 

1 hour ago, smf_16 said:

2. It turns out that the game is unable to handle roads under bridges (things like CTD's etc.), but some minor tweaks with DLL modding might make it possible after all.

The first thing which pops into my mind is maybe it'll need an invisible tunnel opening on each side of the bridge with the road texture only and then the texture under the bridge is simply eye candy.

  • Like 4

Chance favors the prepared mind. ― Louis Pasteur  
Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

Are you new here? Check out the Introduction and Guide to Simtropolis.

Share this post


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

    I presume this is can't be changed with "normal" mods.

    Oops, typo from my part. I have updated my post.

    The tunnel idea is actually really interesting. I remember an approach that I once used for roads under bridges that involved creating a tunnel (after removing your slope mod) and then putting an eye candy lot on top of the tunnel entrances (can't find that lot anymore). There's not a lot known about how tunnels are stored in savegames, but as far as I know they function like portals with the entrances being an actual 3D model. I'm fairly confident that it is indeed possible to create a tunnel in the savegame without the entrance models, and it probably doesn't require a slope either. Definitely something to keep in mind as a backup plan!

    • Like 5

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, smf_16 said:

    I'm fairly confident that it is indeed possible to create a tunnel in the savegame without the entrance models,

    It really is. If you build a street tunnel using NAM.dll and then remove the .dat, you'll get basically unrendered entrances. It's a bit buggy since there's terrain beside them, but it's the closest to invisible tunnel.

    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, smf_16 said:

    Oops, typo from my part. I have updated my post.

    The tunnel idea is actually really interesting. I remember an approach that I once used for roads under bridges that involved creating a tunnel (after removing your slope mod) and then putting an eye candy lot on top of the tunnel entrances (can't find that lot anymore). There's not a lot known about how tunnels are stored in savegames, but as far as I know they function like portals with the entrances being an actual 3D model. I'm fairly confident that it is indeed possible to create a tunnel in the savegame without the entrance models, and it probably doesn't require a slope either. Definitely something to keep in mind as a backup plan!

    Is this the approach? It's a lot I downloaded last year. Haven't used. Details are in the Readme.

    https://community.simtropolis.com/files/file/4524-under-bridge-road/

    • Like 1
    • Thanks 1

    Share this post


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

    I managed to make the UI tool let me drag a road under a bridge by patching out a few of its checks, but the tiles that are located under the bridge don't get placed.

    RoadUnderBridge.jpg.88899422ee0814f0ba115c92111a1f24.jpg

    Not sure what is going on here, but it acts as an invisible dead end.. The blank areas show up a standard terrain cells, so there may be further checks in the game code to prevent objects from being placed under bridges.

    • Like 7

    Share this post


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

    @Null 45 That's great! Could you send me that city so that I can inspect what the savegame looks like?

    It's definitely possible to have objects rendered under a bridge, as my initial post has shown, as has this post. It's mainly a question of whether they'll be functional, because it seems like all the "object subfiles" - like props, flora, buildings, network tiles - mainly contain rendering info, but the "simulation info" is stored somewhere else.

    • Like 1

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, Null 45 said:

    there may be further checks in the game code to prevent objects from being placed under bridges.

    Or maybe, just maybe, the game thinks there's another object placed in that tile. Remember, roads under bridges aren't like roads under elevated network structures where they're technically just an intersections. There's a reason why you will always see unrendered elevated pieces if the patterns are wrong, and there's none (afaik) for bridges. Tunnels operate like a portal, and that's why you can even place a building above tunnels. So, this could lead to some rewriting in the code that allows duplicate objects to occupy the same space together. And also hopefully, fix the horrible issue of immortal lots since it's also about 2 things colliding each other.

    And speaking of bridges, I wonder if we can build 2 or more bridges side by side, as requested by our fellow member Antonis aka @vetram? (And yes, I know he's more like talking about RRW-3. But, he did ask if he can build adjacent bridges)

    Share this post


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

    As far as I understand, the game has no problem whatsoever with rendering objects wherever you like. I have done numerous experiments with modifying the "object" subfiles - stuff like the prop, building, flora, network, pipe, ... subfiles. These files essentially just contain the rendering information for the game: they define the position of objects, and reference the relevant exemplar by TGI, which the game uses to find the model to actually render at that position. Hence it is perfectly possible to render stuff wherever you like, even over the edges of a city tile.

    The reason you can't get the game to render roads under bridges lies elsewhere. Basically, when you draw a road, the game first checks if it's allowed, and when allowed it populates the "object subfiles" with the stuff it has to render as a result of drawing a road - in this case, network textures. When thinking of a DLL mod, we have to make the game allow drawing a road there, and then actually rendering the road there will probably follow automatically.

    The immortal lot syndrome is not directly related to objects occupying the same space, but to some quirks in how the game uses the building identify a lot. As far as I understand the problem, if you bulldoze a neighbouring lot, the game finds all objects (props, building, flora, ...) within the bounding box of the lot and then deletes them. If there's an overhanging building from another lot, this building gets deleted as well, which no longer makes it possible to "reference" the neighbouring lot by its building object - because it is no longer there - and as such the lot can no longer be deleted.

    • Like 5

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


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

    I'm not sure why the roads in your experiment do not want to connect, but I guess one of the main difficulties with placing a road under a bridge is that there will be two network occupants in the same cell. The game doesn't usually do this. Though it can sometimes happen due to glitches. For example, placing a FLEX piece leaves behind an invisible network occupant (IIRC) that doesn't prevent you from placing another network occupant in the same cell.

    Let me try to explain. When you build network tiles, the game takes the information contained in the SC4Path files to recompute the path connections for the tiles in the neighborhood. The path connections are a compact representation of (in simplified form) the following information: cell coordinate, travel mode, entry side, exit side. In other words, they encode where each travel mode can enter and exit a cell, which is then used for path finding by the traffic simulator.

    The traffic simulator stores these path connections in a big array, one entry for each cell of the map. This is where having two network occupants, and hence two SC4Paths, in the same cell can be a problem. Either the path connections for that cell would correspond to the bridge tile or to the road underneath, but not both, so I suspect savegame editing alone cannot solve this. Unlike tunnels, bridges are not portals, but have a SC4Path file for each tile (which allows for the arched Road bridge, for example).


    The flat tunnel approach could work though, even without savegame editing. I don't remember who, but years ago someone experimented with this idea by modifying a slope mod to remove the portals and to start building tunnels at 1 meter slopes, and then covered up the gap in the Road with a large road-surface prop.

    As for placing network tiles or tunnels by savegame editing, I think one of the big mysteries still is the traffic simulator file 0x6990c1aa. I know it stores routing information for network tiles at least, but it's a very complex file the structure of which is not fully known and even less is known about the meaning of the data.

    • Like 6

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    34 minutes ago, memo said:

    The traffic simulator stores these path connections in a big array, one entry for each cell of the map. This is where having two network occupants, and hence two SC4Paths, in the same cell can be a problem. Either the path connections for that cell would correspond to the bridge tile or to the road underneath, but not both, so I suspect savegame editing alone cannot solve this. Unlike tunnels, bridges are not portals, but have a SC4Path file for each tile (which allows for the arched Road bridge, for example).

    This is what I feared too, but at least for the Network Index Subfile (0x6a0f82b2) it was able to handle it - meaning it did not crash, whether it's functional is another question. The network index subfile contains an array of network tiles, which hold a tile number and a pointer to the occupant in that tile (could be a Network Occupant 0xc9c05c6e, but also a Bridge Occupant 0x49cc1bcd).

    When moving the road 8 tiles up north, I also updated the tile numbers in the network index subfile, which means there are now 2 tiles with the same tile number in the network index. I feared that this might crash the game somehow, but it didn't. It's very much possible though that the Network Simulator Subfile 0x6990c1aa is not able to handle this. As you say, we'll probably have to decode it as well.

    • Like 5

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    8 minutes ago, smf_16 said:

    Saving works, reopening the city works. I can't believe this.

    Wow! That's excellent. Nice work. *:)

     

    • Yes 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, smf_16 said:

    I... I... I don't believe this.

      Hide contents

    image.png.2682d6ecc1f2aed229d40a96898280d9.png

    Turns out that there was only 1 thing that I missed: when moving the road, I updated the coordinates of the vertices, the center position of the textures, and the tracts - see the network subfile structure - but apparently I forgot to move 1 thing: the bounding box - labeled as Xmin, Xmax, Ymin, Ymax, Zmin, Zmax. As soon as I updated those as well, the road ends connected properly, and when I turned on the simulation, people are traveling happily under the bridge. Saving works, reopening the city works. I can't believe this.

    Wooow, this is incredible. Next test should be that you connect the bridge part with some homes and jobs too, to see how the traffic work on the crossing tiles. But this looks awesome so far...

    • Like 4
    • Yes 2

    I'm responsible for the Heretic uploads a.k.a. Heretic Projects, you may find updates about my ongoing projects into my development thread over at SimCity 4 DevotionTyberius Lotting Experiments or here on Simtropolis into the Tyberius (Heretic Projects) Lotting and Modding Experiments OR Show Us What You're Working On thread.

    Now I'm part of the NAM Team and the RTMT Team.
    I'm also working on some preservation and reorganization projects the behalf of non-anymore-active-developers and with the permission of the Staffs both on STEX and LEX. Current projects: SimcityPolska Restoration and WMP (WorkingManProduction) Restoration.

    Share this post


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

    Allright, I've done some more experiments - which involved a lot of CTDs this time - and I have made the following conclusions:

    • It turns out if you move the network tiles from the Network Subfile (0xc9c05c6e), but forget to update the tile numbers in the Network Index Subfile (0x6a0f82b2), then the game crashes as soon as you open the city, or as soon as you turn on the simulation. I haven't really been able to pinpoint what triggers what, but at least the network subfile and the network index have to be in sync or you get crashes, but the network subfile can handle multiple tiles with the same number.
    • While the sims are able to travel under the bridge, they are now no longer able to travel over the bridge, as you can see in the pictures below.

      image.png.3f7ca80138fe436d3acf060244792ff6.png

      image.png.5a042a9aac015c1a2bd112ea51300472.png

      I fear that this is going to be a limitation that I won't be able to overcome by simply modifying the savegame. My guess is that the game prioritizes NetworkOccupants over NetworkBridgeOccupants. That's backed by the fact that if I reverse all tiles in the network index, the game still prefers the road under the bridge, so the order of the tiles in the network index doesn't matter.

    I think I'm going to focus on trying to create an invisible tunnel next. I don't have a parser for the tunnel subfile yet, but it shouldn't be too hard as it's fully decoded and has the same structure as the prebuilt network subfile. It might be however that the invisible tunnel will need to be used on the bridge rather than on the road, because the experiments above have shown that if you have both a bridge and road at the same tile, then the game prefers the road for pathfinding!

    • Like 2
    • Thanks 4

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    11 minutes ago, smf_16 said:

    I haven't really been able to pinpoint what triggers what,

    I think it's simply the game needs to have index synced to the network for addressing purposes. Addressing thru network subfile directly would be more complex especially combined with TE lots and simulation. So, I think Maxis came up with the idea of indexing. Maxis designed the system that if you have any tile in the index, it'd try to access the network. If there's mismatch, the game throws an exception and CTD.

    • Thanks 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    6 minutes ago, smf_16 said:

    It might be however that the invisible tunnel will need to be used on the bridge rather than on the road, because the experiments above have shown that if you have both a bridge and road at the same tile, then the game prefers the road for pathfinding!

    But, but, but  ... wouldn't the tunnel ends be on either side of the bridge and never need to say anything to the cell that is the visual crossing? I mean the bridge just stays bridge and the invisible tunnel ends chat with each other regardless of the distance. (Like quantum entanglement.)

    The inside of the tunnels wouldn't have any sc4paths per cell. It seems to me that the tunnel interior would not have any entry in the bridge's cell location(s).

    However, the tunnel ends prolly do have some extra info as it knows how long the tunnel trip should take based on the distance between the endpoints. (That's been tested elsewhere.)

    • Like 2

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    26 minutes ago, CorinaMarie said:

    But, but, but  ... wouldn't the tunnel ends be on either side of the bridge and never need to say anything to the cell that is the visual crossing? I mean the bridge just stays bridge and the invisible tunnel ends chat with each other regardless of the distance. (Like quantum entanglement.)

    For the functionality of the tunnel, you're right, but I think that for the "eye candy" texture under the bridge, a tile in the network index might be needed to avoid a CTD, and apparently here the game prioritizes the road instead of the bridge.

    To be investigated I'd say, I'll first do some tests with tunnels. I wonder whether diagonal tunnels are possible by the way. If I look at the structure of the tunnel subfile, I'm inclined to say it should be.

    @Jidan the game uses various index structures indeed, the most common one being the ItemIndex, which determines what gets drawn on the screen. If an item is not present in the item index, it doesn't get drawn, regardless of whether it exists in its own subfile (like the prop and building subfiles). If you mess with the pointers in the item index and point them to non-existent objects, then you get crashes indeed. What's strange is that with the network index, I didn't change pointers at all. It's the tile number that has to match a tile that includes a network occupant type. That's behaviour I haven't observed yet while investigating the savegame.

    • Like 1
    • Thanks 1

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    8 minutes ago, smf_16 said:

    I wonder whether diagonal tunnels are possible by the way. If I look at the structure of the tunnel subfile, I'm inclined to say it should be.

    That's something I tried a while back. Unfortunately, the path finder didn't pick up this tunnel as a valid connection. I constructed this by building two tunnels and then swapping the relevant end tile connections.

    diagonal tunnel (non-functional)

     

    10 hours ago, smf_16 said:

    This is what I feared too, but at least for the Network Index Subfile (0x6a0f82b2) it was able to handle it - meaning it did not crash, whether it's functional is another question. The network index subfile contains an array of network tiles, which hold a tile number and a pointer to the occupant in that tile (could be a Network Occupant 0xc9c05c6e, but also a Bridge Occupant 0x49cc1bcd).

    To clarify, unlike the savegame files, the connections array I was referring to is of size 256x256, so there can only be one entry for each cell of the map. This seems to match your recent observations.

    • Thanks 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    16 minutes ago, smf_16 said:

    I think that for the "eye candy" texture under the bridge, a tile in the network index might be needed to avoid a CTD, and apparently here the game prioritizes the road instead of the bridge.

    Ah. Could that be done with an overhanging prop which would would be 1 cell wide and 3 or 4 cells long with the road texture?

    I don't expect we'd be able to see automata driving on it, but if the traffic itself made it thru, that would be the main thing as well as looking realistic.

    Something like this, but without the tunnel entrances and, ofc, as close to the bridge as the game would allow:

    imgW10-3413.jpg

    • Like 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    9 hours ago, CorinaMarie said:

    Could that be done with an overhanging prop which would would be 1 cell wide and 3 or 4 cells long with the road texture?

     

    Like these have the eyecandy overhangs

    • Like 2
    • Yes 1

    I thought about this, and am still thinking about it because though I've thought about this, I still have more thinking to do as to stop thinking about it would mean not to think.

     

    Share this post


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

    Yeah, it's definitely an option to do it with overhanging props, but at first instance I want to try it to do as "pure" as possible, also because this might pave the way better for a DLL mod.

    • Like 3

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, smf_16 said:

    this might pave the way better for a DLL mod.

    Go for it! Again as I said earlier, this could fix anything related to conflicting objects. Also, overhanging props can't have automata on it, which doesn't make a pleasant UDI experience. Finally, while DBE does exist, I wonder if we can stack up bridges while preserving the traffic in all of them. And removing the limitation of having two land in order to build one, allowing the creation of "continuous" bridge to neighbors.

    Share this post


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

    Allright, let's dig into the tunnels. I've written a parser for it, so I'm able to edit the tunnel subfile as well now. As always, let's first try to move an existing tunnel and see what happens. I've started from a city with nothing but a tunnel, as shown in the picture below.

    Naamloos.jpg.f7699e282cc1f4601e5e28d4845a3e81.jpg

    Next I've moved evertyhing 8 tiles to the left, which gave the following result:

    Naamloos.jpg.53eadc0c8d4a2d29a947ffeb0fbe1c01.jpg

    As you can see, the tunnel has been moved successfully. It has left a hole in the terrain, but that's an issue I'm aware of. The game stores somewhere whether it has to render the terrain texture or not, but I haven't been able to figure out where yet. Perhaps that @memo has some information on this in the context of the DLL that fixes the transparent texture. In any case, it isn't really relevant for the tunnel experiments, as simply opening and exiting an underground view redraws the textures.

    Next I tried to flatten the terrain where the tunnel initially was, which I could do without a problem. Then I zoned some RCI on the opposite ends of the tunnel. Unfortunately, it turns out that traffic isn't able to use the tunnel. I tried it out in UDI mode as well, and indeed, as soon as I drive to the tunnel entrance, I effectively end up in the grass.

    Naamloos.jpg.f419ab12258f8e3baa9c5863ee97356c.jpg

    This leads me to believe that even though tunnels act as portals, the game still stores the path through them somewhere. I also tried to demolish one end of the tunnel to see what would happen. Maybe that the game has somehow "exploded" the tunnel, but bulldozing one end effectively bulldozed the other end as well, so at least the game still knows the tunnel ends are connected. I suppose that's something @memo should have witnessed as well with his diagonal tunnel experiment.

    So, where could this additional information be stored? Well, the south tunnel entrance has 0x02f10018 as memory address, so I performed a search for this address to see where it is referenced:

    ┌─────────┬─────────────────────────────┐
    │ (index) │ Values                      │
    ├─────────┼─────────────────────────────┤
    │ 0       │ 'cSC4NetworkTunnelOccupant' │
    │ 1       │ 'cSC4TrafficNetworkMap'     │
    │ 2       │ 'cSC4OccupantManager'       │
    │ 3       │ 'cSC4NetworkManager'        │
    └─────────┴─────────────────────────────┘
    • cSC4NetworkTunnelOccupant: That's the tunnel subfile, so pretty obvious that it appears here.
    • cSC4TrafficNetworkMap: That's the network index. We already knew that the tunnel is referenced here. It must be moved to along to avoid CTDs.
    • cSC4OccupantManager: That's the item index, which the game uses to determine what objects to draw.
    • cSC4NetworkManager: This one has Type ID 0xc990bd46, and unfortunately the file is not decoded yet. Note that it's not the cSC4TrafficSimulator (0x6990c1aa) that @memo was talking about, and which is apparently extremely complex.

    Allright, let's see what this cSC4NetworkManager looks like. Phew, 34 bytes, that's definitely manageable:

    22 00 00 00 42 b3 e5 61 1c 89 51 15 01 00 02 00
    00 00 18 00 f1 02 2b d5 4b 8a f8 01 f1 02 2b d5
    4b 8a
    

    That probably translates to something like this

    22 00 00 00  Size
    42 b3 e5 61  CRC
    1c 89 51 15  Memory address
    01 00        Version
    02 00 00 00  Count of pointers to follow
       18 00 f1 02   Tunnel entrance 1 address
       2b d5 4b 8a   Type ID of tunnel subfile
       f8 01 f1 02   Tunnel entrance 2 address
       2b d5 4b 8a   Type ID of tunnel subfile
    

    I can't really tell what the purpose of this subfile is, but it's interesting that it only lists the tunnel entrances, it doesn't list the road tiles. I will write a parser for it and run it on large developed cities to see if something else gets added here as well, or whether it's only tunnel entrances. I'm inclined to say that perhaps bridge tiles could get added here as well.

    Anyway, it's clear that the tunnel path is not stored in this subfile. So where is it stored then? ¯\_(ツ)_/¯ The search can start, but at least we have learned that wherever the path is stored, it has no reference to the tunnel entrance, otherwise we would have found a reference to it.

    Looking at the list of possible subfiles where it can be stored, there's not too many of them that look like a candidate, apart from the Traffic Manager (0x6990c1aa). It might be stored in a SimGrid as well, but I don't think this will be the case because tunnels can crossover, which the structure of the SimGrids - which holds values per tile (or set of tiles) - doesn't really lend itself well for that. I think I'm going to do some diffing on two cities with tunnels to see how this traffic simulator class changes.

    • Like 1
    • Thanks 2

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


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

    Allright, I've done some additional experiments with te tunnel. I'm able to flatten the terrain using savegame editing without a problem.

    image.png.c1f3ec95d16dd51066879a144846f09a.png

    I also wanted to test what happens when I set the TGI that references the tunnel exemplar in the tunnel subfile to [0, 0, 0]. The game didn't crash, but suddenly the path across the tunnel got lost:

    image.png.29acdd0b7e61fa0868cb7be83466f97b.png

    This means that the game needs a reference to an exemplar in order to recognize the object as a tunnel. It isn't sufficient that this object is of the type "TunnelOccupant". The TGI that is being referenced in both tunnel ends is 0x6534284a-0x2821ed93-0xad00000, which can be found in SimCity_1.dat. It is a Road exemplar, but it doesn't do much more than referencing the model id. It's kind of weird that the game needs this to know it's a tunnel.

    As a final test for today, I've overriden the exemplar the tunnel references to specify an RKT1 of 0,0,0 - which means "no model". It results in the same visual behavior, but now the tunnel functionality is kept:

    image.png.cf04e337fb205d1c3a57c0915206923b.png

    So, in order for those invisible tunnels to work, we'll need the tunnels to reference an exemplar with an RKT1 of 0,0,0. We still don't know where the tunnel path gets stored though, so that's something that will have to be figured out for this approach to work too.

    • Like 1

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, smf_16 said:

    The game stores somewhere whether it has to render the terrain texture or not, but I haven't been able to figure out where yet. Perhaps that @memo has some information on this in the context of the DLL that fixes the transparent texture.

    My first thought was that this is defined as part of the network flags. These can be edited to toggle whether the terrain renders or not. Though, as you moved the network occupants, I guess there aren't any network flags associated to those cells anymore, so probably this is not the right place.

    As for the tunnel paths, there are SC4Paths files for the tunnel portals only. They have the same IID as the portal Exemplars themselves (IIRC) which in turn is set in the slope mod Exemplars. For the tunnel itself, there are no dedicated paths for it. Instead, the game dynamically connects the paths of the two portals. You can verify this, for example, by editing the paths for the tunnel portals to make them non-symmetric. The game still connects the two end points, even if they are not straight. For example, you could enter the tunnel at the +2.5 m x-coordinate and exit at 0 m.

    3 hours ago, smf_16 said:

    I tried it out in UDI mode as well, and indeed, as soon as I drive to the tunnel entrance, I effectively end up in the grass.

    I don't remember exactly, but this could also be a result of your tunnels being effectively "above" ground.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 12/16/2024 at 2:16 PM, Null 45 said:

    there may be further checks in the game code to prevent objects from being placed under bridges.

    Do you have solved the problem now? And are there differences between this and the @smf_16 method technically?

    Share this post


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

    As for the tunnel paths, there are SC4Paths files for the tunnel portals only. They have the same IID as the portal Exemplars themselves (IIRC) which in turn is set in the slope mod Exemplars. For the tunnel itself, there are no dedicated paths for it. Instead, the game dynamically connects the paths of the two portals. You can verify this, for example, by editing the paths for the tunnel portals to make them non-symmetric. The game still connects the two end points, even if they are not straight. For example, you could enter the tunnel at the +2.5 m x-coordinate and exit at 0 m.

    Ah, that also explains why setting the TGI to [0, 0, 0] in the tunnel subfile to caused the path across the tunnel to get lost, because now the game no longer has a reference to the path of the tunnel portal either. I haven't used drawpaths after setting the RKT1 to [0, 0, 0], but I suppose that in that case the paths on the tunnel portal should still show. I will verify later today.

    That also makes me wonder, could it be that the game stores a complete network of all paths somewhere in a subfile? Perhaps that it does this within the traffic simulator subfile. Does anyone know what happens if you use a custom SC4Path file somewhere in a city, and then remove it from your plugins folder? If this breaks the pathfinding, then it means the game probably does not "bake in" the paths somewhere. If the pathfinding still works, then it means the game has baked in the path somewhere in the savegame - presumably in the traffic simulator subfile.

    Compare this to how "prop baking" works: if you have a prop on a lot and plop that lot, the prop gets inserted in the prop subfile. If you remove the prop later on via the LE, the prop from the original lot will still show up, as the game doesn't dynamically rebuild lots, it uses what's present in the prop subfile. I can imagine the game doing something similar for paths, which would explain why my moved tunnel was broken because the paths of the portals weren't moved. I still doubt this though, because drawpaths on the moved tunnel correctly showed the paths on the moved road.

    13 hours ago, memo said:

    I don't remember exactly, but this could also be a result of your tunnels being effectively "above" ground.

    I think you're right, so the UDI testing is probably meaningless.

    • Like 2

    Visit www.growifier.com for ploppable residentials

    Love playing hearts and other card games? Have a look at www.whisthub.com!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    23 hours ago, smf_16 said:

    Does anyone know what happens if you use a custom SC4Path file somewhere in a city, and then remove it from your plugins folder? If this breaks the pathfinding, then it means the game probably does not "bake in" the paths somewhere. If the pathfinding still works, then it means the game has baked in the path somewhere in the savegame - presumably in the traffic simulator subfile.

    I'm pretty sure the paths are not baked in. You can certainly modify SC4Paths files and the change takes effect immediately everywhere in your city, without redragging networks. The SC4Paths files also contain way more information than needed for the path finder – the actual path coordinate points are only needed for automata. The path finder should just need entry and exit coordinates.

    • Like 2

    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