Help making a voxel cube game (similar to cube world)

Hello, i have been wanting to make a voxel based game similar to cube world for quite some time now but everytime i try to develop one i lack the skills and discipline needed to make such a hard project. I am writing this thread in the hopes that i can maybe be pointed in the right direction or understand what the prerequisites that i will need to know in order to make this game, i have had little coding experience in C# but i am in the process of learning it. I wan’t to make this game inside of Unity because I am not confident enough to make my own engine. I am feeling quite overwhelmed with what I’ve seen as i know the developer for cube world has quite a lot of programming experience and is able to code from scratch.

Terrain Generation/Biomes:
https://forum.unity3d.com/attachments/06-jpg.57949/
I have done procedural generation before by utilizing others’ scripts and implimenting them into my games, buti have never coded one from scratch by myself, i am hoping to achieve landscapes like those seen in cube world, but i lack the knowledge on seemingly simple tasks such as creating different biomes, trees, and the way the landscape changes color between those biomes using a shader. I do not want terrain generation like ones seen in AlexStv, as i have tried using it before and couldn’t understand how to implement biomes and other things, my goal is to basically be able to code the procedural terrain generation and every part of the biomes etc. myself

Fog/Lighting:
I want there to be a sort of fog around the loaded chunks of the game so the game seemes more seemless unlike minecraft where you can see the chunks being generated. As for the lighting I am unsure of how to add effective lighting and shadows into this game and make it work with the terrain to create different colored grass and trees in biomes and integrate them smoothly

Modeling/Animation:
I have had quite a lot of experience in modeling but less so in animating so modeling the characters should be easy for my game but in terms of animation i do not know if i do that within unity by seperating the model up into each limb and animating it with code or having a premade animation, if someone could help clarify the best method of animating 3d (cubic)models for use in my game that would be great.

SFX:
I can make my own sounds so thats something

HUD/Menus:
I can make graphics for the HUD

Conclusion:
I am willing to put in hundreds of hours learning how to do and make all of these things but i am unsure where to start, my C# skills are, to quite simply put it, bad and i want to be able to understand how each of these components work and be able to make them in my game effectively. If anyone who has knowledge on things such as procedural generations which allow for overhangs etc. and multiple biomes or can just point me in the right direction in terms of learning how to do everything i need to make this game then please leave a comment.

First, you’ll be happy to know that Fog will be the easiest part; it’s in Window≥ Lighting :slight_smile:

It sounds like you need experience in C#. You should do a few of the Unity tutorials (Unity Learn) to get experience with working in the engine.

I can’t stress this enough:
DO NOT, DO NOT make your first projects too big.

It is so easy to make the project grow into something you can’t handle. I first started off trying to make an open-world multiplayer version of Burning Rubber 5, and that didn’t go well for me, and the next 10 similar-sized projects I tried ended the same way: Either a rage-quit, terrible realization I’d need to rewrite every script because I didn’t write them well the 1st time, lack of interest, or a feeling that completing the project is impossible.

My advice is to do many small, unfinished projects for experience. Pick something you think you can’t do, then do it. I’ve done this so many times and each time you learn something new. Try making separate aspects of your game first, instead of trying to make it in 1 go. First get experience with C# in general, then try generating a cube world, try animating a cubed character, try making a health/damage system. But don’t try to make your first game a large project as you’ll quickly become frustrated.

So first get some C# experience before trying to make your own procedural generation system, specifically with stuff like arrays and lists and dictionaries and for and for each loops etc… That way you’ll be able to write code independently and actually understand code when you see scripts someone else wrote.

Okay thanks Droidify, i want to start learning and getting C# experience but i dont know when to start, i watched some tutorials on how to program basic movement mechanics using C# within unity but it felt like i was just copying the code and i didn’t really understand what i was doing, why i was doing it and why it had to be certain variables etc. do you have any recommendations for an absolute beginner at C# or methods of getting better other than setting a target and achieving it as it feels like i actually need some C# knowledge to do those things.

1 Like

Well, the extreme basics are simple, but aren’t always presented easily.

Here’s some things that should help you:

Variables: Variables are declared to hold data during runtime. To declare a variable, do this:
public int MyNumber;

For starters, you’ll mostly be using int, float, string, List, bool. Also, adding [ ] after a variable (for example, int[ ]) creates an array, which is a completely separate topic.
int: holds a number, for example:

int MyNumber=29;

However, it can NOT be a decimal, so 29.4 won’t work.
To have a decimal number, use a float, which will also do simple numbers.

In summary with int/float, you can write 487 with a int, but you can’t write 123.45. With a float, you can write both 487 and 123.45.

Functions: Ways of organizing stuff to do in code. To create a function, do this:

public void MyFunction()
{
    //do stuff here
    Debug.Log("MyFunction ran :smile:");
}

Unity has some special functions. As a beginner, you’ll use void Start() and void Update().
For example, if I write this:

void Start()
{
    Debug.Log("This ran on game start!");
}

As soon as the game starts you’ll see that message in the console. However, I can make it more complex:

public int MyNumber = 5;
public int MultiplyBy = 3;
void Start()
{
    Debug.Log("This ran on game start!");
    MultiplyNumbers(); //this will run this function when the game starts
}

void MultiplyNumbers()
{
    Debug.Log("The multiplied result is: " + MyNumber * MultiplyBy);
}

Meanwhile, void Update() happens every frame of the game.

That’s the basics and I could spend an hour writing about C# here, but that’s just a snapshot of how it works. Try writing something yourself; if you run into problems you can post a question on the Scripting section of the Unity forums and tag me (by typing @DroidifyDevs in the post so I’ll be notified). We’re all here to help! :smile:

Thank you @DroidifyDevs , I understand the basics about functions, for and while loops, if and else statements, arrays and classes but i still don’t know where to start making a procedural generated terrain similar to that of cube world.

There are a few of nice voxel plugin assets on the asset store for reasonable price that might help you get started. . I wouldn’t write a voxel engine from scratch unless you are pretty experienced. cubiquity Unity Asset Store - The Best Assets for Game Making is a nice one for terrains… but just search in the asset store for lots of options. …but as mentioned before, I’d start with several smaller projects and tutorials first. if you dont understand the tutorials yet, dont move on to a big game project. Start changing and messing about with the tutorials after you finish each one to get the understanding of how things work. Good luck !

I’ll agree with @JonPQ , voxel engines are really hard to make so it’s easier to use an asset, especially if you’re inexperienced. And if you can’t get it to work, don’t worry, do something easier first to get experience and then come back to it.

I was actually wondering if anyone would work on that also.

Also found this

tried it. it’s unoptimised code and quite slow to be any use as it is.

Bit of a shameless plug of my own product but if you have the cash you could try: Unity Asset Store - The Best Assets for Game Making

It’s made as an attempt to make minecraft worlds with as close to no coding as possible

Do you plan on implementing a minecraft-like lighting system? That’s what I’m interested in and I’ll buy it asap if it does.

Yeah thats already in there :slight_smile: Actually working on a lighting bug as we speak but yeah its got its own lighting system so if you go into caves its properly dark without using ambient tricks. It also mixes with Unity lighting so if you place a Unity light in there it will add its lighting on top of it