Advertisement

Cubic Voxel world with different block types?

Started by March 31, 2018 10:54 AM
6 comments, last by Scouting Ninja 6 years, 8 months ago

Hello everyone,

 

First of all, I don't want to make some Minecraft clone.

Anyway, I was wondering what would be the best way to make a cubic world with a few different types of blocks(=different hardnesses, one for the terrain, one for buildings, one for player-built structures and an indestructible one), preferably in Unreal Engine 4. Of course I've already looked up voxel world generation online, but couldn't quite find anything I need. One of the biggest problems is that all of those blocks have to be able to take a lot of different colors, because they won't have a very "present" texture. The thing is that I don't wanna make a whole new block for every color. The maps are not supposed to be big, only like 2 km² or smaller, overall graphics don't have to look amazing as well.

I hope some here has an idea, the map creation is the only thing at the moment that's holding me from making the game. If you have any questions or need for more information, feel free to ask. Any help is greatly appreciated!

 

So first you state you're not going to make Minecraft clone, then you describe Minecraft clone (at least in terms of typical terrain approach) and present a problem that doesn't make sense in a Minecraft clone. How are "different colors" different than "materials", how is "a lot of them" bigger than usual material number, and what does "I don't wanna make a whole new block for every color" actually mean? 

Is storage a problem? Or you mean mesh? There are solutions to these problems easily accessible online - to provide any more help I need to understand what the problem is, and I'm struggling with this.


Where are we and when are we and who are we?
How many people in how many places at how many times?
Advertisement
2 hours ago, noizex said:

So first you state you're not going to make Minecraft clone, then you describe Minecraft clone (at least in terms of typical terrain approach) and present a problem that doesn't make sense in a Minecraft clone. How are "different colors" different than "materials", how is "a lot of them" bigger than usual material number, and what does "I don't wanna make a whole new block for every color" actually mean? 

Is storage a problem? Or you mean mesh? There are solutions to these problems easily accessible online - to provide any more help I need to understand what the problem is, and I'm struggling with this.

2

Ok, let me explain. Let's say I have my Terrain made out of blocks with the hardness 1. These are all the same blocks. But I don't want them to have all the same color, because it would look pretty boring, for the grass I want some different green types for example. I'll add a picture of what it should look like. So my problem is that with voxel terrain plugins for UE4 for example, they can only seem to generate one type of block, that's where my main problem is. I need a tool where I can generate a small terrain, but also place blocks by hand in the editor, to create buildings for example, and that in combination with the color and hardness thing.  I hope that made it little bit clearer.

Spoiler

ace6.jpg

 

 

Still not sure I get what you really want, as it doesn't sound like a problem to me. I don't know what plugins for voxels UE4 has, but what you want can be achieved by just storing some voxel material type (like grass, rock etc.) and adding color variance to this material in shader (by using noise, randomization or whatever method suits your needs). 

In terms of hardness, color and so on - these are just voxel properties and you store them either together under single "voxel" or you can split them into separate volumes if you want to be pro and use different storage/compression depending on the distribution of values. Then you create appropriate storages for each type of data and query them for a given position. Does that answer the question or it's still not what you're looking for?


Where are we and when are we and who are we?
How many people in how many places at how many times?
12 hours ago, GBSFM said:

biggest problems is that all of those blocks have to be able to take a lot of different colors, because they won't have a very "present" texture. The thing is that I don't wanna make a whole new block for every color.

You will create one material for this, then use Unreal's Instance materials. https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/MaterialInstances

Make a colored material, with a single Parameter called Seed or something. Allow a random function to change that seed on game start or object spawn so it becomes a random color.

This tutorial shows how to make dynamic Parameters: https://docs.unrealengine.com/en-us/Videos/PLZlv_N0_O1gbQjgY0nDwZNYe_N8IcYWS-/srUSDU1u0og

 

2 hours ago, GBSFM said:

So my problem is that with voxel terrain plugins for UE4 for example, they can only seem to generate one type of block

That is because it all is one type of block. Color and graphics have nothing to do with "types", that is all defined with code and blueprints. :) I could have a red block that burns the player and then change its color to blue with no change in the effect of what it does.

The voxel plugins assume you know how to make the materials you need and code you need. All they do is deal with the object spawning and Chunking.

 

What plugin are you using?

16 hours ago, Scouting Ninja said:

You will create one material for this, then use Unreal's Instance materials. https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/MaterialInstances

 

Thanks, this is really helpful.  :)

16 hours ago, Scouting Ninja said:

Make a colored material, with a single Parameter called Seed or something. Allow a random function to change that seed on game start or object spawn so it becomes a random color.

This tutorial shows how to make dynamic Parameters: https://docs.unrealengine.com/en-us/Videos/PLZlv_N0_O1gbQjgY0nDwZNYe_N8IcYWS-/srUSDU1u0og

 

That is because it all is one type of block. Color and graphics have nothing to do with "types", that is all defined with code and blueprints. :) I could have a red block that burns the player and then change its color to blue with no change in the effect of what it does.

The voxel plugins assume you know how to make the materials you need and code you need. All they do is deal with the object spawning and Chunking.

1

I actually want to make a few premade maps, rather than a new generated one every game start. It's going to be more of a shooter game than a sandbox.

 

16 hours ago, Scouting Ninja said:

What plugin are you using?

 

That's the biggest problem. There are quite a few plugins for UE4, but I don't know what would be the best one for my purposes. AT this moment I'm having a look at Voxel Farm. I also had the idea of making the maps in an external voxel-modeling program, then get them to unreal and make them destructible. But I don't know if I can tell unreal what the "crack points"(every single voxel) for the destruction are.

It would probably also work if I'd just take a few of those standard cubes, give them a few characteristics and build a map with these, but that would take ages, and the performance probably wouldn't be so great as well.

Advertisement
21 hours ago, GBSFM said:

then get them to unreal and make them destructible. But I don't know if I can tell unreal what the "crack points

You won't have " Crack points" that implies you would mark where a object can break, when in truth objects don't have a pre-made system for breaking.

With voxels you don't need to know the math for splitting objects.

In short: one of your large blocks will be made from smaller blocks that it will reference as child blocks. On hit you will check how many of the small blocks is hit and destroy them.

If you want blocks to fall off as they break, you need to see what child was hit, spawn a small block at that space with physics attached to the block.

22 hours ago, GBSFM said:

actually want to make a few premade maps

You can still do it with instances, just make the random color define it's self on create. Or you can manually a sign a color to each block. A other option is to use some kind of pattern to define colors so that all colors is always the same.

If for some reason you don't want to use instances then look into textures and texture atlases.

 

It reads like you are very new to making games. If you are look into textures and materials first.

This topic is closed to new replies.

Advertisement