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
280 stars 41 forks source link

Better Buildings from OSM #123

Open AidanLovelace opened 4 years ago

AidanLovelace commented 4 years ago

What does it do?

This pull request adds more advanced buildings to Terra 1 to 1. Instead of lumping the edges of buildings in with all the rest of the edges, it creates Building objects based around polygons created from ways and multipolygon relations. The buildings are still organized by chunks. I also wrote a separate ICubicStructureGenerator because with some buildings being very tall, a populator does not work as it only runs on chunks at the surface.

Here, you can download a compiled jar to test it: terra121-0.1.zip

Screenshots

A random shopping center in Nashville, TN image image

An area in downtown Nashville, TN image image

Change Log (major stuff)

Referenced Issues

43 #28

Additional Notes

orangeadam3 commented 4 years ago

This is a really cool addition but can you get it working as an option. Theres a sub class in EarthGenetatorSettings and a list of statements in the gui class. Also be careful with the cutting out the bounding boxes those are there to restrict data useage. if you must then make sure it is only ignoring the bounding boxes for buildings and only when this mode is active.

taeko-chan commented 4 years ago

this is really cool! I was thinking of doing something like this myself, but i never figured out a good way. i was wondering if you could tell me either here or on discord what you changed about the roads so i can ensure my generator for tunnels and bridges is compatible with this.

AidanLovelace commented 4 years ago

This is a really cool addition but can you get it working as an option. Theres a sub class in EarthGenetatorSettings and a list of statements in the gui class. Also be careful with the cutting out the bounding boxes those are there to restrict data useage. if you must then make sure it is only ignoring the bounding boxes for buildings and only when this mode is active.

So you would rather have the option to chose between building outlines, building shells, and no buildings at all? I've added the option to select between building outlines, building shells, and no buildings at all.

this is really cool! I was thinking of doing something like this myself, but i never figured out a good way. i was wondering if you could tell me either here or on discord what you changed about the roads so i can ensure my generator for tunnels and bridges is compatible with this.

In the placeEdge method of the RoadGenerator class, I added 2 checks in the loop that makes sure there's air above a road. Those 2 checks make sure the road will not replace parts of buildings with air.

LittlePippy commented 4 years ago

Now this is what i followed terra 121 for.

LittlePippy commented 4 years ago

Hey unsure if this is the correct place but how do i merge and complile pull requests for personal use

AidanLovelace commented 4 years ago

Not the right place, but create a pull request from my BetterBuildings branch(or whereever a pull request is from) to your master branch(or whereever you want it).

LittlePippy commented 4 years ago

Alright. And for a suggestion, i think there's OSM tags for building Type. I think itd be nice to have buildings be "generated" based on what it is like if its a fastfood restaraunt it can generate a restaraunt build. Makes it more nicer to drive around places and less bland (Considering these buildings are just one material and mobs inside afterall).

Edit: The white house doesnt exist for some reason.

AidanLovelace commented 4 years ago

I think itd be nice to have buildings be "generated" based on what it is like if its a fastfood restaraunt it can generate a restaraunt build.

That's outside the scope of this feature. You are correct that OSM has a tag to indicate type of building, but implementing that would be an incredible amount of work. One would have to build several variants of each of the possible entries for the amenity tag from OSM. https://wiki.openstreetmap.org/wiki/Key:amenity

On second thought, it's really outside the scope of the mod which is to generate the world as accurately as possible from datasets. Using pre-built buildings would defeat the purpose.

AidanLovelace commented 4 years ago

@orangeadam3

Also be careful with the cutting out the bounding boxes those are there to restrict data useage. if you must then make sure it is only ignoring the bounding boxes for buildings and only when this mode is active.

I only removed the bounding box from the geometry output (positions of all the nodes of the included ways) because it would return null for all the nodes outside of the bounding box. This lead to the edge case where an edge (hehe get it? edge case) that crossed a region boundary may not generate correctly. Additionally, for creating building objects, the positions of all of the nodes for the buildings are needed to generate any of it.

If that resolves this specific issue, then I think I've got this feature merge-ready! :)

z3nth10n commented 3 years ago

Well I already done this but without following the OSM api I just made a compatible Lost Cities patch for T121: https://github.com/uta-org/LostCities-Patched

It would be great to merge the work into one patch or maybe a unique mod. The problem is that Lost Cities generates buildings following a preset, so it's not good at the task of generating builds from a given polygon which could be cool.

EDIT: I tested your version with CC 1049 and CWG 123 and it gave me a NullPointerException.

latest (2).log debug (2).log