Page 1 of 1
Interface for reliable rail bridges with low UPS impact
Posted: Tue Jul 16, 2019 9:43 pm
by Oktokolo
Currently, rail bridge/tunnel mods need to do all sorts of ugly hacks to teleport trains and get araound pathfinding and/or train collision behaviour.
Would be nice to have some API wich would allow implementing reliable Rail bridges/tunnels with low UPS impact.
Some ideas:
- Allow disabling of train collisions on a tile or while beeing in the bounding/collision box of a modded entity.
- Allow trains seamlessly switch surfaces without breaking the pathfinder.
- Allow trains skipping (teleporting over) a small distance without breaking the pathfinder.
Re: Interface for reliable rail bridges with low UPS impact
Posted: Tue Jul 16, 2019 11:41 pm
by Rseding91
I don't think you understand the magnitude of your request. That's not something that can just be quick whipped up in a day for mod support. That's like 1-2 months work and a complete re-write of the rail system.
It's just not going to happen any time soon (if ever).
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 17, 2019 5:36 am
by Koub
TBH @Rsendig, the idea was from me : there was quite some cringe with the change on rail bounding boxes, and I suggested a modding interface request, because playing with bounding boxes might not be possible anymore, but maybe there could be a way to give modders a way to get bridges that wouldn't break the game.
Sorry @Oktokolo for the false hope
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 17, 2019 7:06 am
by darkfrei
But this interface must be requested as soon as possible and after some versions it can be (probably) done. Bridges and tunnels can have the same mechanics, don't forget tunnels too.
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 17, 2019 12:56 pm
by eradicator
Rseding91 wrote: ↑Tue Jul 16, 2019 11:41 pm
I don't think you understand the magnitude of your request.
On that matter, what would be the magnitude of somehow supporting only exactly the "bug" nessecary for a
minimal rail bridge mod. I.e. the ability to spawn in a second rail that - for the purpose of pathfinding - does not collide with "normal" rail (a flag maybe?). As far as i understand the engine already allows for trains to not physically collide as long as they're on different logical paths, even if these paths physically collide (or is this going to change as well?).
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 17, 2019 7:42 pm
by Oktokolo
Rseding91 wrote: ↑Tue Jul 16, 2019 11:41 pm
I don't think you understand the magnitude of your request.
The magnitude is that high - it has already been implemented
by accident and allowed reliable zero-UPS-cost rail bridges until version 0.17.55 (yep, the bounding box "bug"). Obviously it was of such a high magnitude that it came for free as a side effect...
Koub wrote: ↑Wed Jul 17, 2019 5:36 am
Sorry @Oktokolo for the false hope
Well, it is their game and they explicitly decided against keeping the support for bridges in the engine.
Most hope was gone after i first read their shallow explanation of changing bounding boxes crashing maps on load - as if you wouldn'd be better off not storing the rail graph in saves anyway as that obviously is data that is fully derived from the map's rail and signal entities.
I just had to try regardless because even on the internet there always is a tiny chance of people changing their mind when confronted with the obvious...
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 17, 2019 8:25 pm
by darkfrei
Oktokolo wrote: ↑Wed Jul 17, 2019 7:42 pmMost hope was gone after i first read their shallow explanation of changing bounding boxes crashing maps on load - as if you wouldn'd be better off not storing the rail graph in saves anyway as that obviously is data that is fully derived from the map's rail and signal entities.
Hey, what if we have only two hardcoded types of rails, both have hardcoded bounding boxes, both was tested good enough and have no crashes.
Re: Interface for reliable rail bridges with low UPS impact
Posted: Sun Jul 21, 2019 1:38 pm
by slippycheeze
darkfrei wrote: ↑Wed Jul 17, 2019 8:25 pm
Oktokolo wrote: ↑Wed Jul 17, 2019 7:42 pmMost hope was gone after i first read their shallow explanation of changing bounding boxes crashing maps on load - as if you wouldn'd be better off not storing the rail graph in saves anyway as that obviously is data that is fully derived from the map's rail and signal entities.
Hey, what if we have only two hardcoded types of rails, both have hardcoded bounding boxes, both was tested good enough and have no crashes.
I find your ideas intriguing, and wish to subscribe to your newsletter.
Oktokolo wrote: ↑Wed Jul 17, 2019 7:42 pm
Rseding91 wrote: ↑Tue Jul 16, 2019 11:41 pm
I don't think you understand the magnitude of your request.
The magnitude is that high - it has already been implemented
by accident and allowed reliable zero-UPS-cost rail bridges until version 0.17.55 (yep, the bounding box "bug"). Obviously it was of such a high magnitude that it came for free as a side effect...
Absolutely. ...and with zero game crashing bugs with the same root cause.... oh, wait.
Re: Interface for reliable rail bridges with low UPS impact
Posted: Tue Jul 30, 2019 11:05 pm
by MasterBuilder
If the issue is the bboxs changing via mods, what about hard-coding a second rail item, hidden like loaders, that has no bbox?
This wouldn't be changable via mods so it shouldn't cause a crash on loading. Then a mod like rail-bridge could make use of the hidden type without issue?
Forgive me if I'm wrong, I don't know too much about why it was changed or how much work my suggestion entails.
Re: Interface for reliable rail bridges with low UPS impact
Posted: Wed Jul 31, 2019 11:44 pm
by slippycheeze
MasterBuilder wrote: ↑Tue Jul 30, 2019 11:05 pm
If the issue is the bboxs changing via mods, what about hard-coding a second rail item, hidden like loaders, that has no bbox?
This wouldn't be changable via mods so it shouldn't cause a crash on loading. Then a mod like rail-bridge could make use of the hidden type without issue?
Ultimately, because the developers have decided they are not interested in that capability. Their reasons are complex, but bugs and crashes are, I must imagine, a definite part of it ... but so is, well, the same logic that means they didn't build the "rail bridge" aka non-colliding trains right into the base game when they built trains in the first place.