SPONGE-2: World Generation API

This sounds like it would be pretty awesome!

This would be awesome to incorporate into Sponge.

Another idea for some API: currently my mod has to operate on only newly generated chunks, making adapting it to worlds people have already made unfeasible. I could get around this however if there was some way to obtain a list/hashmap/array of all previously generated chunks.

I think it would be nice to add for World class a method that returns “default” biome for provided point. It’s biome type that was generated by default generator:

Biome getOriginalBiome(int x, int z);
Biome getOriginalBiome(Vector2i location);

I’ve mentioned this in the “Things to Think About” section of the first post. Rather than looping though all previously generated chunks, I think it’s much better to do it as the chunks are loaded. All that’s needed is a way to remember which chunks have already been handled so that they’re not done twice.

I’ve added to the first post a “Dimension” interface (e.g. overworld, nether, end), and methods to get their vanilla generators. So what you suggest could be done as:

Biome originalBiome = world.getDimension().getVanillaBiomeGenerator().generateBiome(world, x, z);

I don’t think it’s worth cluttering the World interface with this as an extra method, but I agree that it should be possible to get this information.

EDIT: I’ve stated poking at this in a fork, nowhere near perfect yet, but it’s taking shape I think.

https://github.com/hoqhuuep/SpongeAPI
https://github.com/hoqhuuep/SpongeAPI/compare/SpongePowered:master...master

I wish sponge could generate one config file containing all the ore and decoration blocks. Organized by universal, biomes, and dimensions. This would allow server administrators of a centralized config file to turn on and off blocks overwriting mod configs. We could do one step better and add block generation weights and frequencies. I guess my point is one config file to configure anything to do with world gen.

As a developer of a custom world generator (Metropolis) I depend on something like Block[] generateTerrain(World world, ChunkPosition chunkPosition); or the classic byte[][] generateBlockSections(World aWorld, Random random, int chunkX, int chunkZ, BiomeGrid biomes) as well as some means to implement my own Populators or in your case StructureGenerators.

I would also appreciate some means to manage vanilla Populatorsand maybe even configure them. One use case would be to generate vanilla features (forests, ore, caves, villages, …) over custom terrain.

For my specific use case in Metropolis the StructureGenerator sounds very interesting, especially if one could persist meta data along with it.

Thanks for your efforts!

1 Like

issue: http://issues.spongepowered.org/youtrack/issue/SPONGE-2

Any updates on this? Will you make a pull request in the near future?

To be honest, I’ve not had time to work on it these last couple weeks. I won’t be submitting a pull request until I know the more fundamental parts of SpongeAPI (such as worlds and blocks) are a bit more stable.

PlotMe lead here, I’m good with anything as long as the chunk generator is not like the one I saw on another server implementation that gave this to me :

Fyi - I found the hook into custom chunk generation for the overworld. I'll see about surfacing an initial version of that you can tie into.

You’re basically given an x,z then can fill in what all the y’s should be in terms of block. Like y<=5 is bedrock.

1 Like

I’m fairly confident we can do a little better than that!

several comments,

any assumptions to the exact structure/world format of vanilla, at the API level and the number of ID’s available for biomes should not be near our API

similar to blocks/items integer IDs are not welcome at the API level for biomes.

1 Like