Skip to content

TinyTakinTeller/TakinGodotTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Takin - Godot Template

Godot 4.3 template for game projects (GDScript).

TODO: This template is a work in progress. (Full version in 2025.)

Preview Screenshots

⭐ Features

✨ Game

  • Foundation
    • 🖼️ Scene Manager - Custom transitions and loading screens.
    • 🎵 Audio Manager - Reliable music tracks and sound effects.
    • ⚙️ Configuration - Persistent game options and statistics in INI file.
    • 💾 Save Files - TODO: ...
  • Localization
  • Accessibility
    • 🎮 Controller Support - Grab focus for joypad and keyboard users.
    • 🔍 Smooth Font - Dynamic font size (keep aspect ratio) on window resize.
  • Experience
    • 🎨 Theme - TODO: ...
    • 🎶 Music & SFX - CC0 Public Domain: Kenny SFX and OGA Music (looped edit).
    • 📽️ Post-Processing - TODO: ...
  • UI/UX
    • 🎬 Boot Splash - The main scene, allowing custom transition to main menu.
    • 🏠 Main Menu - Display buttons to enter other menus, version and author.
    • 🔧 Options Menu - TODO: ...
    • 📜 Credits Menu - TODO: ...
    • 📓 Save Files Menu - TODO: ...
    • ⏸️ Pause Menu - TODO: ...

💫 Development

  • Singletons
    • 📢 Signal Bus - Observer pattern for cleaner global signals.
    • 📖 References - Map of preloaded resources for convenience.
  • Scripts
    • 🧰 Utility - RNG (Weighted Loot Table), Maths, Files, Nodes, Strings.
    • 🛠️ Objects - ActionHandler, ConfigStorage (INI File), LinkedMap.
  • Tools
  • Workflow
    • 🚀 Deployment - TODO: ...
    • Actions - Verify style and formatting in GDScript code on push to Github.

📂 File Structure

  • .github
    • docs
    • workflows
  • godot
    • addons (Plugins)
    • assets (.png, .mp3, .csv, .ttf, ...)
    • autoload (Globals)
    • resources (.tres, .gd)
    • scenes (.tscn, .gd)
    • scripts (static/const .gd)
    • shaders (.gdshader)
    • export_presets.cfg
    • gdlintrc
    • project.godot (ProjectSettings)
  • .gitattributes
  • .gitignore
  • LICENSE
  • README.md

📜 Conventions

  • Clean Code
    • Use snake_case for files, folders, variables, functions.
    • Use PascalCase for nodes, classes, enums, types.
    • Use typed variables and functions.
    • Use style inspired by GDScript Style (see gdlintrc).
    • Function definition order: override, public, private, static.
    • Consider using good design patterns when programming.
    • Consider maintaining enum values when appropriate.

🧩 Plugins

🔧 Editor

⚙️ Engine

  • Logger
    • The Log inspired by Log4J allows logging.
  • Scene Manager
  • Audio Manager
    • The Resonate addon handles music tracks and sound effects.
    • For a complex audio project, consider using FMOD or WWise.
  • Save Files
    • TODO: ...
  • Post-Processing
    • TODO: ...

🤖 Code

The Globals (autoload Scenes) and Scripts (statics, consts, objects) are available from anywhere in the project. The latter is independent of (not managed by) the Scene Tree.

Otherwise, Scenes must be loaded or added to the Scene Tree.

💎 Globals

  • Configuration
    • First autoload (after Plugin autoloads).
    • Configure Project, use ConfigStorage object for user config presistence.
  • Reference
    • Preloads & holds references to Resources in dictionary by name.
    • When creating a new Resource type, consider creating a getter here.
  • SignalBus
    • Exchange global signals for cleaner observer pattern.
  • Wrapper : Extend functionality without modifying the original.
    • AudioWrapper - Calls Resonance plugin with enums instead of string names.
    • SceneManagerWrapper - Calls SceneManager with options presets Resource.
    • TranslationServerWrapper - Extends localization to work in tool scripts.

🎬 Scenes

Scenes are split into component, node and scene folders.

  1. Component : Add as a child to extend functionality by composition.
  2. Node : Add as a standalone building block of a larger construction.
  3. Scene : Presentable collection of other scenes, nodes and components.
  • Component
    • Audio
      • ButtonAudio - Emits audio events on signals (focus, click, release).
      • SliderAudio - Emits audio events on signals (drag start, drag end).
    • Control
      • ControlGrabFocus - Grabs focus of node for controller support.
      • ControlResizeTextFont - Smooth text scaling with window resolution.
  • Node
    • Expand
      • HSliderExpand - Expands to fill the parent node (custom UI scaling).
    • Menu
      • MenuButton - Localized menu button.
      • MenuSlider - Localized menu slider with accessibility buttons.
      • MenuToggle - Localized menu toggle button (ON or OFF).
  • Scene
    • BootSplashScene (Main Scene) - Smooth transition to menu scene.
    • MenuScene - Manages menu scenes as children.
      • MainMenu - Display buttons to enter other menus or next scene.
      • OptionsMenu - Manages options (persistent app settings) scenes.
        • AudioOptions - Configure Music and SFX volume or mute.
        • VideoOptions - TODO: ...
        • ControlsOptions - TODO: ...
        • GameOptions - TODO: ...
      • CreditsMenu - TODO: ...
      • SaveFilesMenu - TODO: ...
    • PlayScene - TODO: ...
      • PauseMenu - TODO: ...

📄 Scripts

  • Const - Collections of commonly used constants.
  • Enum - Collections of organised values.
  • Object
    • ActionHandler - Implements the (light) command pattern design.
    • ConfigStorage - Persists (save & load) app settings in INI file.
    • LinkedMap - Dictionary data structure that tracks order of keys.
  • Util
    • FileSystemUtils - Robust functions to extract file paths and names.
    • MathUtils - Integer power function.
    • NodeUtils - Collection of node manipulation functions.
    • RandomUtils - Weighted Loot Table and random string functions.
    • StringUtils - String functions for validation and padding.

🎉 CI/CD

🚀 Deployment

  • Github Pages
    • TODO: ...
  • Itch.io
    • TODO: ...

✅ Workflows

  • quality_check.yml
    • Automatically check gdlintrc coding style standards.

⚡ Hacks

  • Web Export (Presets)
    • There is Godot 4.3 Issue with Boot Splash, workaround is CSS in Head Include.
    • There is Godot 4.3 Issue with play_stream, workaround was added for now.

📖 Instructions

📘 Get Started

❓ FAQ

  • Opening the project for the first time, I have errors/warnings?
    • Try (re)enable all Plugins and then select "Reload Current Project".

🫂 Contribute

  • Open a new Issue for discussion first, later Fork and open a pull request.

💕 Acknowledgements

About

Godot 4 template for game projects (GDScript).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published