Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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.

  • Author

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!

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.

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.

  • Author

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.