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

3D Faceted world generation #2458

Open
3 tasks
oniatus opened this issue Aug 26, 2016 · 1 comment
Open
3 tasks

3D Faceted world generation #2458

oniatus opened this issue Aug 26, 2016 · 1 comment
Labels
Category: Gameplay Content Requests, Issues and Changes targeting gameplay mechanics and content Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc.

Comments

@oniatus
Copy link
Contributor

oniatus commented Aug 26, 2016

When experimenting with 3D worlds (See here) it noticed some not-so-intuitive stuff in the world generation which may be some room for later improvement.

  • 2D facets are not 2D in the world but store their values in 2D-manner. This means, that multiple facets with the same values are stacked on each other. For example debugging the center of the GeneratingRegion for the SurfaceHeightFacet gives something like this:
    (16.0, -96.0, 80.0)
    (16.0, 160.0, 80.0)
    We have two SurfaceHeightFacets in one x-z section with the same values (thanks to using the same 2D noise in both areas). Probably no issue but something which may need some more documentation?
  • Same problem at tree generation: We have a multiple tree facets, stacked on each other. Containing a single 2D-noise spawnpoint for each tree. When rasterizing the facets (remember, a rasterizer works on a chunk an can not extend the region), the tree is created again for each chunk but only the blocks in the current chunks are set. This works amongst other things because of the stacked surface height. When removing the top surface height facet or setting it to invalid values, this prevents the upper tree-facets to be created, resulting in cut-off trees. With 2D heightmaps this works well and i did not further investigate the performance overhead.

I think the following tasks are required for a "real" 3D surface-world to work:

  • We need a "RegionSurfaceFacet", containing all surface points in one area. This may even be entirely empty or invalid (air chunk) and there may be multiple surfaces in the same y-axis (overhangs). All dependent computations (e.g. biomes based on surface height) have to be adapted.
  • Finding the spawnpoint requires new logic, maybe some kind of projection from the top y-axis on the first region surface point (see the org.terasology.logic.spawner.AbstractSpawner) for a comparable logic.
  • Creating all kinds of objects should be done in facets, not in rasterizers. So a tree has to be created in a facet where the tree generator can use the entire region. Afterwards a rasterizer should use this 3d-information (think of it like a block cache, similar concept in the World Generation Tutorial)

@Cervator Cervator added Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Category: Gameplay Content Requests, Issues and Changes targeting gameplay mechanics and content labels Aug 27, 2016
@Cervator
Copy link
Member

Cervator commented May 6, 2018

Linking this to #3146 as it would probably be closely related should either topic get worked on. There were some good discussions on the topic and proposals for GSOC 2018 but alas not enough slot/mentor capacity :/

Edit: Annnd that was the wrong issue, #3161 is cubic planets. #3146 is multiworld, which on its own may not really care about facets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Content Requests, Issues and Changes targeting gameplay mechanics and content Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc.
Projects
None yet
Development

No branches or pull requests

2 participants