TMPE: Prevent players from setting invalid lane arrows
Description
Players should not be able to set lane arrows that do not point to an outgoing segment. For example, in issue #361 the player mistakenly used straight lane arrows where the angle between the 4-lane highway and 8-lane road with median requires a right pointing arrow.
Technical Info
- Lane arrow logic is one of the features that is still handled by the legacy
Flagsclass. We could use this opportunity to move the code toLaneArrowManager. LaneArrowManager:- Implement logic to check which kind of lane arrows may be set for a given segment end
- Implement logic to correct invalid lane arrows
- Make
ToggleLaneArrows()callSetLaneArrows() SetLaneArrows(): Check if the intended lane arrow is validHandleValidSegment(): (gets called when a segment is updated) Make sure that old lane arrows are valid. If not, call correction code.
LaneArrowTool: Disable/Remove invalid lane arrow toggle buttons
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 18 (9 by maintainers)
Lane arrows and lane connections have different semantics. Lane arrows are thought to be less restrictive. Lane connections on the other hand cannot be ignored by vehicles. Thus, as of now you cannot represent lane arrows as lane connections.
Some use cases for “soft” lane arrows which cannot be covered by lane connections currently:
I also think that showing so many lane connections would clutter the UI.
On complex junctions, where there are say 6 segments connected to a node, some at strange angles, it is often difficult to discern exactly where traffic will go based on lane arrows alone. For precisely this reason I no longer use lane arrows feature and instead always use lane connectors feature.
In terms of cluttering UI, this would not be an issue if only the ‘active lane’ gets the connector line display. For example, user hovers the lane arrow panel for lane X, only the lane connectors for lane X are shown.
Lane arrows then become just a quick alternate way of setting lane connectors.
Instead of ignoring lane arrows, the relevant mod options would ignore lane routing (ie. lane connectors).
And, with everything now using lane connections the pathfinder & vehicle AIs have a single source of truth for routing through nodes.
It would be nice if when user is changing lane arrows we also show the lane connector lines, so they can see precisely what lane connections are being made based on their arrow settings.
IMO in all cases the lane arrows should really just be setting the lane connectors, and then lane routing at every node is purely based on lane connectors all the time = less branching. It would mean pathfinder, etc., only ever needs to consider the lane connections; all uncustomised nodes would be given default lane connections (and a flag stating that they are not user-defined) so 100% of lane routing is connection based.
@aubergine10 the #391 will prevent players from setting invalid lane arrows BUT if the player moves the other segment end, so that it falls into a different quarter of the circle, the arrows might stop working, does Move It! mod and the game handle that? I hope so.
It would be nice if we had separate issues for your feature requests such that we can track and work on them separately.
The plan was to use thin white lines for arrow-based
connectionstransitions, and thicker coloured lines for connector-basedconnectionstransitions.In image above (from #41):
RelaxedtransitionsWhen applying lane arrows, only the current lane transitions would be shown. When applying lane connectors, all transitions would be shown but with any arrow-based transitions in the thin white style.