Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Voxel Game Demo

An asset by Godot Engine
The page banner background of a mountain and forest
Voxel Game Demo thumbnail image
Voxel Game Demo thumbnail image
Voxel Game Demo hero image

Quick Information

0 ratings
Voxel Game Demo icon image
Godot Engine
Voxel Game Demo

This demo is a minimal first-person voxel game, inspired by others such as Minecraft.How it works:Each chunk is a StaticBody3D with each block having its own CollisionShape3D for collisions. The meshes are created using SurfaceTool which allows specifying vertices, triangles, and UV coordinates for constructing a mesh.See documentation for procedural geometry generation: https://docs.godotengine.org/en/stable/tutorials/3d/procedural_geometry/index.htmlThe chunks and chunk data are stored in dictionaries. New chunks have their meshes drawn in separate Threads but generating the collisions is done in the main thread, since Godot does not support changing physics objects in a separate thread. There are two terrain types, random blocks and flat grass. A more complex terrain generator is out-of-scope for this demo project.See documentation for more information on using multiple threads: https://docs.godotengine.org/en/stable/tutorials/performance/using_multiple_threads.htmlThe player can place and break blocks using the RayCast3D node attached to the camera. It uses the collision information to figure out the block position and change the block data. You can switch the active block using the brackets or with the middle mouse button.There is a settings menu for render distance and toggling the fog. Settings are stored inside of an AutoLoad singleton called "Settings": https://docs.godotengine.org/en/latest/getting_started/step_by_step/singletons_autoload.htmlThis class will automatically save settings, and load them when the game opens, by using the File class.Sticking to GDScript and the built-in Godot tools, as this demo does, can be limiting. If you are making your own voxel game, you should probably use Zylann's voxel module instead: https://github.com/Zylann/godot_voxelLanguage: GDScriptRenderer: Forward+

Supported Engine Version
4.2
Version String
4.2-31d1c0c
License Version
MIT
Support Level
featured
Modified Date
1 year ago
Git URL
Issue URL

Voxel Game

This demo is a minimal first-person voxel game, inspired by others such as Minecraft.

Language: GDScript

Renderer: GLES 2

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/676

How does it work?

Each chunk is a StaticBody with each block having its own CollisionShape for collisions. The meshes are created using SurfaceTool which allows specifying vertices, triangles, and UV coordinates for constructing a mesh.

The chunks and chunk data are stored in Dictionary objects. New chunks have their meshes drawn in separate Threads, but generating the collisions is done in the main thread, since Godot does not support changing physics objects in a separate thread. There are two terrain types, random blocks and flat grass. A more complex terrain generator is out-of-scope for this demo project.

The player can place and break blocks using the RayCast node attached to the camera. It uses the collision information to figure out the block position and change the block data. You can switch the active block using the brackets or with the middle mouse button.

There is a settings menu for render distance and toggling the fog. Settings are stored inside of an AutoLoad singleton called "Settings". This class will automatically save settings, and load them when the game opens, by using the File class.

Sticking to GDScript and the built-in Godot tools, as this demo does, is quite limiting. If you are making your own voxel game, you should probably use Zylann's voxel module instead: https://github.com/Zylann/godot_voxel

Screenshots

README Screenshot

README Screenshot

Licenses

Textures are from Minetest. Copyright © 2010-2018 Minetest contributors, CC BY-SA 3.0 Unported (Attribution-ShareAlike) http://creativecommons.org/licenses/by-sa/3.0/

Font is "TinyUnicode" by DuffsDevice. Copyright © DuffsDevice, CC-BY (Attribution) http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=468

This demo is a minimal first-person voxel game, inspired by others such as Minecraft.

How it works:

Each chunk is a StaticBody3D with each block having its own CollisionShape3D for collisions. The meshes are created using SurfaceTool which allows specifying vertices, triangles, and UV coordinates for constructing a mesh.
See documentation for procedural geometry generation: https://docs.godotengine.org/en/stable/tutorials/3d/procedural_geometry/index.html

The chunks and chunk data are stored in dictionaries. New chunks have their meshes drawn in separate Threads but generating the collisions is done in the main thread, since Godot does not support changing physics objects in a separate thread. There are two terrain types, random blocks and flat grass. A more complex terrain generator is out-of-scope for this demo project.
See documentation for more information on using multiple threads: https://docs.godotengine.org/en/stable/tutorials/performance/using_multiple_threads.html

The player can place and break blocks using the RayCast3D node attached to the camera. It uses the collision information to figure out the block position and change the block data. You can switch the active block using the brackets or with the middle mouse button.

There is a settings menu for render distance and toggling the fog. Settings are stored inside of an AutoLoad singleton called "Settings": https://docs.godotengine.org/en/latest/getting_started/step_by_step/singletons_autoload.html
This class will automatically save settings, and load them when the game opens, by using the File class.

Sticking to GDScript and the built-in Godot tools, as this demo does, can be limiting. If you are making your own voxel game, you should probably use Zylann's voxel module instead: https://github.com/Zylann/godot_voxel

Language: GDScript

Renderer: Forward+

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Voxel Game Demo icon image
Godot Engine
Voxel Game Demo

This demo is a minimal first-person voxel game, inspired by others such as Minecraft.How it works:Each chunk is a StaticBody3D with each block having its own CollisionShape3D for collisions. The meshes are created using SurfaceTool which allows specifying vertices, triangles, and UV coordinates for constructing a mesh.See documentation for procedural geometry generation: https://docs.godotengine.org/en/stable/tutorials/3d/procedural_geometry/index.htmlThe chunks and chunk data are stored in dictionaries. New chunks have their meshes drawn in separate Threads but generating the collisions is done in the main thread, since Godot does not support changing physics objects in a separate thread. There are two terrain types, random blocks and flat grass. A more complex terrain generator is out-of-scope for this demo project.See documentation for more information on using multiple threads: https://docs.godotengine.org/en/stable/tutorials/performance/using_multiple_threads.htmlThe player can place and break blocks using the RayCast3D node attached to the camera. It uses the collision information to figure out the block position and change the block data. You can switch the active block using the brackets or with the middle mouse button.There is a settings menu for render distance and toggling the fog. Settings are stored inside of an AutoLoad singleton called "Settings": https://docs.godotengine.org/en/latest/getting_started/step_by_step/singletons_autoload.htmlThis class will automatically save settings, and load them when the game opens, by using the File class.Sticking to GDScript and the built-in Godot tools, as this demo does, can be limiting. If you are making your own voxel game, you should probably use Zylann's voxel module instead: https://github.com/Zylann/godot_voxelLanguage: GDScriptRenderer: Forward+

Supported Engine Version
4.2
Version String
4.2-31d1c0c
License Version
MIT
Support Level
featured
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers