Tunnel or bridges for trains

Moderator: ickputzdirwech

Koub
Global Moderator
Global Moderator
Posts: 7774
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Underground Rail

Post by Koub »

[Koub] Merged into the "undergroud rails/tunnels/bridges" discussion.
Koub - Please consider English is not my native language.
n7m6e7
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Mar 04, 2016 8:39 pm
Contact:

Re: Underground Rail

Post by n7m6e7 »

So. Skimming through, I noticed some concerns as to implimentation.

1. If it runs out of fuel in a tunnel....
Just make it continue forward until the powering engine is out.
Or
Allow fuel access to a train, from the entrance/exit of a tunnel.

2. If an entrance is destroyed with a train still in it...

Treat it like normal belts. If one side is destroyed, the train is still in the tunnel, and can exit the other side if the entrance is destroyed, OR by rebuilding the exit if destroyed. If both ends are destroyed....cave in. Train and cargo lost.
There are no absolutes. I live knowing I could always be wrong, but with confidence that I could also be right.
ImTheRealSlayer
Inserter
Inserter
Posts: 21
Joined: Fri Dec 14, 2018 4:56 am
Contact:

Re: Underground Rail

Post by ImTheRealSlayer »

i was just reading thrugh the planned features for Factorio. there is mention of an "underground" mode. Maybe if we go underground then we will be able to fuel our trains?? Underground train stops?

I can see how underground will be helpful.
Image
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Underground Rail

Post by Sad_Brother »

Something like ability to enter underground tunnel to get into small separate space like in Factorissimo?

It would be wonderful. And not too hard to make.
Zavian
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Underground Rail

Post by Zavian »

ImTheRealSlayer wrote: Mon Dec 31, 2018 11:49 pm there is mention of an "underground" mode.
Do you have a source for that?
User avatar
Wizard Marcos
Inserter
Inserter
Posts: 22
Joined: Mon Jan 16, 2017 7:12 pm
Contact:

Bridges, again.

Post by Wizard Marcos »

I've been thinking about this for quite some time but I end up forgetting it but I'm finally writing it.

Anyway, bridges. There are a lot of discussions for train tunnels and bridges, but we often come to some problems so this post is an effort to find an implementation that works. I apologize for the lack of order in my points. And my english sometimes.
Reasons
  • Crossing stretches of water without needing to use landfill. Perhaps this should come with power poles that can be built on water.
  • Improving throughput in 4-way intersections.
  • Looks nice.
Visuals
Basics:
  • Considering that tunnels would require a way to view their insides in order to fuel in some cases, and other things, I believe bridges would be a better way to implement a crossing feature.
    By making the bridge tile a metal walkway (example), avoiding the usual track ballast, the view obstruction would be minimal. Here's a mockup of what I mean (with a logo under it to demonstrate visibility):
    factorio_bridge.png
    factorio_bridge.png (56.45 KiB) Viewed 6988 times
    I'm suggesting it to be this way in order to allow the player/other vehicles to traverse the bridges. Don't forget the guardrail. Else something like what the Beautiful Bridge Railway mod does seems like a good solution.
  • The transition to a bridge would rely on a perspective trick, like cliffs. That would avoid the need for additional sprites for trains, since they would all be level, which in turn also makes speed changes to simulate a slope unnecessary.
  • Pillars would be spaced along the way.
  • Bridges would have to be wider than normal tracks in order for their height not seem too low. This is too keep collision boxes consistent both horizontally and vertically, because the pillars could just be offset from the tracks itself, but wouldn't allow rotation (for example, in blueprints).
  • Combining those last 2 points, pillars would be slopped similarly to Assembling Machines, with a smaller top than bottom.
Problems:
  • Since we still have to worry about keeping the bridge small enough to not overflow into other tiles, it may look like there's not enough space under it.
  • Visibility may still be too low.
  • Bridge pieces would need to have a certain size, in order to fit the pillars, and with those pillars certain rail distances may be affected. Usually players use 2 spaces between tracks (4 tiles), so this size would probably dictate pillar distances. This could be solved by making bridge pieces of different sizes similarly to how underground belts and pipes are implemented, but it might be too much trouble.
  • Pillars would need to overlap at connections to avoid weird visuals.
  • Power poles and lines would need to either cross above or below, but I can't see a way to make this work without looking bad.
Implementation
Basics:
  • Train logic itself should be mostly unchanged.
  • Using collision layers to prevent trains on a bridge from interacting with trains outside.
  • Now allowing track intersections on bridges. I think IRL this situation does happen, and using existing rail behaviour it shouldn't cause problems, but the need to make all sprites for different bridge configurations seems unnecessary.
  • The entrances to the bridge should be at least of the size of a train car, and not allow tracks to cross there. Trains would switch layers while on this piece.
  • All entrances would be straight, but curved bridge pieces exist.
  • Unlike existing tracks, bitters would probably need to interact with these, or else pillars might be abused to make a wall. If a train is on a piece that is destroyed by bitters it would explode.
  • Mining the pieces back would be done at the pillars. Mining would be blocked when rolling stock is on that piece.
  • Depending if the player is allowed on the bridge or not, exiting a train car would but them on the bridge itself or the ground closest to it.
I do believe the player should be allowed on bridges even if cars aren't, since we can cross them aboard the trains. Bitters would also need access to it, or else you could just make a bridge to a bitter infested territory and they couldn't cross it back. There's also the possibility of using weapons to attack from a bridge, but physical contact should only happen if they're in the same layer.

Problems:
  • The need to implement collision layers. I don't believe the game uses them ATM, but if they are implemented as a simple bit check, it shouldn't cause a huge impact.
  • However, need to store the layer for every entity would certainly increase memory requirements. However, I believe only vehicles and the player would require this, since building on bridges is not allowed, and if the tracks come as part of the bridge itself then there would be no need to store that information either.
  • Signals would still need that information, since making them part of the track isn't elegant. I don't think that simply not allowing signals on bridges should be the solution, but I don't think it would cause too much trouble if that were the case. Perhaps it would push players to rely less on bridges due to the fact that blocks would need to be longer.
  • I believe this was mentioned somewhere, but tracks were changed to a single piece in order to ease calculations (or something like it). This may cause some problems with this suggestion.
Afterword
Well, I guess that's it. I probably forgot a lot of things, so if you have something please comment and I'll try to give a solution to it.
Serenity
Smart Inserter
Smart Inserter
Posts: 1016
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: Underground Rail

Post by Serenity »

I'm not in favor of crossings. But bridges over water would be nice
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Underground Rail

Post by Sad_Brother »

Let me describe better how I see Underground Tunnel can be made:
  1. Two gates to the tunnel like underground belt. But both are 4x4 with a gap between 6 cells long.
  2. Both gates are the same entity, built from single item, destroyed if it's HP lost giving nothing.
  3. Both gates have rails and connected by rails in the "internal underground space" as a single rail track of proper length.
  4. Player can enter through any gate to small "internal underground space", filled by rails, and exit through any gate to the world above.
  5. Tunnel can be entered by Player as is, in the Car, Tank or Train.
  6. Biters would not enter, but would attack Tunnel.
  7. If Tunnel destroyed anything inside destroyed, killed.
  8. Nothing can be built inside Tunnel.
Pro:
  • Underground belts already in game.
  • Ground level constructions are not masked by above constructions.
  • All entities are built on one level.
Contra:
  • "internal" space like Factorissimo is not in base game. - Can be avoided by ignoring completely. Like Player move underground without visibility.
  • Hard to use Car/Tank/Train underground. - If straight movement is so hard, use automated trains.
What are you all think?
ImTheRealSlayer
Inserter
Inserter
Posts: 21
Joined: Fri Dec 14, 2018 4:56 am
Contact:

Re: Underground Rail

Post by ImTheRealSlayer »

Zavian wrote: Tue Jan 01, 2019 5:48 am
ImTheRealSlayer wrote: Mon Dec 31, 2018 11:49 pm there is mention of an "underground" mode.
Do you have a source for that?
Yes, i do.

https://www.factorio.com/content

Scroll down to "Possible Future Content" and you'll see it there.

Hope this helps!

EDIT:
I forgot to mention that this may be an EXPANTION or DLC item. Sorry about that.
Image
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Tunnel or bridges for trains

Post by Sad_Brother »

ImTheRealSlayer wrote: Sat Jan 12, 2019 11:11 am https://www.factorio.com/content

Scroll down to "Possible Future Content" and you'll see it there.
Developers decide not to use real 3d. So it seems no chances to build any other layer than surface as this content suppose.
Tunnel seems like already used underground belts and pipes. So they have a chance.
Bridges seems out of theme as they are second layer effectively.
Zavian
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Tunnel or bridges for trains

Post by Zavian »

Sad_Brother wrote: Sat Jan 12, 2019 1:01 pm Developers decide not to use real 3d. So it seems no chances to build any other layer than surface as this content suppose.
Tunnel seems like already used underground belts and pipes. So they have a chance.
Bridges seems out of theme as they are second layer effectively.
The game already supports multiple surfaces. Thats is how mods like Factorissimo are implemented. So underground seems feasible. What I don't expect to see is things like gradual changes in elevation or slopes.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Tunnel or bridges for trains

Post by mrvn »

Tunnels for players would be rather easy to mod. Bridges not so much unless they have closed walkway (which basically makes them tunnels except over the earth.

Take the factorissimo mod to see how players enter factory buildings. Now instead of a building with just one entry/exit make them have 2 entries/exits, change the graphics to looks like a tunnel and the collision mask to be placeable under rails. And voila, you have tunnels that go under the rails so you don't get hit by a train.
Darinth
Filter Inserter
Filter Inserter
Posts: 323
Joined: Wed Oct 17, 2018 12:17 pm
Contact:

Re: Tunnel or bridges for trains

Post by Darinth »

Some sort of a multiple-surface thing in vanilla would be awesome, but I think it might be (at this stage of development) better for post 1.0 work. The idea of parallel dimensions has also popped up at least once recently. Some ability to fully utilize multiple surfaces for transporting objects around. Send trains/belt contents to other surfaces. Might even give belts a leg up on drones if drones were limited to single-surface applications and also provide a cool way to separate drone networks.
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Tunnel or bridges for trains

Post by Sad_Brother »

Sad_Brother wrote: Fri Jan 04, 2019 8:36 pm Let me describe better how I see Underground Tunnel can be made:
  1. Two gates to the tunnel like underground belt. But both are 4x4 with a gap between 6 cells long.
  2. Both gates are the same entity, built from single item, destroyed if it's HP lost giving nothing.
  3. Both gates have rails and connected by rails in the "internal underground space" as a single rail track of proper length.
  4. Player can enter through any gate to small "internal underground space", filled by rails, and exit through any gate to the world above.
  5. Tunnel can be entered by Player as is, in the Car, Tank or Train.
  6. Biters would not enter, but would attack Tunnel.
  7. If Tunnel destroyed anything inside destroyed, killed.
  8. Nothing can be built inside Tunnel.
Pro:
  • Underground belts already in game.
  • Ground level constructions are not masked by above constructions.
  • All entities are built on one level.
Contra:
  • "internal" space like Factorissimo is not in base game. - Can be avoided by ignoring completely. Like Player move underground without visibility.
  • Hard to use Car/Tank/Train underground. - If straight movement is so hard, use automated trains.
Can any modder tell me what parts are codable, and what are not and why?
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Tunnel or bridges for trains

Post by mrvn »

Sad_Brother wrote: Mon Jan 14, 2019 9:11 pm
Sad_Brother wrote: Fri Jan 04, 2019 8:36 pm Let me describe better how I see Underground Tunnel can be made:
  1. Two gates to the tunnel like underground belt. But both are 4x4 with a gap between 6 cells long.
  2. Both gates are the same entity, built from single item, destroyed if it's HP lost giving nothing.
  3. Both gates have rails and connected by rails in the "internal underground space" as a single rail track of proper length.
  4. Player can enter through any gate to small "internal underground space", filled by rails, and exit through any gate to the world above.
  5. Tunnel can be entered by Player as is, in the Car, Tank or Train.
  6. Biters would not enter, but would attack Tunnel.
  7. If Tunnel destroyed anything inside destroyed, killed.
  8. Nothing can be built inside Tunnel.
Pro:
  • Underground belts already in game.
  • Ground level constructions are not masked by above constructions.
  • All entities are built on one level.
Contra:
  • "internal" space like Factorissimo is not in base game. - Can be avoided by ignoring completely. Like Player move underground without visibility.
  • Hard to use Car/Tank/Train underground. - If straight movement is so hard, use automated trains.
Can any modder tell me what parts are codable, and what are not and why?
You can't code the gates for trains. The rails on the surface can't be connected to the rails in the internal space and no train will path through the gates.
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Tunnel or bridges for trains

Post by Sad_Brother »

mrvn wrote: Thu Jan 17, 2019 12:50 pm You can't code the gates for trains. The rails on the surface can't be connected to the rails in the internal space and no train will path through the gates.
Can it be coded as a single peace of rails of full length with train not shown in the middle?
So no internal space, just part of the tunnel out of view.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Tunnel or bridges for trains

Post by mrvn »

Sad_Brother wrote: Thu Jan 17, 2019 4:09 pm
mrvn wrote: Thu Jan 17, 2019 12:50 pm You can't code the gates for trains. The rails on the surface can't be connected to the rails in the internal space and no train will path through the gates.
Can it be coded as a single peace of rails of full length with train not shown in the middle?
So no internal space, just part of the tunnel out of view.
I don't see any way to hide the train or change it's collision mask when it enters or leaves a specific rail piece. And that is what you would need for starters.

No, tunnels will need a new rail entity in vanilla. Preferably one that connects two surfaces at arbitrary positions. That would be the most general case.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Tunnel or bridges for trains

Post by Optera »

Sad_Brother wrote: Thu Jan 17, 2019 4:09 pm Can it be coded as a single peace of rails of full length with train not shown in the middle?
So no internal space, just part of the tunnel out of view.
That's exactly what OTTD does. Tunnel portals and bridge ramps are portals that turn off collision and in case of tunnels also invisible. The ghost train then travels in a straight line until it reaches the other portal. That hack is the reason why bridges and tunnels can't have bends, switches or change elevation. Also it required extra code to make signals work on bridges and tunnels.
Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Tunnel or bridges for trains

Post by Sad_Brother »

mrvn wrote: Mon Jan 21, 2019 1:51 pm I don't see any way to hide the train or change it's collision mask when it enters or leaves a specific rail piece. And that is what you would need for starters.

No, tunnels will need a new rail entity in vanilla. Preferably one that connects two surfaces at arbitrary positions. That would be the most general case.
Thanks!
So, this idea need serious attention from developers.
Good idea need good efforts to implement.
Optera wrote: Mon Jan 21, 2019 2:50 pm Tunnel portals and bridge ramps are portals that turn off collision and in case of tunnels also invisible. The ghost train then travels in a straight line until it reaches the other portal. That hack is the reason why bridges and tunnels can't have bends, switches or change elevation. Also it required extra code to make signals work on bridges and tunnels.
Tunnels/bridges do not need switches/signals. And bends are not extremely needed. I can agree with static length and two directions only.
Trains so often need different levels crossings.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Tunnel or bridges for trains

Post by Optera »

Sad_Brother wrote: Tue Jan 22, 2019 8:53 pm Tunnels/bridges do not need switches/signals. And bends are not extremely needed. I can agree with static length and two directions only.
Trains so often need different levels crossings.
Sounds like you never played OTTD.
Having no signals severely limits throughput either forcing very short or multiple parallel tunnels/bridges.
And I can't begin to count the times where I wanted tunnels to bend like almost every tunnel does in reality.

Those issues will be less severe in Factorio as large mountains don't exist, but they will come up if a hack solution is implemented instead of a clean one.
Post Reply

Return to “Implemented in 2.0”