Level Editor Plugin for Godot
This is a Plugi-in I made for the Godot Game Engine. It is a in-editor voxel editor plugin.
- Multiple Brush Sizes
- Backface Culling for optimization and inidividual face drawing
- Robust chunk system for loading/unloading chunks
- multi-threaded chunk loading/unloading based on player position
- Object/Block separation. This plugin understands blocks as individual faces, whilst objects as scenes that can be instanced
- Object Rotation
- All the textures are in one big atlas to optimize draw calls. The atlas textures also support texture separation.
- It supports low and high res textureses
- on the fly chunk creation and deletion.
- and to move the cursor Up and Down (changing layers)
- and to rotate objects (currently blocks cannot be rotated)
- to place blocks
- <shift + left mouse click> to remove blocks
- Copy the addons folder into your project
- Enable the plugin
- Make a new scene. The root should be spatial3D, and must have the world_voxel.gd script in it
- Make a child of this node called "Chunks", also spatial3D. Put the chunk_parent.gd script in it.
- You should now be good to go. To add blocks, go to block_types.gd script and follow the instructions. same for objects. The instructions on the texture setup and such should be there.
- To change texture sizes, tile sizes, or set separation between textures, modify the constants in chunk.gd
- You may need to restart the editor for it to work. that's how godot plugins function for some reason.
- This template is using the atlas_texture_material material. Changing it will change your atlas texture. The image used for it is the atlas_texture.png under the textures folder.
- if you change your material, don't forget to also change its settings in chunk.gd. There, you can set: your atlas image size, your tile size, and also the separation between tiles. That way the code will know how to separate the textures in the atlas , and will draw your tiles accordingly
- All of the project is commented and you can modify it to fit your needs.
##5 Known Issues:
- Saving the scene takes long - The Godot Editor always give a "bad comparison function; sorting will be broken" error
- There's an example scene into the project, called world.tscn. It has a camera, a functional player and a scene all set up
If you have any questions, feel free to ask!