Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Railways can be created "through" bridges, tunnels, stations… #9616

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@Kuhnovic
Copy link
Contributor

@Kuhnovic Kuhnovic commented Oct 17, 2021

…. And starting from depot tiles.

Motivation / Problem

RX3AJb1SRU

When laying track using the AutoRail tool, I often find myself accidentally starting on a bridge, tunnel or station tile. This invalidates the entire action and no rail is built. The other way around, i.e. starting at an empty tile and ending on say a station tile, that works just fine. This can be quite annoying for example when you are trying to create lots of bridges / tunnels in a crowded map.

Description

My changes allow the user to start the AutoRail tool on train station tiles, train depot tiles, bridgehead tiles and tunnel entrance tiles. The user must drag in the right direction, or can be 45 degrees off.

In addition, the user can drag "through" a tunnel, bridge or station. This obviously doesn't apply to depots. If there are multiple tunnels or a tunnel + bridge above each other, we would follow the route that a train would take when driving along the dragged line. In other words, we simply enter the first tunnel or bridge, and exit out of the other end.

[EDIT] This now only applies when one is creating new track. When deleting track, basically we just "delete whatever we can". This approach is more in line with how we currently do things (before my changes).

Here's an impression of what all of this looks like:

1RCFk94oG3

[EDIT] And now also for roads/trams:
SJXEnptlxb

Limitations

I like the visualization, but I need to jump through a number of hoops to get there. Worst case I can ditch the new visualization.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
@DorpsGek DorpsGek had a problem deploying to preview-pr-9616 Oct 17, 2021 Failure
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 9de12b1 to 540fb35 Oct 17, 2021
@DorpsGek DorpsGek had a problem deploying to preview-pr-9616 Oct 17, 2021 Failure
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 540fb35 to d189fee Oct 17, 2021
@DorpsGek DorpsGek had a problem deploying to preview-pr-9616 Oct 17, 2021 Failure
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from d189fee to 6b1ff29 Oct 17, 2021
@DorpsGek DorpsGek had a problem deploying to preview-pr-9616 Oct 17, 2021 Failure
@TrueBrain TrueBrain removed the preview label Oct 17, 2021
@Kuhnovic Kuhnovic marked this pull request as ready for review Oct 17, 2021
@DorpsGek DorpsGek had a problem deploying to preview-pr-9616 Oct 17, 2021 Failure
@TrueBrain TrueBrain added preview and removed preview labels Oct 17, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 17, 2021 Inactive
@Kuhnovic Kuhnovic marked this pull request as draft Oct 18, 2021
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 6b1ff29 to 7be940a Oct 19, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 19, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 7be940a to 2a4cbe2 Oct 19, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 19, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 2a4cbe2 to afc33ea Oct 19, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 19, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from afc33ea to 4688c15 Oct 19, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 19, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 4688c15 to d87d1d8 Oct 21, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 21, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from d87d1d8 to 034c7cd Oct 21, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 21, 2021 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 034c7cd to 8bda363 Oct 21, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 Oct 21, 2021 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants