We need your help to make this the best terrain plugin for Godot.
Please see System Design to gain an understanding of how the system works. Then review the roadmap for priority of issues.
If you wish to take on a major component, it's best to join our discord and discuss your plans with Cory to make sure your efforts are aligned to other plans.
Make sure you are setup to build the plugin from source.
We use the standard Godot PR workflow. Please submit PRs according to the same process Godot uses.
In general, follow the Godot GDScript style guidelines. In addition:
- All variables and functions are static typed, with a colon then space (eg.
var state: int = 3
) - Auto static typing can be used only when the type is specifically assigned (eg.
var point := Vector2(1, 1)
) - Two blank lines between functions
- Similar to C++ below
- Private uniforms are prefaced with
_
and are hidden from the inspector and not accessible via set/get_shader_param()
In general, follow the Godot C++ style guidelines. In addition:
- One blank line between functions
- Everything braced - no if/for one-liners
- One line setters/getters can go in the header file
- Opening brace on the initial line (eg.
if (condition) {
), and ending brace at the same tab stop as the initial line - Private variables/functions prefaced with
_
- Private/public/protected explicit and grouped together in that order, in header and cpp files.
- Functions in h and cpp files in same order
- All code passed through clang-format. See below.
clang-format will adjust the style of your code to a consistent standard. Once you install it you can manually run it on all of your code to see or apply changes, and you can set it up to run automatically upon each commit.
- Download version 13 or later
- Make sure the LLVM binary directory where
clang-format
is stored gets added to thePATH
during installation - Linux/OSX: Install the
clang-format
package, or all ofLLVM
orclang
if your distribution doesn't provide the standalone tool - Windows: Download LLVM for Windows from https://releases.llvm.org/download.html
We use Godot's clang-format hooks that will format your code upon making a commit. Install the hooks into your repo after cloning.
- Copy
tools/hooks/*
into.git/hooks
or runpython tools/install-hooks.py
- View a formatted file, no changes on disk:
clang-format <filenames>
- See what changes would be made:
git-clang-format --diff <filenames>
- Change the files in place:
clang-format -i <filenames>