During the last month, several new big questions popped up reguarding cave structure and mineral gathering.
In this post I will try to address them and my thought process towards solving the issues.
There are a few gaps in between the geometry of the level sections.
How do I deal with that?
Well, up until now I have been using some free assets from a free asset pack.
You can find a url to the pack here: Free Modular Cave Models
In order to make it quick and easy for myself I wanted to try to make some tiles that could snap into place. This works very well, though it was not enough to be able to create a seamless transition between sections. As the mesh pieces I had available to play with did not fit very well with my square sections. And I would have to spend a lot of time to make it look good.
Next up was to generate my own meshes. I also knew I wanted to have some kind of random element to walls that I made, so that the same tile could be placed a different location in the world, and that it would end up looking slightly different based on that.
In order to make up all the types of walls I would need to cover the entire cave, I figured I could make due with two different patterns. One straight mesh where I can define a distance per instance, in case I want a longer or shorter segment. And the other one is a curved mesh. This one allows me to specify a angle distance and a radius per instance. This allows me to controll the size of the curve as well.
The result seems to line up quite well and is easy to work with and place.
The images below showcase 4 tiles that are lined up with different settings. (Listed from left to right)
Straight Wall, 1000cm distance.
Curved Wall, 500cm radius, 90 degree angle distance.
Curved Wall, 250cm radius, 90 degree angle distance.
Straight Wall, 250cm distance.
Though I’m not quite done with it yet. As a straight wall is not particularly interesting to look at over an over. So I needed to introduce a random element to the mix. For this purpose I chose to randomize it based on noise sampling a 3D location. At first modified the raw mesh data vertex locations with a scaled noise value. This looked exactly like what I want per tile, but unfortunately they did not line up at the edge to the next tile, because they generated separate different values.
I added a transformation to get the actual world location of the vertices, and when I fed those locations to the noise sampler it all fell straight into place. And the final result looks something like this:
Looks and feels rather natural, and blends together smoothly.
Some of the settings for the noise is set inside a parent object, which means: Should I choose to try other settings, I would be able to see the entire cave change at once.
There is a single scenario where my walls does not meet up properly. This is when there is a corner bewteen two straight walls. This is fine though, as that case is quite easy to cover over by some other mesh. A neat side feature for the curved meshes is that I can also use them to make pillars if I set the angle distance to 360 degrees.
Even though the walls themselves look great now, the overall feel of the cave would feel very blocky and maze-like. Andto combat that I have to place down some overlapping geometry in some places to change up the symmetry.
When it comes to the task of excavating minerals, I wanted that to feel realistic in some aspects. The main challenges to worry about when mining for minerals, especially gems would be to be careful not to break it. Or you will loose out on the potential value.
As you find a node that contains some minerals you are presented with a board of tiles. These tiles has to be dug out to uncover the minerals hidden within. You can go slow and steady with the lighter tools. Or use very powerful tools and risk loosing a significant amount of resources if you end up hitting something.
As you encounter different caves they will most likely have different ground material that the minerals resides within. You can spend resources to research a particular material, this will help you reduce the risk of destroying items. It’s up to you to figure out which minerals would be useful to upgrade. If you have two caves with the same mineral, you are off to a great start.
The image above shows a sneak peak of what the task might look like.
This is very much a work in progress still though, so this might be a subject to some changes down the line.
But in general, I like where it’s at right now.
And with that I conclude this post.
I have some building ahead of me.