orangeadam3 / terra121

A Minecraft Terrain Generating Mod for Cubic Chunks 1.12.2. attempting to generate real terrain, biomes, and features on a 1:1 scale
MIT License
282 stars 40 forks source link

Improved road widths and tunnels #20

Closed taeko-chan closed 4 years ago

taeko-chan commented 4 years ago

Hello, I played around a bit with the source code, specifically the way roads are generated. I realize that some of it is quite... untidy... but it is very much so experimental. List of changes:

  1. Changed enum "Type" (dataset/OpenStreetMaps, 53) to include values more reflective of the tags of OSM.
  2. Changed the for loop in populator/RoadGenerator at line 68 to change the width of the road, and account for the lane dividers (i realize (2*e.lanes)/2 could be simplified for obvious reasons. it's for if i need to change the factor to make the road wider).
  3. Added "tunnel awareness" (idk, don't have a better name). Basically that means that the road will not generate where there's a tunnel, to avoid really weird things like on the Oberalp Pass in Switzerland (46.660920, 8.662008) or also to avoid covering the building outlines that are above tunnels in real life.

i also want to add road markings (maybe not dashed lines) and i'm looking into how i would generate a railway. src.zip

orangeadam3 commented 4 years ago

Cool but can you make a pull request instead it will be easier for me to merge and you would get credit for the commits in github.

orangeadam3 commented 4 years ago

I've been meaning to do proper tunnels and bridges for a while (I think it's been on my todo list for like a month) but I'm woried about junk like overpasses with 5 million bridge levels.

taeko-chan commented 4 years ago

yeah of course

LittlePippy commented 4 years ago

i appreciate this change a lot. i could feel if anything roads could be improved

taeko-chan commented 4 years ago

I'm already looking into how that could work with the auto-tunnels and bridges, especially taking advantage of OSM's layers

orangeadam3 commented 4 years ago

Just don't go too crazy with overhauls, I want to keep versions more or less compatable so roads shouldn't suddenly become 5 times wider or something when upgrading to a newer version.

taeko-chan commented 4 years ago

ok i made a pull request. I think 90% of roads don't vary too much, but freeways are the ones that vary the most. that's because I changed it so their lanes were 4 blocks wide instead of 2 (The rest only increased to 3). There's also a lot of fine tweaking I did and am planning to simplify along with progress on the bridges and tunnels.

taeko-chan commented 4 years ago

migrated this to a pull request, forgot to close this issue