Anyone interested in a self-randomizing rock?

I just created something in the course of doing terrain for my game, a randomizing rock.

I needed to create some fields of boulders, and I was dissatisfied with the approach of using several Prefabs and rotating/scaling them, so I got a little more in-depth.

What I ended up with was a rock that looks pretty boring in the Prefab state, basically just a little dome.

At play, the rock scales itself, randomizes the vertices, and also modifies the size and tiling of both the regular material, and the Normal, so not only is each rock randomly shaped, but also randomly colored, and each rock has the bump at a slightly different resolution.

Would this be something people would be interested in on the Asset store?
Just from the description, many of you could create the same thing if you had a mind to, but this might be good for someone who just wants to add some flavor to the terrain.

I’m thinking price point under $5. Any interest?

can you reproduce the same random rock in each session or is it never the same?

The way it works is random each run.

You can, however, adjust the overall amount of the scale and the texture values to be used on each instance, so the rock would be roughly the same size, shape, and color. This is adjustable in the Inspector.

The vertex manipulation that makes the rocks random on the detail level, however, would be unique each time play is pressed.
However, the amount of this vertex randomization (the overall multiplier) is a value in the Inspector.

So, you could make a rock so that it looked pretty much the same each time, but only by reducing the randomness factor…

But if you want that level of control, you should just make a custom model.
This is just intended for extra flavor and detail for those who want it.

If you set seed values for the randoms you’re using, you can have a persistent generation on every run, for each seed number you give it.

Just a suggestion. It’s looking good already, and it could look very cool indeed using triplanar projection shaders.

Cheers

Very true about the seed, thanks for reminding me…

I’ll add a variable for the seed, the user can set it to a random number to maintain the true randomness, if they want.

Maybe better to add a flag to set your own seed or allow a random one.

However, if you set your Random.seed to any specific value in your scene, this will randomize the same every time.
If you allow the Random.seed to be the ‘random’ value it is by default, the rocks will be different every time.

Sounds like a great idea!

I would love this, especially in combination with werewraith’s triplanar projection shader. You could, in theory, use world machine and tom’s terrain tools to use a greyscale distribution map to place these rocks on a terrain, then run the randomization to get a Settlers 7/Skyrim sort of thing goign on:

If I were to implement Werewraith’s shaders, how would that work?

I would buy the shaders then re-sell them with my package?

That doesn’t seem right? What if I want to sell for less?
Then someone could buy my package and get his shaders for free…

Or should I just suggest that as a way to improve the rocks, if the user wanted to?

Yeah, that last bit. I was only saying that for myself, since I own them :slight_smile:

Would there be a way to add a feature to make sure all the rocks intersect each other, like the rocks in that image i posted?

Too easy to script. Make a randomization seed, add the mesh and textures to the package, then you could probably sell $5 per download.

As I’m pondering the ways I might use it outside my own project, I’m thinking it might be useful if I could make the randomizer work in the editor…

Drag the base rock into the scene, click a button, randomize it, if you don’t like it, click again, get the rock you like, rotate, place it…