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

World generation #24

Open
5 of 15 tasks
caelunshun opened this issue Jul 28, 2019 · 5 comments
Open
5 of 15 tasks

World generation #24

caelunshun opened this issue Jul 28, 2019 · 5 comments
Labels
Milestone

Comments

@caelunshun
Copy link
Member

caelunshun commented Jul 28, 2019

Roadmap:

This page will be a useful resource.

@caelunshun caelunshun added the enhancement New feature or request label Jul 28, 2019
@caelunshun caelunshun modified the milestones: 1.0, 0.7 Aug 13, 2019
@aramperes
Copy link
Contributor

I think a first step would be to load the generatorName and generatorOptions fields from the level.dat file.

Then, supporting basic super-flat generation using the layers in generatorOptions to set blocks in un-generated chunks wouldn't be too hard. Afterwards, we'd need basic decorators/populators for biome features like trees as defined in the options' structures.

We'll need a perlin-noise library to support terrain generation in "default" world types, as well as implementing the biome grid/map layers. The logic for the latter could be based off Glowstone, which has near-parity with Vanilla (but only for 1.12).

Larger structures like villages, caves, and strongholds will probably be later additions and be tracked in separate tickets when the time comes.

At some point we'll also have to be able to generate a world from scratch (including the level.dat).

Does this plan seem fair to you, @caelunshun?

@caelunshun
Copy link
Member Author

caelunshun commented Aug 31, 2019

Seems reasonable to me. Superflat generation does seem like a good way to start, given its simplicity.

I think generating a "bland" default world should be the next step—just simple use of Perlin noise to generate hilly variations. This would then lay the groundwork for biomes, caves, and such.

https://github.com/jackmott/rust-simd-noise seems like a good noise library to use—its benchmarks show it to be over eight times faster than alternatives thanks to SIMD.

I'll take a look at Glowstone's biome grid implementation to try to understand how that works. How to generate the variation between biomes has been my main concern regarding world generation.

As for where to generate worlds: when the chunk worker is requested to load a chunk which does not exist, it should spawn a task on the rayon thread pool to generate it and have the task send the generated chunk through a channel when completed. This would be entirely asynchronous and multithreaded, which is ideal for performance.

@cheako
Copy link
Contributor

cheako commented Sep 4, 2019

I was thinking about looking for a save file. Links and meaning a repo would help.... someone could generate saves for a handful of seeds and post them... just make sure you inject some art into selecting the seeds. A website or application that generates saves would be better.

I don't know much about MC other than I think I would like it, I just won't run MS applications.

@hansihe
Copy link

hansihe commented Sep 4, 2019

I implemented the Minecraft worldgen in this crate a few years ago

https://github.com/hansihe/voxel_worldgen

It has most of the base features including biome support and cavegen. I don't really care that much about it anymore, so you have my permission to change the license/incorporate it in the project as long as I am credited.

caelunshun pushed a commit that referenced this issue Sep 7, 2019
* Load generatorName and generatorOptions from level
* Hook into chunkworker loading to generate new chunks
* Generate superflat chunks using the layers defined in the generatorOptions
* Do generation asynchronously
* Generate chunk when region doesn't exist
@caelunshun caelunshun modified the milestones: 0.7, 0.8 May 20, 2020
caelunshun pushed a commit that referenced this issue Mar 3, 2021
@koskja koskja mentioned this issue Aug 1, 2021
6 tasks
@Tracreed
Copy link
Contributor

Great resource for how certain things in the latest Minecraft update is achieved. A lot of talk about world generation.
https://www.youtube.com/watch?v=TycBrFKEteU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants