Voxel world prototype made with Godot Engine

Voxel game demos (Godot Engine)

This project contains several scenes to test and demo the voxel module I'm developing for Godot Engine.

Screenshot

Dependencies

This project uses a C++ module:

For the old (unmaintained) pure-GDScript version, checkout the branch full_gdscript.

Runnable scenes

  • blocky_game/blocky_game.tscn: sort of Minecraft clone with random features.
  • blocky_terrain/main.tscn: simple test for blocky terrain
  • smooth_terrain/main.tscn: simple test for Transvoxel smooth terrain
Owner
Marc
I code and I sound.
Marc
Comments
  • Switching the demo to use Transvoxel

    Switching the demo to use Transvoxel

    I've been running the voxelgame demo project and messing around with it. This is awesome, thank you for publishing it!

    Is it possible for me to modify the demo to use smooth Transvoxel rendering? I've been poking around and have not been able to figure out how to do this.

  • Created fps demo

    Created fps demo

    Ok, it's done. This demo provides a playable character where you can shoot additive, negative, or bouncy balls. There are four scenes setup for blocky/heightmap, smooth/heightmap, blocky/custom stream, and LOD/3d noise.

    ~~It uses Godot's physics for collision and raycasting. So to use it as intended, it needs collision built into the terrain. However, the scenes run fine without the patch. Since there's gravity and no collision, you'll just fall through. I've left the Player/Jump_is_jetpack option as the default so you can fly.~~

    The demo lives in /fps_demo.

    These other files were changed:

    • project.godot - I set this demo as the main scene. I hope that's ok. I also added some values to the input map and disabled vsync due to this issue.
    • README.MD - Document all demos and add screen shots. Check it out here.
  • Not able to launch the game

    Not able to launch the game

    When I try to run your project in Godot I get the following error message:

    GLES3: max ubo light: 409
    GLES3: max ubo reflections: 455, ubo size: 144
    VoxelLibrary not set yet
    View distance changed from 8 blocks to 16
    ERROR: is_class_enabled: Condition ' !ti ' is true. returned: false
       At: core/class_db.cpp:1283.
    wtf class is disabled for: 4
    name: TestCube
    ERROR: is_class_enabled: Condition ' !ti ' is true. returned: false
       At: core/class_db.cpp:1283.
    wtf class is disabled for: 21
    name: TestCube
    ERROR: is_class_enabled: Condition ' !ti ' is true. returned: false
       At: core/class_db.cpp:1283.
    

    I compiled the Godot engine from source with the voxel and opensimplex modules. Do you know how to fix this?

  • ERROR: Cannot get class 'VoxelMesherBlocky' when running exported HelloVoxel.exe

    ERROR: Cannot get class 'VoxelMesherBlocky' when running exported HelloVoxel.exe

    In-editor play button works fine, I can play blockygame in debug mode.

    After running HelloVoxel.exe exported from this demo project, I encourtered these errors:

    ERROR: Cannot get class 'VoxelMesherBlocky'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'VoxelMesherBlocky'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'VoxelMesherBlocky'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'VoxelLibrary'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'VoxelLibrary'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'VoxelLibrary'.
       At: core/class_db.cpp:347
    ERROR: Cannot get class 'Voxel'.
       At: core/class_db.cpp:549
    ERROR: poll: res://blocky_game/blocks/voxel_library.tres:30 - Parse Error: Can't create sub resource of type: Voxel
       At: scene/resources/resource_format_text.cpp:499
    ...
    

    I built Godot myself and put voxel module in. I got these errors. Then I tried pre built Godot editor downloaded from https://github.com/Zylann/godot_voxel/actions , I still got these errors.

    I downloaded standard export templates (3.3.stable) from Godot official website. I also used them for 3.4.beta editor downloaded from godot_voxel/actions, because I guess there is no breaking changes on export templates.

    I'm pretty new to Godot community and pretty new to cpp development. I guess I should have configured some include path, I don't know. Forgive me if this young and naive problem bothers you.

  • I really, really need to update this repo

    I really, really need to update this repo

    My local version works but is a big mess of testing stuff. Been too busy on the module itself. Meanwhile you can use tinman's fork: https://github.com/tinmanjuggernaut/voxelgame

  • Screenshots

    Screenshots

    This is less of a issue and more of a question but do you have/know the version this screenshot was taken in? I would like to use this kind of world in a project I am making.

    Thanks.

    2016_04_27_2037_half

  • nonexistent function get_voxel_index_from_name(vname)

    nonexistent function get_voxel_index_from_name(vname)

    OS Ubuntu Studio 20.04 Godot 3.2.2 Prebuild binary rc+cd8d43_x11.64

    i just run this scene blocky_game.tscn as main scene and i got this error :

    nonexistent function get_voxel_index_from_name(vname) in base voxel library

    blocks.gd / func _create_block(params: Dictionary): / line 199 -> var id = _voxel_library.get_voxel_index_from_name(vname)

  • Organize files into subdirectories

    Organize files into subdirectories

    I noticed that every single file used for this game is stored right next to project.godot in the project/ folder. A lack of organization does not scale well if you intend to make the game bigger.

    Possible solutions include:

    • Move terrain, heightmap, voxel, etc files to a "terrain" folder.

    • Move character, player, avatar, mouse, etc files to a "player" folder.

  • Blocky_game: terrain does not render with latest stable build in Windows

    Blocky_game: terrain does not render with latest stable build in Windows

    This happens even if you add the missing VoxelViewer to the CharacterAvatar.

    When running the game I do see the GUI and the sky, but no terrain. The number of streaming tasks begins to climb rapidly and never stops, unless I press the space bar in which case it drops back to zero.

    If it helps, I am able to run test_generator and a small portion of terrain is generated and shown.

    I'm using the Windows build that was just recommended here: #77 (comment)

  • blocky_game not working because of debug info

    blocky_game not working because of debug info

    Hi!

    The blocky_game scene fails when it tries to print debug information. The problem is the code.

    	var stats = _terrain.get_statistics()
    	for i in len(stats.stream.remaining_blocks_per_thread):
    

    Taking a look to VoxelTerrain API:

    Dictionary VoxelTerrain::get_statistics() const {
    ...
    

    the stats info format returned is a dictionary, not the format used in the gdscript.

  • Updates scenes for new API

    Updates scenes for new API

    Blocky Terrain

    Works

    GDScript stats had to be commented out:

    "\nProvider: ", stats.provider.remaining_blocks, \
    "\nUpdater (thread): ", stats.updater.remaining_blocks, \
    
    

    DMC Terrain (smooth)

    Works

    DMC Test (cube w/ blue sphere)

    Works

    Transvoxel

    Scene opens, but does not run because of OsnNoise not migrated to opensimplexnoise. Does not work in the old API either. Can be addressed in a different PR.

    New scene

    New scene using a voxelterrain from both a noise map, or using opensimplexnoise work.

    Notes

    • get_statistics() in C++ still has provider as a dictionary element.
    • VoxelTerrain in Godot has a member called Provider. Are these intended to be left? If changed, they might need another update here.

    fixes #62

  • How would you add large structures to it?

    How would you add large structures to it?

    Is there a simple way to add larger cube-based structures to it? So far I could only insert them with the same proportions as a regular cube on the demo. Is there a built-in way to scale? If not, how would one go from a large mesh to an instantiated structure on the voxel library with the correct scale?

  • Cant modify terrain after some move from center?

    Cant modify terrain after some move from center?

    Hello @Zylann, i use latest windows build from Master builds (editor only) and latest voxel game demo (https://github.com/Zylann/voxelgame)

    Here is problem: 2020-11-10-19-35-21

    After moving from some center i cant build terrain...

  • blocky_game: VoxelTerrain supports only stream channels

    blocky_game: VoxelTerrain supports only stream channels "Type" or "Sdf", but 'get_used_channels_mask()' tells it's providing none of these.

    Node configuration warning: VoxelTerrain supports only stream channels "Type" or "Sdf", but 'get_used_channels_mask()' tells it's providing none of these.

    Terrain does not render in editor or when game is run. (Not sure if this is related, maybe needs separate issue.)

    To clarify, I'm running the latest build on Windows 10. The smooth terrain demo works just fine.

  • OSX build errors (branch deps?)

    OSX build errors (branch deps?)

    The README.md and 02_build-voxel-tools.md says to build godot_voxel module with same branch as godot. However, godot master is now 4.0 I believe. I built godot branch 3.2 and ran the executable on some sample projects without problems. All good. I then moved godot_voxel into modules/, renaming to modules/voxel/, and tried to build and get errors:

    Christophers-iMac:godot christopherpaulicka$ scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
    scons: Reading SConscript files ...
    Building for macOS 10.9+, platform x86-64.
    Checking for C header file mntent.h... (cached) no
    scons: done reading SConscript files.
    scons: Building targets ...
    [ 33%] Compiling ==> modules/voxel/streams/voxel_block_serializer.cpp
    [ 33%] Compiling ==> modules/voxel/generators/graph/voxel_graph_runtime.cpp
    [ 33%] Compiling ==> modules/voxel/terrain/voxel_lod_terrain.cpp
    [ 33%] Compiling ==> modules/voxel/terrain/voxel_map.cpp
    modules/voxel/streams/voxel_block_serializer.cpp:101:21: error: conversion from
          'const size_t' (aka 'const unsigned long') to 'const Variant' is ambiguous
                                            .format(varray(metadata_size, (i...
                                                           ^~~~~~~~~~~~~
    ./core/error_macros.h:314:115: note: expanded from macro 'CRASH_COND_MSG'
      ..."FATAL: Condition \"" _STR(m_cond) "\" is true.", DEBUG_STR(m_msg)); \
                                                                     ^~~~~
    ./core/error_macros.h:116:26: note: expanded from macro 'DEBUG_STR'
    #define DEBUG_STR(m_msg) m_msg
                             ^~~~~
    ./core/variant.h:251:2: note: candidate constructor
            Variant(bool p_bool);
            ^
    ./core/variant.h:252:2: note: candidate constructor
            Variant(signed int p_int); // real one
            ^
    ./core/variant.h:253:2: note: candidate constructor
            Variant(unsigned int p_int);
            ^
    ./core/variant.h:259:2: note: candidate constructor
            Variant(signed short p_short); // real one
            ^
    ./core/variant.h:260:2: note: candidate constructor
            Variant(unsigned short p_short);
            ^
    ./core/variant.h:261:2: note: candidate constructor
            Variant(signed char p_char); // real one
            ^
    ./core/variant.h:262:2: note: candidate constructor
            Variant(unsigned char p_char);
            ^
    ./core/variant.h:263:2: note: candidate constructor
            Variant(int64_t p_int); // real one
            ^
    ./core/variant.h:264:2: note: candidate constructor
            Variant(uint64_t p_int);
            ^
    ./core/variant.h:265:2: note: candidate constructor
            Variant(float p_float);
            ^
    ./core/variant.h:266:2: note: candidate constructor
            Variant(double p_double);
            ^
    1 error generated.
    scons: *** [modules/voxel/streams/voxel_block_serializer.osx.tools.x86_64.o] Error 1
    modules/voxel/generators/graph/voxel_graph_runtime.cpp:477:40: error: 
          conversion from 'unsigned long' to 'const Variant' is ambiguous
      ....format(varray(_program.size() * sizeof(float), _memory.size() * sizeof(...
                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    modules/voxel/generators/graph/../../util/macros.h:10:14: note: expanded from
          macro 'PRINT_VERBOSE'
                    print_line(msg);                            \
                               ^~~
    ./core/variant.h:251:2: note: candidate constructor
            Variant(bool p_bool);
            ^
    ./core/variant.h:252:2: note: candidate constructor
            Variant(signed int p_int); // real one
            ^
    ./core/variant.h:253:2: note: candidate constructor
            Variant(unsigned int p_int);
            ^
    ./core/variant.h:259:2: note: candidate constructor
            Variant(signed short p_short); // real one
            ^
    ./core/variant.h:260:2: note: candidate constructor
            Variant(unsigned short p_short);
            ^
    ./core/variant.h:261:2: note: candidate constructor
            Variant(signed char p_char); // real one
            ^
    ./core/variant.h:262:2: note: candidate constructor
            Variant(unsigned char p_char);
            ^
    ./core/variant.h:263:2: note: candidate constructor
            Variant(int64_t p_int); // real one
            ^
    ./core/variant.h:264:2: note: candidate constructor
            Variant(uint64_t p_int);
            ^
    ./core/variant.h:265:2: note: candidate constructor
            Variant(float p_float);
            ^
    ./core/variant.h:266:2: note: candidate constructor
            Variant(double p_double);
            ^
    1 error generated.
    scons: *** [modules/voxel/generators/graph/voxel_graph_runtime.osx.tools.x86_64.o] Error 1
    scons: building terminated because of errors.
    

    I tried building from godot master, but that didn't work either.

    Any thoughts?

2D virtual tabletop prototype
2D virtual tabletop prototype

Mirkwood Engine ?? A prototype of a virtual tabletop written in Go 1.16 and Ebiten 2 (The gif can seems a bit laggy but the animations are smooth in r

Sep 28, 2021
A simple chess engine for experiment, made in Golang

chess-engine A simple chess engine for experiment, made in Golang Build the engine Run the command make or make build Run the engine Run the command f

Dec 26, 2021
Snake game made in Go! 🐍
Snake game made in Go! 🐍

Snake This is a Terminal based snake game made by tristangoossens. Please star this repository to help my first big project grow! Documentation can be

Nov 16, 2022
Minecraft server made in go, faster and better!

ElytraGo Minecraft server made in go, faster and better! Project is in early stage, but I'm trying continuously update it with new lines of code :)) L

Dec 9, 2022
Tetra3D is a 3D software renderer written in Go and Ebiten and made for games.
Tetra3D is a 3D software renderer written in Go and Ebiten and made for games.

Tetra3D Tetra3D Docs Support If you want to support development, feel free to check out my itch.io / Steam / Patreon. I also have a Discord server her

Dec 20, 2022
A simple breakout game made in Ebiten
A simple breakout game made in Ebiten

Ebiten Breakout Play online on itch.io A simple breakout game made in Ebiten. This is my first game made with Ebiten - a nice simple engine which allo

Nov 23, 2022
Simple 2D-grid game made with Ebiten
Simple 2D-grid game made with Ebiten

Simple 2D-grid game made with Ebiten

Mar 15, 2022
GuessTheNum - Guessing game made using GO
GuessTheNum - Guessing game made using GO

Guess The Number Guess the number is a guessing game made with the Go programmin

Aug 21, 2022
Librebird - A text based bird game made in Go

librebird a text based bird game made in Go, please contribute to the adventures

Feb 19, 2022
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022
Go 3D Game Engine
Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

Jan 9, 2023
Scalable Distributed Game Server Engine with Hot Swapping in Golang
Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Dec 25, 2022
A pure Go game engine
A pure Go game engine

Oak A pure Go game engine Table of Contents Installation Motivation Features Support Quick Start Implementation and Examples Finished Games Installati

Jan 8, 2023
Terminal-based game engine for Go, built on top of Termbox
Terminal-based game engine for Go, built on top of Termbox

Termloop Termloop is a pure Go game engine for the terminal, built on top of the excellent Termbox. It provides a simple render loop for building game

Dec 29, 2022
Tile is a 2D grid engine, built with data and cache friendly ways, includes pathfinding and observers.
Tile is a 2D grid engine, built with data and cache friendly ways, includes pathfinding and observers.

Tile: Data-Oriented 2D Grid Engine This repository contains a 2D tile map engine which is built with data and cache friendly ways. My main goal here i

Dec 26, 2022
A chess engine written in golang
A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

Dec 30, 2022
A 2D ARPG game engine.
A 2D ARPG game engine.

Abyss Engine is an ARPG game engine in the same vein of the 2000's games, and supports playing games similar to Diablo 2. The engine is written in golang and is cross platform. This engine does not ship with game specific files, and will require a game's assets in order to run.

Dec 24, 2022
A small fantasy game engine in WASM using GoLang
A small fantasy game engine in WASM using GoLang

The GoLang Fantasy Engine (GoLF Engine) is a retro game engine. It draws inspiration from fantasy console projects like pico-8, tic-80, and pyxle. Like those projects it is designed to be a retro-feeling game creation/playing tool. Unlike those projects GoLF is more minimal in scope and only provides an API and a small set of tools to help you create your games. Tools like an image editor and code editor are not built in. Despite this minimalism creating games in GoLF is still easy and should still maintain the retro game feel.

Jul 16, 2022
Currently in beta testing. A chess engine written in golang
Currently in beta testing. A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

Dec 30, 2022