Skip to content

Commit

Permalink
Merge pull request #140 from Maaack/fixes-to-documentation
Browse files Browse the repository at this point in the history
Fixes to documentation
  • Loading branch information
Maaack authored Aug 27, 2024
2 parents fcbc276 + 3419ddd commit 642c590
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 87 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Godot Game Template
For Godot 4.2
For Godot 4.2+

This template has a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.

Expand All @@ -12,10 +12,10 @@ This template has a main menu, options menus, pause menu, credits, scene loader,
[All videos](/addons/maaacks_game_template/docs/Videos.md)

#### Screenshots
![Main Menu](/addons/maaacks_game_template/media/Screenshot-3-1.png)
![Key Rebinding](/addons/maaacks_game_template/media/Screenshot-3-2.png)
![Audio Controls](/addons/maaacks_game_template/media/Screenshot-3-4.png)
![Pause Menu](/addons/maaacks_game_template/media/Screenshot-3-6.png)
![Main Menu](/addons/maaacks_game_template/media/screenshot-3-1.png)
![Key Rebinding](/addons/maaacks_game_template/media/screenshot-3-2.png)
![Audio Controls](/addons/maaacks_game_template/media/screenshot-3-4.png)
![Pause Menu](/addons/maaacks_game_template/media/screenshot-3-6.png)
[All screenshots](/addons/maaacks_game_template/docs/Screenshots.md)

## Use Case
Expand Down Expand Up @@ -66,24 +66,24 @@ The `examples/` folder contains an example project using inherited scenes from t
- Loading Screen w/ Shader Pre-caching

### How it Works
- `AppConfig.tscn` is set as the first autoload. It calls `AppSettings.gd` to load all the configuration settings from the config file (if it exists) through `Config.gd`.
- `SceneLoader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`LoadingScreen.tscn` by default).
- `Opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`MainMenu.tscn`).
- `MainMenu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `OptionControl.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `Config.gd` to keep settings persistent between runs.
- `Credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `ProjectUISoundController.tscn` is an autload used to apply UI sounds project-wide.
- `ProjectMusicController.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
- `InGameMenuController.gd` controls opening and closing a menu and pausing the game in the background.
- The `PauseMenuController` node loads the `PauseMenu.tscn` (using `InGameMenuController.gd`) when triggering `ui-cancel`.
- `GameUI.tscn` is a demo game scene that displays recognized action inputs, and features the `PauseMenuController` node, the `LevelLoader` node to advance through levels, and `InGameMenuController.gd` to show `WinScreen.tscn` or `LoseScreen.tscn`.
- `app_config.tscn` is set as the first autoload. It calls `app_settings.gd` to load all the configuration settings from the config file (if it exists) through `config.gd`.
- `scene_loader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`loading_screen.tscn` by default).
- `opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`main_menu.tscn`).
- `main_menu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `option_control.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `config.gd` to keep settings persistent between runs.
- `credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `project_ui_sound_controller.tscn` is an autload used to apply UI sounds project-wide.
- `project_music_controller.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
- `in_game_menu_controller.gd` controls opening and closing a menu and pausing the game in the background.
- The `PauseMenuController` node loads the `pause_menu.tscn` (using `in_game_menu_controller.gd`) when triggering `ui-cancel`.
- `game_ui.tscn` is a demo game scene that displays recognized action inputs, and features the `PauseMenuController` node, the `LevelLoader` node to advance through levels, and `in_game_menu_controller.gd` to show `win_screen.tscn` or `lose_screen.tscn`.

## Installation

### Godot Asset Library
This package is available as both a template and a plugin, meaning it can be used to start a new project, or added to an existing project.

![Package Icon](/addons/maaacks_game_template/media/Game-Icon-black-transparent-256x256.png)
![Package Icon](/addons/maaacks_game_template/media/game-icon-black-transparent-256x256.png)

When starting a new project:

Expand Down
34 changes: 17 additions & 17 deletions addons/maaacks_game_template/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Godot Game Template
For Godot 4.2
For Godot 4.2+

This template has a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.

Expand All @@ -12,10 +12,10 @@ This template has a main menu, options menus, pause menu, credits, scene loader,
[All videos](/addons/maaacks_game_template/docs/Videos.md)

#### Screenshots
![Main Menu](/addons/maaacks_game_template/media/Screenshot-3-1.png)
![Key Rebinding](/addons/maaacks_game_template/media/Screenshot-3-2.png)
![Audio Controls](/addons/maaacks_game_template/media/Screenshot-3-4.png)
![Pause Menu](/addons/maaacks_game_template/media/Screenshot-3-6.png)
![Main Menu](/addons/maaacks_game_template/media/screenshot-3-1.png)
![Key Rebinding](/addons/maaacks_game_template/media/screenshot-3-2.png)
![Audio Controls](/addons/maaacks_game_template/media/screenshot-3-4.png)
![Pause Menu](/addons/maaacks_game_template/media/screenshot-3-6.png)
[All screenshots](/addons/maaacks_game_template/docs/Screenshots.md)

## Use Case
Expand Down Expand Up @@ -66,24 +66,24 @@ The `examples/` folder contains an example project using inherited scenes from t
- Loading Screen w/ Shader Pre-caching

### How it Works
- `AppConfig.tscn` is set as the first autoload. It calls `AppSettings.gd` to load all the configuration settings from the config file (if it exists) through `Config.gd`.
- `SceneLoader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`LoadingScreen.tscn` by default).
- `Opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`MainMenu.tscn`).
- `MainMenu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `OptionControl.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `Config.gd` to keep settings persistent between runs.
- `Credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `ProjectUISoundController.tscn` is an autload used to apply UI sounds project-wide.
- `ProjectMusicController.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
- `InGameMenuController.gd` controls opening and closing a menu and pausing the game in the background.
- The `PauseMenuController` node loads the `PauseMenu.tscn` (using `InGameMenuController.gd`) when triggering `ui-cancel`.
- `GameUI.tscn` is a demo game scene that displays recognized action inputs, and features the `PauseMenuController` node, the `LevelLoader` node to advance through levels, and `InGameMenuController.gd` to show `WinScreen.tscn` or `LoseScreen.tscn`.
- `app_config.tscn` is set as the first autoload. It calls `app_settings.gd` to load all the configuration settings from the config file (if it exists) through `config.gd`.
- `scene_loader.tscn` is set as the second autoload. It can load scenes in the background or with a loading screen (`loading_screen.tscn` by default).
- `opening.tscn` is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (`main_menu.tscn`).
- `main_menu.tscn` is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.
- `option_control.tscn` and its inherited scenes are used for most configurable options in the menus. They work with `config.gd` to keep settings persistent between runs.
- `credits.tscn` reads from `ATTRIBUTION.md` to automatically generate the content for it's scrolling text label.
- The `UISoundController` node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene. `project_ui_sound_controller.tscn` is an autload used to apply UI sounds project-wide.
- `project_music_controller.tscn` is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.
- `in_game_menu_controller.gd` controls opening and closing a menu and pausing the game in the background.
- The `PauseMenuController` node loads the `pause_menu.tscn` (using `in_game_menu_controller.gd`) when triggering `ui-cancel`.
- `game_ui.tscn` is a demo game scene that displays recognized action inputs, and features the `PauseMenuController` node, the `LevelLoader` node to advance through levels, and `in_game_menu_controller.gd` to show `win_screen.tscn` or `lose_screen.tscn`.

## Installation

### Godot Asset Library
This package is available as both a template and a plugin, meaning it can be used to start a new project, or added to an existing project.

![Package Icon](/addons/maaacks_game_template/media/Game-Icon-black-transparent-256x256.png)
![Package Icon](/addons/maaacks_game_template/media/game-icon-black-transparent-256x256.png)

When starting a new project:

Expand Down
40 changes: 20 additions & 20 deletions addons/maaacks_game_template/docs/ExistingProject.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ These instructions assume starting with just the contents of `addons/`. This wil


1. Go to `Project > Project Settings… > General > Application > Run`.
2. Update `Main Scene` to `MainMenu.tscn` or `Opening.tscn`.
2. Update `Main Scene` to `main_menu.tscn` or `opening.tscn`.
1. Alternatively, any scene the inherits from one of these. A few exist in the `examples/` folder.
3. Close the window.


2. Update the project’s name in the main menu.


1. Open `MainMenu.tscn`.
1. Open `main_menu.tscn`.
2. Select the `Title` node.
3. Update the `Text` to your project's title.
4. Select the `Subtitle` node.
Expand All @@ -26,7 +26,7 @@ These instructions assume starting with just the contents of `addons/`. This wil
3. Link the main menu to the game scene.


1. Open `MainMenu.tscn`.
1. Open `main_menu.tscn`.
2. Select the `MainMenu` node.
3. Update `Game Scene Path` to the path of the project's game scene.
4. Save the scene.
Expand All @@ -44,63 +44,63 @@ These instructions assume starting with just the contents of `addons/`. This wil
2. Add background music to the Main Menu.

1. Import the music asset into the project.
2. Open `MainMenu.tscn`.
2. Open `main_menu.tscn`.
3. Select the `BackgroundMusicPlayer` node.
4. Assign the music asset to the `stream` property.
5. Save the scene.
6. Optionally, repeat steps 3-5 for background music nodes in:
1. `Opening.tscn`
2. `GameUI.tscn`
3. `EndCredits.tscn`
1. `opening.tscn`
2. `game_ui.tscn`
3. `end_credits.tscn`


3. Add sound effects to UI elements.

1. By scene.


1. Open `MainMenu.tscn` and `PauseMenu.tscn`.
1. Open `main_menu.tscn` and `pause_menu.tscn`.
2. Select the `UISoundController` node.
3. Add audio streams to the various UI node events.
4. Save the scenes.
4. Save the scenes.


2. Project-wide.


1. Open `ProjectUISoundController.tscn`.
1. Open `project_ui_sound_controller.tscn`.
2. Select the `UISoundController` node.
3. Add audio streams to the various UI node events.
4. Save the scene.
4. Save the scene.


5. Add readable names for input actions to the controls menu.


1. Open `InputOptionsMenu.tscn` (or `MasterOptionsMenu`, which contains an instance of the scene).
1. Open `input_options_menu.tscn` (or `master_options_menu.tscn`, which contains an instance of the scene).
2. Select the `Controls` node.
3. Update the `Action Name Map` to show readable names for the project's input actions.
1. The keys are the project's input action names, while the values are the names shown in the controls menu.
2. An example is provided. It can be updated or removed, either in the inspector for the node, or in the code of `InputOptionsMenu.gd`.
2. An example is provided. It can be updated or removed, either in the inspector for the node, or in the code of `input_options_menu.gd`.
4. Save the scene.


6. Add / remove configurable settings to / from menus.


1. Open `MiniOptionsMenu.tscn` or `[Audio|Visual|Input|Game]OptionsMenu.tscn` scenes to edit their options.
1. Open `mini_options_menu.tscn` or `[audio|visual|input|game]_options_menu.tscn` scenes to edit their options.
2. If an option is not desired, it can always be hidden, or removed entirely (sometimes with some additional work).
3. If a new option is desired, it can be added without writing code.
1. Find the node that contains the existing list of options. Usually, it's a `VBoxContainer`.
2. Add an `OptionControl.tscn` node as a child to the container.
1. `SliderOptionControl.tscn` or `ToggleOptionControl.tscn` can be used if those types match requirements. In that case, skip step 6.
2. `ListOptionControl.tscn` and `Vector2ListOptionControl.tscn` are also available, but more complicated. See the `ScreenResolution` example.
2. Add an `option_control.tscn` node as a child to the container.
1. `slider_option_control.tscn` or `toggle_option_control.tscn` can be used if those types match requirements. In that case, skip step 6.
2. `list_option_control.tscn` and `vector_2_list_option_control.tscn` are also available, but more complicated. See the `ScreenResolution` example.
3. Select the `OptionControl` node just added, to edit it in the inspector.
4. Add an `Option Name`. This prefills the `Key` string.
5. Select an `Option Section`. This prefills the `Section` string.
6. Add any kind of `Button`, `Slider`, `LineEdit`, or `TextEdit` to the `OptionControl` node.
7. Save the scene.
4. For options to have an effect outside of the menu, it will need to be referenced by its `key` and `section` from `Config.gd`.
4. For options to have an effect outside of the menu, it will need to be referenced by its `key` and `section` from `config.gd`.
1. `Config.get_config(section, key, default_value)`
5. Validate the values being stored in your local `config.cfg` file.
1. Refer to [Accessing Persistent User Data User](https://docs.godotengine.org/en/stable/tutorials/io/data_paths.html#accessing-persistent-user-data-user) to find Godot user data on your machine.
Expand All @@ -112,6 +112,6 @@ These instructions assume starting with just the contents of `addons/`. This wil


1. Update the example `ATTRIBUTION.md` with the project's credits.
2. Open `Credits.tscn`.
2. Open `credits.tscn`.
3. Check the `CreditsLabel` has updated with the text.
4. Save the scene.
Loading

0 comments on commit 642c590

Please sign in to comment.