nvx / CleanroomGenerator

CleanroomGenerator - Clean Room style flat world Chunk Generator for the Minecraft Server Mod Bukkit. See the Bukkit forum thread for more information.
https://dev.bukkit.org/projects/cleanroomgenerator
GNU Affero General Public License v3.0
18 stars 23 forks source link

Add Grid Populator #1

Closed hwei closed 12 years ago

hwei commented 13 years ago

Can generate grid on surface of ground like this: http://i.imgur.com/UHdja.png In this example, generator id is "30,stone,20,dirt,1,grass;6,sandstone,3,sand,2,cobblestone,1,gravel". The "6,sandstone,3,sand,2,cobblestone,1,gravel" controls the grid, which means divides world into regions (32*32 chunks) with 12-width sandstone lines, then divides them with 6-width sand lines, then divides them with 4-width cobblestone lines, then divides them with 2-width gravel lines.

nvx commented 13 years ago

Interesting, perhaps a framework to add various different populators (ie, ones that may not necessarily be included in the CR plugin itself as well) could be in order.

As for the Grid Populator itself, where is 32x32 coming from? Is that hardcoded? Or? And I'm not sure where 6-sand, 4-cobble and 2-gravel comes from given the parameters "6,sandstone,3,sand,2,cobblestone,1,gravel"

I'm willing to merge this in but some clarifications on usage would be nice, and if things are hard coded I'll look into making it fully configurable.

hwei commented 13 years ago

In a world save, every region file name is r.X.Z.mcr, which contains 32 * 32 chunks. You can easily reset or replace a region by removing or replacing a region file. So, the largest grid is set to fit a region. If your structure dose not cross that grid line, you can safely remove or replace a region file without cut through it.

Yes, "32 * 32 chunks" is hard coded. I think larger grid is unlikely needed.

Hot to understand 6,sandstone,3,sand,2,cobblestone,1,gravel:

Step 1. Add a 6-width sandstone boarders to every region (32*32 chunks). Since every 2 neighbor regions' boarders are lying close together, they form a 12-width line.

Step 2. Add a 3-width sand boarders to every 16*16 chunks square. If there is already a boarder produced in previous steps, do not overwrite it. Adjacent 3-width sand boarders form a 6-width line.

Step 3. Add a 2-width cobblestone boarders to every 8*8 chunks square. If there is already a boarder produced in previous steps, do not overwrite it. Adjacent 2-width cobblestone boarders form a 4-width line.

Step 4. Add a 1-width gravel boarders to every 4*4 chunks square. If there is already a boarder produced in previous steps, do not overwrite it. Adjacent 1-width gravel boarders form a 2-width line.

So, it is almost configurable, except largest grid is 32_32 chunks and smallest grid is 2_2 chunks. (I found a mistake in my code just now, in the 2ed constructor of GridPopulator: subList(0, 8) should be subList(0, 5))

nvx commented 13 years ago

Ok, so from what I understand it is not possible to have grid lines around an area smaller than 16x16 blocks (ie, 1 chunk)? From what I understand though there is no reason why it couldn't be extended to this though, correct?

Just to confirm, there is no shortcut way of say making every chunk be outlined with a 2-wide line (ie, 1-wide line around the chunk) without having an insanely long "1,stone,1,stone,1,stone,..." line, correct?

hwei commented 13 years ago

Actually, in my version it can not smaller than 32*32 blocks. Just for easily coding.

Correct.

I also thought about generate a coordinate sign in every grid. But then I decided to use different lines to mark different area size.

nvx commented 12 years ago

Closing this issue as I've come up with a generic way to implement the same behaviour (and much much more!) through use of a schematic populator which I'll be implementing when I get the chance. See https://github.com/nvx/CleanroomGenerator/issues/9 for more info, but the idea is you just put your grid into a schematic, then tell it to repeat the schematic on the x and z axes