Auto ore generation help

I was wondering how mining simulator was able to achieve this auto ore generation system. I presumed they hadn’t generated the ores already in a huge load. I’m not asking for any scripts I just would like some direction in where I’m going when trying to recreate this.

Which part of the generation system are you wondering about? The fact that some blocks are ores while some are normal rocks? The fact that it keeps generating as you dig deeper?

Your best bet to create a generation system like that, is do have an event for mining the block.
Id recommend doing the generation of the blocks first, then the actual mine event so you dont see a split second delay of the bricks being loaded.

The ores themselves are most likely ran on a weighed chance system, so id recommend searching the forums for how those work.

For generating the blocks, I think its as simple as generating blocks from all faces around that block, and making sure its not generating a block that has already been generated in it before.

That is how id personally do that, but then again there is always different methods.

Its the part where as you dig the ores generate

Any idea on how I would load/ unload a face of a certain block?

To load it, just either clone it from somewhere, or generate it from Instance.New, and position it accordingly.
To unload it, :Destroy()

As a way to see if that spot has been generated before, make a table and have the keys be the positions of the cubes, and do a check to see if that key exists.

Ah I see what you mean now so when generating blocks you mean to load all the blocks into the mine and destroy the ones not visible?

No, I meant generate it as the user mines. When a block is broken, generate the blocks that are needed.
Then delete the block that was supposed to be broken by the tool.

When a block is broken, you want to generate new blocks in every direction where no block has been generated before. If the destroyed block’s coordinates are (10, 10, 10), you want a new block at (11, 10, 10), (10, 11, 10), etc.

To keep track of which coordinates have been generated already, you could make table and set a coordinate to true after generating it, as Emerald mentioned.

Ohhh I get you now, any idea of how I would go about detecting which sides need generating.

As I stated before, use a table full of the locations that have already been generated.

local tableOfGenerated = {
    [Vector3.new(0,0,0)] = true
}

Something like this, but maybe not the exact way.

Thanks for the help guys, I know what im doing now roughly, appreciate it :+1:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.