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')

@LordAro LordAro added the preview This PR is receiving preview builds label Oct 17, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 16:07 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 9de12b1 to 540fb35 Compare October 17, 2021 17:49
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 17:49 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 540fb35 to d189fee Compare October 17, 2021 17:55
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 17:55 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from d189fee to 6b1ff29 Compare October 17, 2021 18:25
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 18:32 Inactive
@TrueBrain TrueBrain removed the preview This PR is receiving preview builds label Oct 17, 2021
@Kuhnovic Kuhnovic marked this pull request as ready for review October 17, 2021 19:33
@TrueBrain TrueBrain added the preview This PR is receiving preview builds label Oct 17, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 20:00 Inactive
@TrueBrain TrueBrain added preview This PR is receiving preview builds and removed preview This PR is receiving preview builds labels Oct 17, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 17, 2021 20:43 Inactive
@Kuhnovic Kuhnovic marked this pull request as draft October 18, 2021 21:05
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 6b1ff29 to 7be940a Compare October 19, 2021 17:58
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 19, 2021 17:59 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 7be940a to 2a4cbe2 Compare October 19, 2021 18:00
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 19, 2021 18:01 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 2a4cbe2 to afc33ea Compare October 19, 2021 20:31
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 19, 2021 20:32 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from afc33ea to 4688c15 Compare October 19, 2021 20:55
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 19, 2021 20:55 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 4688c15 to d87d1d8 Compare October 21, 2021 15:55
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 21, 2021 15:55 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from d87d1d8 to 034c7cd Compare October 21, 2021 18:41
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 21, 2021 18:41 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 034c7cd to 8bda363 Compare October 21, 2021 18:44
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 21, 2021 18:44 Inactive
@Kuhnovic Kuhnovic force-pushed the railway_creation_through_bridges branch from 8bda363 to 2ade9cb Compare October 23, 2021 15:42
@DorpsGek DorpsGek temporarily deployed to preview-pr-9616 October 23, 2021 15:42 Inactive
@2TallTyler 2TallTyler added the work: needs rebase This Pull Request needs a rebase label Apr 21, 2023
@2TallTyler
Copy link
Member

#11089 accomplishes some of this in a cleaner way, but I'd still be interested in seeing the "drag through" feature finished someday. 😃

@TrueBrain TrueBrain removed the preview This PR is receiving preview builds label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work: needs rebase This Pull Request needs a rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants