Rail Bridges

by DaveMcW

Adds rail bridges that can cross tracks without signals.

Content
4 years ago
0.17
99
Trains

i Nice work

4 years ago
(updated 4 years ago)

I didn't expect this to be done this quickly after discovering that quirk.

Here's hoping you will expand on this adding diagonal bridges or freely placeable ones.

4 years ago

I wanted to see what the curved rail bugfix would be before I committed to this. It looks like this mod is officially supported in the engine, so I will be adding features including diagonal bridges.

There are 4x as many diagonal variations and they are 2x as complex, so it might take a while.

4 years ago

That's good news.

With rotation and mirroring there's only 4 different variants. Not saying the code doing that mirroring and rotating wouldn't be complicated, but at least it shouldn't require a lot of graphic assets.

I played with collision boxes in Beautiful Bridges a bit to make those bridges no longer collide. It looked messy. You certainly need dedicated top and bottom rails for this to look right.

I'm a bit torn between your approach of creating the whole crossing in script and giving players a bottom piece and top piece directly each with collision only on one side to connect to normal rails. Later is a lot easier to make for you, but you will get a lot of bug reports from players failing to properly place those rails so their collision boxes don't intersect.

4 years ago

My target audience is people who can't figure out chain signals. :P

4 years ago

Excluding me from intended users of this mod makes me sad. :P

4 years ago

MFW > "officially supported". What exactly was the "fixed for next version" then? Did they only change vanilla collision boxes?

As for the "trains always render on top",... the only thing i can think of is on_tick + LuaRendering.

4 years ago

MFW > "officially supported". What exactly was the "fixed for next version" then? Did they only change vanilla collision boxes?

Exactly. But I am slightly worried that it might be be fixed for good if this mod spreads.

I'm a bit torn between your approach of creating the whole crossing in script and giving players a bottom piece and top piece directly each with collision only on one side to connect to normal rails.

I'd prefer that approach, but it's probably too hard to use properly for a lot of players.

As for the "trains always render on top",... the only thing i can think of is on_tick + LuaRendering.

I don't think that would help all that much. You can't cover a train below the bridge while the one on top stays visible. Both trains are using the same render layer.

4 years ago

I don't think that would help all that much. You can't cover a train below the bridge while the one on top stays visible. Both trains are using the same render layer.

That's why you'd have to dynamically en/disable the render using on_tick, depending on if there's two trains or not. If it was doable with just render_layer a static entity would've been enough.

4 years ago

Why not make a bridge with a roof, so both trains are hidden behind the bridge texture?

4 years ago

As a side note, in 0.17.56 all rail bounding boxes are now hardcoded/not moddable. This is to avoid unpexected collision/rail block merging behaviour. This will not lead to errors, but changing the bounding boxes will simply no longer do anything.

From https://forums.factorio.com/viewtopic.php?p=441490#p441490 . I guess that's the end of rail bridges?

4 years ago

Does it work with collision_mask instead of collision_box?

4 years ago

Just updated to 0.17.56 and tested. Trains will collide on bridge, so current version no longer works.

New response