https://rainlizard.itch.io/another-mc-clone It's only the basics, no actual content. This was for the most part a learning experience, I learned a lot about 3D and was very interested in getting to know the speed of GDScript. Much better performance is already covered by Zylann's C++ voxel module which you should use if you're interested in making a game like this.

Do you have any images or video you can post? I'm not on Windows.

Added screenshots although to be honest it's not much to look at. You can open source in godot and hit F5 to run it on your operating system.

Righto. Nice job. Just tried on my machine, getting well over 900 fps on a 2080 Ti. Performance seems very good considering all the objects and the light/shadow. Did you do any specific optimizations (sorry, haven't looked at the code yet)?

Thank you! for the feedback.

I was going to say the lighting shouldn't make much of a difference but wow I didn't even realize, when I disable the lighting the fps on my PC went from 465fps -> 1312fps. So thanks for the heads up, I probably should have paid more attention to the lighting settings, haha.

As for the amount of objects, there isn't many. Each chunk (16x256x16 cubes) is its own node, containing arrays for its voxel values, ArrayMesh data and a generated mesh attached to it. This is fairly typical stuff for every voxel engine or minecraft clone.

When the player and game are sitting idle, other than lighting what takes up the performance is the amount of vertices being rendered, which is entirely dependent on the graphics card which is why your 2080 Ti handles it well. Smaller/larger view distances make the biggest difference here.

As for chunks being generated; GDScript is totally SAVED by multi-threading. It's an incredibly powerful feature of Godot, without it the game was terribly laggy even while doing "yield idle_frame". Thanks to multi-threading it doesn't matter what you throw at GDScript, it will still run the game smoothly. The thread will simply take a longer period of time to produce a result (the more you give it to do). I'm really happy I learnt how to do multi-threading from this experience.

This project does have a massive downside though, turn on "caves" option and the chunks will take just a little bit too long to generate in my opinion. This is not good enough so I accepted defeat here.

1.01 update -changed Sun shadows to orthogonal, doesn't look too different and increases performance by 40%, lmao -added option to disable lighting for big FPS

Could have added a shadow quality setting but disabling is good enough for this simple project.

13 days later

Wow, this is amazing. How long have you programmed for and how long in Godot? I'm nowhere near this good. But I am wondering how long it might take me to reach this point.

Thanks! The project's probably not very readable since in a few areas I prioritized optimization instead of making an open source project that could actually be useful to others.

I used a program called Megazeux for about 4 years when I was very young, then later switched to Game Maker, using it on and off for 8 years while taking a few year long breaks. I don't have much to show for it, Megazeux is ancient DOS ASCII stuff and I only completed a few Ludum Dare games in GM. The action RPG roguelite I've been working on in GM is still in development at about 95% completion but instead I've been neglecting it and screwing around with Godot for the past year. (someone kill me for not just finishing it)

The first thing I got working in Godot was this crummy drawing example, which helped me grasp classes and how to understand the help file.

Then I made this Dungeon Keeper Warped Walls project, which this Minecraft project stands upon. The cubes it places are blender models, so for the mincraft project I had to learn how to build a cube in Godot from scratch so I could do proper culling. This post by Zylann was the starting point, the first cube.

I truly wracked my brain working on this for 2 months (+ an extra month for polish), it was the most complicated thing I've done. Now that I've done it, it all seems fairly simple in hindsight, funny how that always goes. I've been working on figuring out how to do online multiplayer in Godot and I suspect the same thing is occurring with it being complicated but will probably soon enough turn out to be quite simple. If you want to be a better programmer you really need to just jump in the deep end, watching tutorials and searching forums/github/discord/helpfile/google etc. Learning has a backwards difficulty curve going from hard -> easy, so it's comforting to remember that every concept gets easier the more you expose yourself to it.

@rainlizard said: The action RPG roguelite I've been working on in GM is still in development at about 95% completion but instead I've been neglecting it and screwing around with Godot for the past year. (someone kill me for not just finishing it)

  • Insert symbolic sacrificial offering here
5 days later

@rainlizard thank you so much , I always wanted to understand how to implement Voxel world rendering, and you really helped with that

a year later

@rainlizard How have you licensed it?, could i modify it (heavily) and use it as a base for my own game (i may want to sell my game) or is that not possible?

I haven't found any License anywhere so i think you didn't license it at all.

@chibbi
You are free to use it for anything without credit, even the textures.

However I don't recommend it. I made it while intentionally constricting myself to GDScript-only, which is not how you should go about programming in Godot. You should blend GDScript with C# (or C++) for the performance expensive things.

I believe Zylann's Voxel Tools are made for your use-case, definitely check it out:

If you still want to use mine then just a warning, when Godot 4.0 is released I think a few GDScript things in the project might need rewriting such as the PoolArrays: https://godotengine.org/article/core-refactoring-progress-report-1 I don't know exactly what though.

Off topic: I finished that GameMaker roguelite I mentioned earlier in the thread (0.99 is out, will be releasing 1.00 shortly). https://rainlizard.itch.io/slautios I'll be able to fully move on to Godot very soon.

@rainlizard jeah so i didn't think you'd answer so fast xD, and somewhere in this thread you already mentioned Zylann's Voxel Tool, and i started to play around with that. But his stuff needs documentation, so i will probably just wait a bit until his doesn't have TODO written everywhere. I think i won't use your game, and use Zylann's tools when i won't have to open his source code, to find out how that stuff works (i may do that, but theoretically i don't have the time to get another project i my head).

3 months later

1.02 update -Chunk generation speed improved by about 30%

I noticed I was appending PoolArrays while building each face of a cube, which is quite slow. I've switched to appending normal arrays, the PoolArrays are now only set once after the chunk finishes generating. It's still bad speed but I'll continue to keep this project as an example of what pure GDScript is capable of.

According to this person GDScript is 9 times slower than Java, which was used to make Minecraft.