MineMaarten / Signals

Minecraft mod that adds OpenTTD style signaling and more!
GNU General Public License v3.0
17 stars 14 forks source link

Signals should handle misbehaving carts better #82

Closed AntiBlueQuirk closed 6 years ago

AntiBlueQuirk commented 6 years ago

Signals do not handle misbehaving carts well. In particular, if a minecart ends up going the wrong direction, signals will happily let the minecart through from the wrong side. The minecart will repath (you can see this with the network viewer), but the signal will happily provide a clear path signal as the minecart powers through it's block the wrong way.

Technically, I don't think the signal is misbehaving. But with this behavior, minecarts that get reversed can easily end up in loops where they keep blowing through signals the wrong way and nothing stops them unless they happen to run into another cart. (Which isn't really a great thing to hope for.)

In general, I think minecarts/signals should try harder to correct error conditions in the network. In other games like OpenTTD/Factorio, rails are designed so that error conditions are rare in the first place, but in Minecraft, it only takes a single runaway cart or mob standing on the tracks to throw the entire network into disarray.

Since minecarts already can detect when they pass as signal, I don't think it would be difficult to add a check, "am I going the wrong way for this signal?", and if so, ask the signal to stop the cart. After the cart is stopped (if it actually stops), it can attempt to reroute from there.

I suppose this is an alternate take on #66.

MineMaarten commented 6 years ago

Hmm yeah I agree that the Signals could (or should) assist with this. I don't see a valid use case of not wanting this assisting behaviour.

Also yes, this shouldn't be too hard to add :).