Jump to content

Recommended Posts

Posted

Well we want to spawn BIG stone veins but if we have the max vein size have on 256 the game just insta-crashes in the def zone.

 

Our question is how to fix that, we want to have vein sizes of like 1024+, I mean like the veins of red and black granite from Gregtech.

 

Here is our current world gen code:

http://pastebin.com/ynkQ8G3q

Posted

You're going to want to write your own gen code rather than using WorldGenMinable, especially since WorldGenMinable is not very optimized for use with large veins. Not only that, but keep in mind that Minecraft's generation code is handled chunk by chunk, and a chunk is only 16x16 blocks in area. If you try to create a vein of 1024 using WorldGenMinable, your gen code will find itself trying to access coordinates in a chunk that is not yet loaded. When that happens, the new chunk will be forced to load, calling your ore generation for that chunk as well, which then forces yet more chunks to load, and so on until your game crashes because it's caught in an infinite loop.

Posted

hhmm Thanks, But does anyone know such a world gen code? Who i can use, of course people WILL and NEED to get credits! So if anyone knows about one. let me know!

Posted

If you're doing this in such a large scale, consider using one of Minecraft's 3D perlin noise generators.

Iterate through every block in the chunk, and check the perlin noise for each coordinate. If the block at the coordinate is stone, and the noise meets a certain condition (for example above 0.75), place your custom block at the coordinate.

Posted

There are random walk maze generator algorithm might might just make great vein generators. The idea is:

[*]pick a spot (x,y,z) in chunk

[*]push location on stack

[*]then pick a random direction from spot (of 6 or 5)

[*]if that location is stone:

  • place block, decrement count
  • If all blocks are placed: return
  • select that new location
  • goto step 2

[*]if there are open directions (where there is stone): goto step 3

[*]pop a location off stack.

[*]If stack is empty then you've probably filled the whole chunk: abort

[*]goto step 3

 

This would work best if the direction selection were weighted based on twistiness of veins desired. Less twisty mazes weight last direction as 60%, and 10% for each side direction.

Posted

There are random walk maze generator algorithm might might just make great vein generators. The idea is:

[*]pick a spot (x,y,z) in chunk

[*]push location on stack

[*]then pick a random direction from spot (of 6 or 5)

[*]if that location is stone:

  • place block, decrement count
  • If all blocks are placed: return
  • select that new location
  • goto step 2

[*]if there are open directions (where there is stone): goto step 3

[*]pop a location off stack.

[*]If stack is empty then you've probably filled the whole chunk: abort

[*]goto step 3

 

This would work best if the direction selection were weighted based on twistiness of veins desired. Less twisty mazes weight last direction as 60%, and 10% for each side direction.

 

We have fixed it with our current code. We just needed change some things in the code. Like the percentages. But that's fixed. it was spamming the ore and stuff like that :P

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.