Skip to content

Tunnels and Bridges - #119

Open
ttaeko wants to merge 57 commits into
orangeadam3:masterfrom
ttaeko:master
Open

Tunnels and Bridges#119
ttaeko wants to merge 57 commits into
orangeadam3:masterfrom
ttaeko:master

Conversation

@ttaeko

@ttaeko ttaeko commented Apr 21, 2020

Copy link
Copy Markdown
Contributor

what does it do?
This pull request adds tunnels and bridges to Terra 1 to 1. It is done by getting the start and end points of an OSM way as well as the start and end heights, and calculating the height using:
y = y1 + (c/d) * Δy1
where c is the distance along the tunnel, d is the length of the tunnel and y1 is the origin y.

As of current, all (famous last words) bugs have been fixed. Tunnels and bridges both generate correctly (outside of the edge cases listed below). The pavement is standard asphalt, although one photo has orange asphalt because it was taken before I changed it back.

Here are some photos of the results (more coming soon):

Near Airolo, Switzerland:
Terra 1 to 1:
Screenshot (6)

Real life:
Screenshot (8)

Gubrist Tunnel, Switzerland
Terra 1 to 1:
Screenshot (10)

Real Life:
Screenshot (14)

Lærdalstunnelen, Norway (World's longest tunnel):
Terra 1 to 1:
Screenshot (11)

Real Life:
Screenshot (13)

view from inside mountain of Lærdalstunnelen:
Screenshot (12)

Gotthard Pass (Ticino Side), Switzerland (no companion irl photo yet):
Screenshot (9)

Keep in mind the orange parts are asphalt in the pull request.

what still needs to be done?
3. Edge cases include:
-tunnels & bridges with multiple ways (e.g. one that crosses a border) don't work properly
-tunnels & bridges that dip down to below a certain level after becoming one on OSM.

CHANGE LOG (major stuff):

  1. Added new class "dataset/Pathway" which contains a lot of the new populator's methods & classes
  2. New generator VectorPathGenerator replaces RoadGenerator.
  3. Added a couple methods to OpenStreetMaps.java I order to get the lat & lon from nodes of tunnels
  4. Road material is now based on OSM data (asphalt, concrete, cobble etc.)

i left the class itself in just in case, but the osm path generation is now done by VectorPathGenerator.

Also important:
Because there hasn't been a grounding fix yet it may be best to wait until after that is fixed to avoid conflicts in OpenStreetMaps.java.

If you want to try out a complied version with tunnels and bridges, here it is (this version is a commit behind):
https://drive.google.com/open?id=1YaFy01VRi-lPOT-ccfkaYenwbSE1eQcV

That pretty much summarizes it, if anyone has any suggestions around this basic feature set, go ahead and comment and I may implement them as well.

ttaeko and others added 30 commits March 29, 2020 10:33
Merge newest commit from orangeadam3/terra121 master
# Conflicts:
#	src/main/resources/assets/terra121/lang/de_de.lang
transverse mercator and other new commits
@ttaeko ttaeko changed the title Tunnels and Bridges (sorta, needs bug fixing) Tunnels and Bridges Apr 25, 2020
@AidanLovelace

Copy link
Copy Markdown

I love this. Can't wait for it to be merged so I can start working on adding lane markings. Honestly it seems like a bad idea to add an additional option for "advanced roads." This seems like a feature that should be built in to the default road generation.

@ttaeko

ttaeko commented May 4, 2020

Copy link
Copy Markdown
Contributor Author

I love this. Can't wait for it to be merged so I can start working on adding lane markings. Honestly it seems like a bad idea to add an additional option for "advanced roads." This seems like a feature that should be built in to the default road generation.

I ended up writing a new populator that uses the Vec3d object to store coordinates, as I saw it more fitting. It also lets you do vector math easier. We could possibly just use VectorPathGenerator instead of RoadGenerator from now on, as it does the same thing RoadGenerator does + the tunnels/bridges and road surfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants