/godot-roguelite

Godot 4.1 GDExtension C++ game prototype

Primary LanguageC++MIT LicenseMIT

Godot 4.2 GDExtension C++ Prototype

This project is a rough prototype focusing on understanding how to implementa majority of a game's core logic/scripting in C++ using GDExtension. Everything is done in the code aside from UI/dialog/menu design, and scene file generation.

The current focus is aimed towards learning more about how certain features and funtionality can be implemented in native code leveraging the godot-cpp GDExtension bindings so there isn't much game logic implemented yet. Since the documentation is pretty sparse when it comes to pure native development, most of the functionality implemnted in this project is focused on providing a variety of general examples of misc functionality that others will likely find useful.

Game logic will become a focus when most of the essentials are figured out and implented throughout the project.

Overview

This project is meant to show others working with GDExtension how to:

  • structure a project
  • implement specific features and functionality entirely in C++
  • incorporate 3rd party libraries into their GDExtension code/library
  • use CMake, VCPKG, and submodules to configure the project automatically
  • configure VSCode (linux & windows) / Visual Studio 2022 (windows) for
    • good code navigation for godot engine sources, godot-cpp sources, and the gdextension project sources.
    • good autocomplete / intellisense configuration
    • preconfigured debugger launch profiles to run the project standalone or by launching the editor (both launch settings debuggable)
    • good debugger visualizations for internal godot data structures by leveraging the .natvis file provided with godot-cpp

High Level Project Structure

The project's main scene consists of a single Main node. The Main node is intended to handle all high level game management (level loading, scene swaps, saving, loading, UI, input handling, menus, signal propigation, etc)

The overall node hierarchy:

Main
├── Main Canvas Layer (reference to Canvas Layer in MainDialog)
├── MainDialog
│   ├── RichTextLabel (In-Game Console)
│   └── MainSubViewport (Primary Game Viewport)
│       └── Canvas Layer
├── Level
│    ├── Player
│    │   ├── (Scene)
│    │   ├── CharacterController
│    │   ├── Camera
│    │   └── FiringPoint (Marker2D)
│    └── Projectile Spawner
│        └── Projectile
Console (Singleton)
└── RichTextLabel (Reference from MainDialog)

Setup Guide

See the wiki for a detailed guide that will walk you through the steps required to get this project running and debugging on linux or windows.

Contributing

This repo and/or the gdextension developer documentation I recently started working on is open to anyone that wants to contribute. Feel free to submit PRs for any changes that implement new features, fix bugs, or improve upon any existing features, functionality, or design.

Additional Resources

The projects below are also worth checking out for some additional GDExtension examples to use as references

Licensing

Code

  • All code in this project is licensed as MIT

Assets