First steps into a new Godot 3D project

  • gamedev
  • godot
  • c#
First steps into a new Godot 3D project cover

New project

My usual pipeline for starting a new project in Godot was to just copy over folders and components from other projects and tweak them a little. It works fine, but it’s tedious. The way I structure and organize the project, and how I set up custom nodes and autoloads, remained largely the same (for 3D, anyways). I wanted something more lazy as I mess around with various styles of game design, so I looked into creating some modular components and autoloads that I could initialize each project with.

My idea: create an addon that will automatically generate folders, copy over resource and code templates, and add autoloads for core features including saving and restoring settings, managing profiles, implementing networking, scene management, and more. And so, I got to work on my martinis-modules addon! I’ll go over how I handle setting everything up, and I may even get to the point of open sourcing it all.

The addon

A few staples of mine that were already 90% ready to work in any (3D) environment:

  • root Game scene
  • SceneManager autoload
  • ProfileManager autoload
  • SettingsManager autoload
  • NetworkManager autoload
  • SessionManager autoload
  • Camera3PComponent
  • InteractComponent
  • InventoryComponent
  • Much of my input handling/movement logic

So the idea is to move them all into a reusable plugin, set the plugin to add the autoloads to each project’s autoload list, copy over any other resources or templates that interact with any of the above, and patch them up a bit to be more adaptable where necessary. My basic scaffolding looks like this:

root
└─ Game
    ├─ Menu
    ├─ Level
    ├─ Players
    └─ Overlay

and honestly, Overlay could probably be split into multiple subcategories. I then have a SceneManager autoload with ShowMenu() and LoadLevel() methods, with a cached list of menu scenes loaded on _Ready(), and a SettingsManager and ProfileManager reading from any saved data files and loading them into memory.