Archive 17/01/2023.

Yet another Minecraft wannabe

Tinimini

I know it’s sow last season to be copying minecraft, but I found this to be a great exercise as this kind of voxel block world has a lot of interesting stuff where I can cut my teeth on 3D programming. I’ve been fooling around with Unity and jMonkeyEngine before, but only recently found out about Urho3D.
As I said, I’m pretty new to 3D programming and it’s been nearly 20 years since I last wrote a line of C++ code, so this is pretty much a learning process for me all around.

Here’s a screenshot of what I have currently:

GoogleBot42

It looks good so far. :slight_smile: Do you use a single combined mesh for each “chunk” or are you using a mesh group for this? If you use a combined mesh you will get a lot better performance. :wink:

Tinimini

Thanks. It’s a single mesh per chunk. With only the outside facing faces of the cubes drawn.
I just got the lighting working. I just need to get the chunk borders to work properly, haven’t bothered to do anything about that yet. I’m currently in the middle of refactoring the code to make it a bit easier to move to a mutithreaded terrain generation/light calculation/mesh generation method.

Here’s some pics with the lighting. Using DiffUnlitVCol techinque (which is basically just DiffUnlit with vertexcolor defines added. Started to get those white cracks between cubes after starting to use texture atlases. Probably some artifacts caused by floating point imprecisions. Not sure what to do about those yet.
But next I think I’m going to start thinking about multithreading once I get the refactorings out of the way. And after that proper terrain generation.


Tinimini

Just finished the first round of restructuring. Most of the stuff (lighting, dynamic chunk loading etc) now stopped working as they don’t support the new structure yet, but it looks like the new data structure is much, much better than my old one. First of all, it solved my problem with the chunk boundaries. They are no longer rendered and I don’t really have to worry about taking them into account anymore.
And of course the simplified mesh improved the rendering speed and memory consumption quite a lot.
Here’s wireframe rendering shots before and after the restructuring.

Before:

After:

Hevedy

Nice work.
You will release something of the code or the project ?

Tinimini

Oh I’m most likely going to make this open source if it actually gets somewhere. I’m still just learning as I go and I don’t have too much time to use on this project, so I’m not quite there yet.

umen

Great work ,can you share from where you started , that is what are your references or example source code for you demo?

Teknologicus

@ Tinimini wrote

Using DiffUnlitVCol techinque (which is basically just DiffUnlit with vertexcolor defines added.

How would one implement a DiffUnlitVCol Technique? Can I do it with a custom Technique or to I have to create a custom shader? Could I please see your code for this?

Tinimini

Oh wow. Talk about a blast from the past :smile: I haven’t touched this project in years, but I did still manage to find the source code. It’s available here https://bitbucket.org/syvanpera/cubid/
I have no idea whether it even compiles anymore, but for what it’s worth, it’s all there.

Teknologicus

Awesome! Thank you! :smiley:

Teknologicus

I just wanted to say think you again. The Urho3D technique you wrote for vertex colors saved me so much (frustration?).

Tinimini

Nice! I’m glad this is of some use even if I never had the time to continue it.

TheBruhDude

Looks Good. I found this today and wondering if your going to make a pre-release soon for this copy of Minecraft. And what would it be called if you made a game out of it?

Teknologicus

@TheBruhDude at me or @Tinimini?

What I’m working on is showcased at https://discourse.urho3d.io/t/urho3d-cubic-voxel-surfaces .

I still have a ton of work to do before a pre-release. It’s still not even an actual game yet – right now it’s just a cubic voxel engine built on top of Urh3D. I haven’t decided on a name yet.

Modanung

@Teknologicus Have you considered what license to use?

Teknologicus

@Modanung I do plan on open-sourcing (MIT license) it at some point after trying to sell a game made with it.

Teknologicus

PS: I’ve also considered licensing the code to developers when it’s fully functional.