Skip to content

Template repository for building the godot engine v4.4+ with a gdextension project and automated exported builds.

License

comfyjase/godot-project-template

Repository files navigation

Godot Project Template

This repository serves as a quickstart template for game development with Godot 4.4+ using GDExtension.

๐ŸŽฎ Build & Export Game

Screenshot of a project open in the godot editor with a sprite on screen.

Godot C++ GDExtension tutorial implemented in the project.

Features

  • Setup Script - download and install prerequisites.
  • Visual Studio Solution File - generate a visual studio sln file with separate project files for the godot engine and the game GDExtension project.
  • Visual Studio Platforms - android (defaults to arm64 but this can be changed), linux (WSL), web, win32, and win64.
  • Configurations - editor, editor_game, development, template_debug, template_release, profile and production.
  • Project - setup using the gdextension_cpp_example godot tutorial.
  • Engine Submodules - godot and godot-cpp as submodules (tracking the respective 4.4 branches).
  • GitHub Bug Report Template - issues template (.github/ISSUE_TEMPLATE.yml) for bug reports.
  • Continuous Integration - CI scripts to build and export the game for different platforms and configurations.
  • Generate GDExtension Documentation - automatically generate .xml files in a doc_classes/ directory to be parsed by Godot as GDExtension built-in documentation
  • GDExtension Plugins - additional GDExtension plugins to demonstrate developing areas of the codebase as separate plugins linked to the main game project - see core and gdextension_cpp_example.
  • Core Plugin - helpful C++ macros to be reused across other plugins and in the main game project.
  • GDExtension Doctest Support - support for writing and running doctest unit tests from GDExtension code - see doctest_runner, test_custom_sprite.h and run_unit_tests.py.
  • ImGui - Uses imgui-godot to provide runtime debug menus if you implement void draw_debug(); in your node class - see custom_sprite.cpp.
  • Tools - toolbox app to support project development - includes build downloader/exporter, commit checker and maintanence apps.

Project Structure

engine
	- godot
	- godot-cpp
project
	- plugins (game project plugins)
		- core (C++ helper macros)
		- doctest_runner (doctest unit test runner node + macros)
			- doctest_runner.h/.cpp (manages children doctest nodes and quits once they are all finished)
			- doctest_runner_macros.h (macros to declare and implement nodes in other GDExtension code)
		- gdextension_cpp_example
			- custom_sprite.h/.cpp
			- gdextension_cpp_example_doctest_node.h/.cpp (doctest node for this plugin to be placed in test.tscn)
			- test_custom_sprite.h (example doctest unit test implementation for custom_sprite.h)
	- scenes
		- test.tscn (includes doctest_runner node + children doctest nodes)
		- debug.tscn (includes build information + stats)
		- main.tscn (includes debug.tscn and moving custom sprite)
	- src (game GDExtension code)
thirdparty
	- emsdk (used for web platform)
	- imgui (used for runtime debug)
	- rcedit (used for windows builds)
game.sln (can build code in Visual Studio Community after generate_project_files.py finishes)

Visual Studio Solution File

Screenshot of two projects in Visual Studio Community solution: game and godot Screenshot of the solution platforms Screenshot of the solution configurations
This is generated using scons (makes an NMake project) and has been tested with Visual Studio Community 2022.

Configuration Description Debug Symbols
editor Builds the godot editor and game and opens the game project for editing. โœ…
editor_game Builds the godot editor and game and then runs the game project. โœ…
development Builds the game project and hot reloads the game and plugins GDExtension code whilst the editor is running. โœ…
template_debug Builds the godot editor and the game project intended to be attached to a running template_debug build of the game. โœ…
template_release Same as above but with template_release instead. โŒ
profile Same as above but for profile which uses production=yes and debug_symbols=yes. โœ…
production Same as above but for production which uses production=yes โŒ

Note

Debugging C++ in Visual Studio Community isn't available when running for web and android.

Below are some examples of running different platforms/configurations from the visual studio solution. The gifs are sped up for brevity.

Editor

Windows

Gif of visual studio building and running godot game engine and opening the example project.

Editor Game

Windows

Gif of visual studio building and running the example project.

Web

Gif of visual studio building and running the example project for web.

Android

Gif of visual studio building the example project for android. Gif of the example project running on an android phone.

Tools

Screenshot of an python app named toolbox with a toolbox icon and three buttons: builds, commit checker and maintanence.

Note

These tools are implemented using python scripts but have only been tested properly on Windows OS - with some work they should be able to be cross-platform friendly.

Builds

Gif of a user selecting two different builds in a list and then downloading them to a local binary folder. Gif of a user choosing a windows template_debug build and then exporting the project for that configuration. Provides a list of the saved game builds from the github actions artifacts and allows users to download them to a specified folder. Also provides a way to export builds of the game locally.

Commit Checker

Gif of an app with multiple checkboxes for different platforms and configurations, user selects android production and clicks on a run checklist button. Image of an app that will let users write a commit title, description and see what changed files they have as well as a list of open issues they can link the commit to. Provides a way to compile for a different platform and configuration locally and then runs unit tests and reports if these are successful or not. Also provides a way to write commit messages and link them with specific GitHub issues with the option to automatically resolve an issue once the commit is pushed.

Maintanence

Screenshot of an python app named maintanence which lists workflows from the github repo and allows the user to select and delete them. Provides a list of github workflows and allows the user to select one or multiple and delete them. I created this to help manage some of the GitHub actions/storage limits I was hitting with private repos and this is faster than having to scroll through each github workflow and manually delete it from there. Not really intended for wider use but might help some users manage their GitHub limits.

About

Template repository for building the godot engine v4.4+ with a gdextension project and automated exported builds.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published