Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/docs/CICD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

- Back to [🤖 Code](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/CODE.md) of the project.

- See [⚡ Hacks](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/HACKS.md) of the project.



## 🎉 CI/CD


### 🚀 Deployment

- **Itch.io**
- Project uses `release_master.yml` to automate uploads to [itch.io](https://itch.io/) page.
- You can **disable** this by deleting the mentioned file.
- You can **enable** this by doing the following:
1. Generate new API key in Itch settings, setup `BUTLER_API_KEY` secret in Github.
2. Create a new game project page on Itch.
3. Setup `ITCHIO_GAME` and `ITCHIO_USERNAME` secrets in Github.

### ✅ Workflows

- **quality_check.yml**
- Automatically check [*gdlintrc*](https://github.com/Scony/godot-gdscript-toolkit/wiki/3.-Linter#tweaking-default-check-settings) coding style standards.
114 changes: 114 additions & 0 deletions .github/docs/CODE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

Back to [🧩 Plugins](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/PLUGINS.md) of the project.

See [🎉 CI/CD](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/CICD.md) of the project.



## 🤖 Code


Globals (autoload Scenes) act as singletons.

Scripts (statics, consts, objects) act as utility.

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

### 💎 Globals

- **Configuration**
- Configurations use ConfigStorage object for presistence in INI files.
- Audio, Video, Controls, Game configurations are tied to the options menu UI.
- **Data**
- Use as setter and getter of save file data, configure structure of save files.
- **Overlay**
- Container for debug elements, e.g. FPS counter.
- **Reference**
- Preload here references to Resources and Assets for quick access.
- **SignalBus**
- Exchange global signals for cleaner observer pattern.
- **Wrapper**
- **LogWrapper** - Extends Logger plugin with log groups configuration.
- **AudioManagerWrapper** - Calls Resonance plugin with enums instead of string names.
- **SceneManagerWrapper** - Calls SceneManager plugin with custom preloaded resource.
- **TranslationServerWrapper** - Extends localization to work in tool scripts.

### 🎬 Scenes

Scenes are split into following categories:
1. "Component" scenes extend functionality of the parent.
2. "Node" scenes are reusable as standalone functional units.
3. "Scene" scenes are larger specialized functional collections.

- **Component**
- **Audio**
- **ButtonAudio** - Triggers Audio events on signals (focus, click, release).
- **SliderAudio** - Triggers Audio events on signals (drag start, drag end).
- **TreeAudio** - Triggers Audio events on signals (cell selected, button clicked).
- **Builder**
- **UiBuilder** - Spawn components, e.g. an focus animation on all focusable nodes.
- **Control**
- **ControlExpandStylebox** - Resize target node to fill parent container.
- **ControlFocusOnHover** - Grabs focus of node on mouse hover signal.
- **ControlGrabFocus** - Grabs focus of node for controller support.
- **Emitter**
- **ParticleEmitter** - Convert any scene into a particle via a sub-viewport.
- **Motion**
- **ScaleMotion** - Animate (tween) scale on interaction. *(Game counter labels.)*
- **TwistMotion** - Animate (tween) scale and rotation on interaction. *(UI nodes.)*
- **Tween**
- **ParticleTween** - Emulates particle emitter with a tween.
- **Node**
- **Game**
- **ParticleQueue** - Emit any scene via GPU particles as SubViewport.
- **Menu**
- **MenuButton** - Localized menu button.
- **MenuConfiguration** - Localized UI elements: dropdown, slider, toggle, tree.
- **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** - Display, Resolution, VSync, FPS Limit, Anti-Alias.
- **ControlsOptions** - Change (add or remove) keybinds.
- **GameOptions** - Custom options, e.g. toggle autosave.
- **CreditsMenu** - Renders CREDITS.md file in-game with formatting.
- **SaveFilesMenu** - List of files: play, import, export, delete, rename.
- **GameScene** - Contains gameplay.
- **GameContent** - Example incremental game mechanics and effects.
- **ClicksCounter** - Counts and displays clicks.
- **CoinsCounter** - Counts and displays coins.
- **GameButton** - Animated clickable texture button giving coins-
- **PauseMenu** - Pause gameplay, change options. Esc key shortcut.

### 📄 Scripts

- **Const** - Collections of commonly used constants.
- **Object**
- **ActionHandler** - Implements the (light) [command pattern](https://refactoring.guru/design-patterns/command) design.
- **ConfigStorage** - Persists (save & load) app settings in INI file.
- **LinkedMap** - Dictionary data structure that tracks order of keys.
- **Util**
- **DatetimeUtils** - Useful for save file metadata (e.g. last played at).
- **DictionaryUtils** - Nested dictionary helper functions.
- **EnumUtils** - Enum name converters.
- **FileSystemUtils** - Robust functions to extract file paths and names.
- **MarshallsUtils** - Convert data formats with optional encryption.
- **MathUtils** - Integer power function, base conversion and similar.
- **NodeUtils** - Collection of node manipulation functions.
- **NumberUtils** - Numbers format (digits, metric, scientific), validate.
- **RandomUtils** - Weighted Loot Table and random string functions.
- **StringUtils** - String functions for validation and transformations.
- **ThemeUtils** - Shortcut Theme getters and setters.

### 🌸 Snippets

Native code snippets. (e.g. javascript for web export, java for android export, ...)

Also see [GDExtension](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/what_is_gdextension.html).

- **ConfirmationDialogJsLoader**
- Loads native HTML/CSS/JS dialog to access clipboard in web build.
- Supports transfer of Theme resource properties to CSS style.
- Useful because Godot Nodes cannot read or write to web clipboard.
11 changes: 11 additions & 0 deletions .github/docs/CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

- Back to [💕 Examples](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/EXAMPLES.md) of the project.



## 🫂 Contribute


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

Project contains in-game [CREDITS.md](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/godot/CREDITS.md) rendering.
33 changes: 33 additions & 0 deletions .github/docs/EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Back to [📖 Get Started](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/GET_STARTED.md) of the project.

See [🫂 Contribute](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/CONTRIBUTE.md) of the project.



## 💕 Examples


Projects that use this template: **TBA**

More useful links:

- Godot Engine
- [Godot Engine](https://github.com/godotengine/godot)
- [Redot Engine](https://github.com/Redot-Engine/redot-engine)

- Godot Extensions
- [Awesome Godot](https://github.com/godotengine/awesome-godot?tab=readme-ov-file)
- [Powerful Godot](https://github.com/nonunknown/godot-powerful?tab=readme-ov-file)

- Godot Templates
- [Bitbrain Godot Game Jam Template](https://github.com/bitbrain/godot-gamejam)
- [CrystalBit Godot Game Template](https://github.com/crystal-bit/godot-game-template)
- [Maaack Godot Game Template](https://github.com/Maaack/Godot-Game-Template)
- [MechanicalFlower Template](https://github.com/MechanicalFlower/godot-template?tab=readme-ov-file)
- [Ninetailsrabbit Indie Blueprint](https://github.com/ninetailsrabbit/indie-blueprint)

- Godot Examples
- [Godot Demo Projects](https://github.com/godotengine/godot-demo-projects)
- [Multiple Resolutions Options](https://github.com/godotengine/godot-demo-projects/tree/master/gui/multiple_resolutions)
- [Graphics 3D Options](https://github.com/godotengine/godot-demo-projects/tree/master/3d/graphics_settings)
71 changes: 71 additions & 0 deletions .github/docs/FEATURES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

Back to [📂 Structure](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/STRUCTURE.md) of the project.

See [🧩 Plugins](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/PLUGINS.md) of the project.



## ⭐ Features


### ✨ Game Modules

Some feature modules were written from scratch, others use installed addons.

Feel free to swap modules with either simpler or advanced alternatives, depending on your project.

- **Foundation**
- 🖼️ [**Scene Manager**](https://github.com/maktoobgar/scene_manager) - Custom transitions and loading screens.
- 🎵 [**Audio Manager**](https://github.com/hugemenace/resonate) - Reliable music tracks and sound effects.
- ⚙️ **Configuration** - Persistent game options and statistics in INI file.
- 💾 **Save Files** - Modular save system for game data, optional encryption.
- **Localization**
- 🌍 [**Polygot Template**](https://github.com/agens-no/PolyglotUnity) with 28 languages and over 600 [game words](https://docs.google.com/spreadsheets/d/17f0dQawb-s_Fd7DHgmVvJoEGDMH_yoSd8EYigrb0zmM/edit?gid=296134756#gid=296134756).
- ✏️ [**Google Noto Sans**](https://fonts.google.com/) fonts glyphs (Arabic, Hebrew, HK, JP, KR, SC, TC, Thai).
- **Accessibility**
- 🎮 **Controller Support** - Grab UI focus for joypad and keyboard users.
- 🔍 **Multiple Resolutions** - Video options: display mode, window zoom.
- ⚡ **Optimizations** - E.g. Native web dialog to capture clipboard.
- **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** - Audio, Video (display, vsync), Controls (keybinds), Game.
- 📜 **Credits Menu** - Renders [CREDITS.md](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/godot/CREDITS.md) file in-game with formatting.
- 📓 **Save Files Menu** - List of files: Play, Import, Export, Delete, Rename.
- 🎲 **Game Scene** - Example incremental game mechanics and particle effects.
- ⏸️ **Pause Menu** - Pause gameplay, change options. Esc key shortcut.
- **Placeholder**
- 🎨 **Theme** - Godot default theme. Alternatives at [Kenney](https://kenney.nl/assets/tag:interface?sort=update), [Itch](https://itch.io/c/1473270/themes-for-godot-games), [OGA](https://opengameart.org/art-search-advanced?keys=&title=&field_art_tags_tid_op=or&field_art_tags_tid=ui&name=&field_art_type_tid%5B%5D=9&sort_by=count&sort_order=DESC&items_per_page=24&Collection=), ...
- 🖌️ **Images** - [CC0](https://creativecommons.org/publicdomain/zero/1.0/) Public Domain: [Dannya](https://openclipart.org/artist/dannya) save file icon, [Maaack](https://github.com/Maaack/Godot-Menus-Template/tree/main/addons/maaacks_menus_template/base/assets/images) icons.
- 🎶 **Music & SFX** - [CC0](https://creativecommons.org/publicdomain/zero/1.0/) Public Domain: [Kenney](https://kenney.nl/assets/category:Audio) SFX and [OGA](https://opengameart.org/content/menu-doodle-2) Music (loop).
- 🌪️ **Juice** - UI twist Animation (Tween) on mouse hover or node focus.

### 💫 Development Modules

- **Singletons**
- 📢 **Signal Bus** - Observer pattern for cleaner global signals.
- 📖 **References** - Maps of preloaded resources and assets.
- **Special**
- 👷 **Builder** - adds components to nodes, alternative to upcomming [Traits](https://github.com/godotengine/godot/pull/97657).
- **Scripts**
- 🧰 **Utility** - Many reusable scripts that provide common functionalities.
- 🛠️ **Objects** - ActionHandler, ConfigStorage (INI File), LinkedMap.
- **Tools**
- 🐛 [**Logger**](https://github.com/albinaask/Log) - Easier debugging, custom log groups configuration.
- 🧩 [**IDE Plugin**](https://github.com/Maran23/script-ide) - Improves scripting in GDScript in editor.
- 📋 [**Resource View**](https://github.com/don-tnowe/godot-resources-as-sheets-plugin/tree/Godot-4) - Better resource management in editor.
- ✨ [**GDScript Toolkit**](https://github.com/Scony/godot-gdscript-toolkit) - Code style [formatting](https://github.com/ryan-haskell/gdformat-on-save) on save and [linter](https://github.com/el-falso/gdlinter).
- **Workflow**
- 🚀 **Deployment** - Automatically upload to [itch.io](https://itch.io/) page from Github.
- ✅ **Actions** - Verify style and formatting in GDScript code on push to Github.

### 🗿 Additional Examples

The project contains example `game_content` scenes (set it in `game_scene` scene).

- **2D Incremental Clicker** (default)
- [**3D First Person Controller**](https://github.com/rbarongr/GodotFirstPersonController) (`/artifacts/example_3d_fp_controller`)

Default game content scene can be changed in Game Options under "Game Mode".

This is applied via `_load_game_content_scene` function. *(Option 0 is empty project.)*
80 changes: 80 additions & 0 deletions .github/docs/GET_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

Back to [⚡ Hacks](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/HACKS.md) of the project.

See [💕 Examples](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/EXAMPLES.md) of the project.



## 📖 Get Started


### 📘 Setup

After setup, you should have no errors and no warnings.
- Either click [Use this template](https://github.com/new?template_name=TakinGodotTemplate&template_owner=TinyTakinTeller) in Github or clone the repository.
- Setup [GDScript Toolkit](https://github.com/Scony/godot-gdscript-toolkit) python package to use formatter and linter plugins.
- Open (Import) the project for the first time in the Godot Editor.
- Enable all plugins, then restart the project "Project > Reload Current Project".


On Godot 4.3, you must also:
- Do [font uuid workaround](https://github.com/godotengine/godot/issues/80237) by opening `res://resources/global/theme.tres` and clear then set again the font `noto_sans.woff`.
- Do [font fallbacks workaround](https://github.com/godotengine/godot/issues/92297) by editing `noto_sans.woff.import` and pasting lines:
```
Fallbacks=null
fallbacks=[Resource("res://assets/font/noto_sans/woff/noto_sans_arabic.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_hebrew.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_hk.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_jp.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_kr.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_sc.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_tc.woff"), Resource("res://assets/font/noto_sans/woff/noto_sans_thai.woff")]
```

To resolve "invalid UID" warnings, re-save the scene causing them.


### 📘 Extend Options (Configuration)

1. Add a new enum value in `ConfigurationEnum`.
2. Create a new `_cfg` scene (in `autoload/configuration/configuration_controller/`) and set export variables in the editor.
3. Instantiate the new `_cfg` scene as child of `Configuration` autoload.
4. Instantiate a new UI node (from `scenes/node/menu/menu_configuration/`) and set export variables in the editor.


### ❓ FAQ

For questions and help, open a Github Issue or contact Discord `tiny_takin_teller`.

- Opening the project for the first time, I have errors/warnings?
- Try (re)enable all Plugins and then select "Reload Current Project".
- Warning "ext_resource, invalid UID" when opening the project?
- Resolve by re-saving the mentioned scene (.tscn), e.g. rename root node.


### 💼 Editor Layout

Editor layout can be changed via "Editor > Editor Layout > ..." in Godot Editor.

To use my layout, locate `editor_layouts.cfg` in [Editor Data Paths](https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html#editor-data-paths) and add:

```
[takin_godot_template]

dock_1_selected_tab_idx=0
dock_5_selected_tab_idx=0
dock_floating={}
dock_bottom=[]
dock_closed=[]
dock_split_1=0
dock_split_3=0
dock_hsplit_1=365
dock_hsplit_2=170
dock_hsplit_3=-430
dock_hsplit_4=0
dock_filesystem_h_split_offset=240
dock_filesystem_v_split_offset=0
dock_filesystem_display_mode=0
dock_filesystem_file_sort=0
dock_filesystem_file_list_display_mode=1
dock_filesystem_selected_paths=PackedStringArray("res://")
dock_filesystem_uncollapsed_paths=PackedStringArray("res://")
dock_1="FileSystem,Scene,Scene Manager"
dock_5="Inspector,Node,Import,History"
```

For editor features, you can change "Editor > Manage Editor Features..." (e.g. toggle 3D Editor view).
34 changes: 34 additions & 0 deletions .github/docs/HACKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Back to [🎉 CI/CD](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/CICD.md) of the project.

See [📖 Get Started](https://github.com/TinyTakinTeller/TakinGodotTemplate/blob/master/.github/docs/GET_STARTED.md) of the project.



## ⚡ Hacks

Godot Engine [has known issues](https://github.com/godotengine/godot/issues) requiring hacks (workarounds) until officially resolved.

This template implements workarounds for the following issues:

- **General**
- [x] Issue [#96023](https://github.com/godotengine/godot/issues/96023) **custom theme**. Solved with startup script.
- [x] Issue [#66014](https://github.com/godotengine/godot/issues/66014) **suffixed tres files**. Solved with sanitization.
- [x] Issue [#65390](https://github.com/godotengine/godot/issues/65390) **defect GPU particles**. Solved with interpolate toggle.
- [x] Issue [#35836](https://github.com/godotengine/godot/issues/35836#issuecomment-581083643) **font size tween lag**. Solved by scale tween instead.
- [ ] Issue [#89712](https://github.com/godotengine/godot/issues/89712) **"hicon" is null** sometimes. TODO?
- [ ] Issues [#75369](https://github.com/godotengine/godot/issues/75369), [#71182](https://github.com/godotengine/godot/issues/71182), [#61929](https://github.com/godotengine/godot/issues/61929) **large scene lag** sometimes. TODO?
- **Desktop**
- [ ] Issues [#3145](https://github.com/godotengine/godot-proposals/issues/3145), [#6247](https://github.com/godotengine/godot-proposals/issues/6247) **boot window mode**. TODO: cfg override.
- [ ] Issues [#76167](https://github.com/godotengine/godot/issues/76167), [#91543](https://github.com/godotengine/godot/issues/91543) **Boot Splash "leak"**. TODO?
- **Web**
- [x] Issue [#81252](https://github.com/godotengine/godot/issues/81252) **web clipboard**. Solved by native JavaScript dialog.
- [x] Issue [#96874](https://github.com/godotengine/godot/issues/96874) **web boot splash**. Solved by CSS in Head Include.
- [x] Issue [#100696](https://github.com/godotengine/godot/issues/100696) **play_stream bus**. Solved by explicit func args.
- [ ] Issue [#43138](https://github.com/godotengine/godot/issues/43138) **web user focus**. TODO: "click to continue" boot screen.

**TODO**: Test the template on following platforms.
- **Linux**
- **MacOS**
- **iOS**
- **Android**
Loading