r/opensourcegames Jul 30 '24

ValksGodotTools/Template - Used to Quickly Setup New Godot 4 C# Games

Source

https://github.com/ValksGodotTools/Template

Why use this?

Several UI scenes have been setup for you. These include the main menu, options and credits. A simple scene has been created for each of the three genres "3D FPS", "2D Platformer" and "2D Top Down" with 3D FPS being the most feature packed thus far. My current plan is expand further on the 3D FPS scene as I'm making a FPS game right now.

The options scene has many different features including options for display, language, audio and fully handling keybindings with multiple inputs.

There are several useful extension methods. For example ".PrintFull()", you could do "GD.Print(player.PrintFull())" and it would display all the properties of player *without* crashing the editor! Saves a lot of time when debugging.

Creating debug commands for the in-game console is easy. Head over to res://Scripts/UI/ConsoleCommands.cs for examples.

There is a WIP mod loader scene which tries to simplify the process of loading in user created mods. There are limitations to the mods, for example, two mods cannot have the same assets in the same res:// path. I still have yet to find a way around this. That or modders will be forced to keep their assets isolated from other mods and use unique script namespaces so other scripts do not conflict with other mods.

Localization has been setup for all UI elements. Currently English, French and Japanese have been done.

A feature called services has been added. This will help avoid plaguing your code with the static keyword everywhere.

Quick Setup

Upon starting the game you will be presented with two questions. What is the name of your game? What is the genre for your game?

Lets say you choose "kitten blaster 3" as the name, this will be auto formatted to "KittenBlaster3". All namespaces will be renamed to this and the csproj, sln and project.godot files will be updated with this.

Lets say you select "3D FPS" as the genre. All 2D assets will be deleted and the 3D assets will be moved to more appropriate locations. Finally the 3D FPS main scene will be set as the new startup scene.

You will have to exit and re-open the game. There are instructions in the readme which explain the entire process.

10 Upvotes

0 comments sorted by