Skip to main content

Game folder structure

This is the guide on how to name things, where to put them, and over-all how we intend to organize the project files.

Considerations

The game project's file structure should achieve several key things:

  • Organize multiple repositories into folder structures that can co-exist.
    • One directory for the Godot project, a separate directory for the art source files that are created outside of the engine.
    • These directories will each be a Git repository and should conform to the hyphenated naming convention.
    • These names should make sense in and out of context, the top-level folder name should make sense when viewed as a tab in a Git GUI e.g:
      • example-gameΒ 
      • example-art
      • example-audio
    • Splitting the repositories avoids having to sync large amounts of irrelevant content for your role on the project:
      • Programmers / Dev Ops / Build Bots should only need to sync the example-game repository.
      • Artists / Animators can syncΒ example-artΒ along side the example-game repository.
      • Musicians / Foley Artists can sync example-audioΒ along side the example-game repository.
    • The folder structures should work without using Git sub-modules, since sub-modules add a lot of complexity and confusion without really adding value.
  • The folder structures in these directories should mimic each other 1:1
  • Tools and pipelines should be able to export / import content by simply swapping the root, e.g:
    • example-art/art_assets/characters/main_character/main_character_diffuse.png
    • |--->example-game/art_assets/characters/main_character/main_character_diffuse.png
  • Ship-able game content should be the only thing going into the Godot project resource folder in the game repo.
  • Art source content from tools like Blender, Gimp, Krita, etc... should be kept in the art repo.
  • Music production files for a DAW should be kept in the audio repo.

Naming Conventions

  • The repositories should use lowercase-hyphenated-case
  • Files and folders should use snake_case unless otherwise required by third-party tools or conventions for the specific file e.g. README.md
  • No spaces in file names.
  • All directories should be plural:
    • "characters" not "character"
    • "environments" not "environment"

Compromises

No folder structure is perfect, but this structure should lead to the fewest problems. Here is a list of known compromises we've decided to accept:

Top level folder names repeat the game's name even though they are already inside of a top-level folder named after the game:

  • example
    • example-game
    • example-art
    • example-audio

      Β 

While this introduces redundancy, folders don't cost anything, so this is okay.

Some intermediate sub-folders are empty and seem to be useless, but they keep the hierarchies between directories in perfect sync. For instance, example-artΒ may never end up with content directly inside of it, most if not all content will be inside of its first sub-folder art_assetsΒ  i.e. example-art/art_assets/ This is on purpose, since it ensures the game content is at the same hierarchical indentation level to the source content, making pipelines and paths extremely easy to work with; just swap the root and you're done!

You ought to have a directory on your computer for "BUGJam" projects. You can place this anywhere on your computer with a few considerations:

  • Do not sync this directory with OneDrive, iCloud, Google Drive, or any other backup tool, this will break the Git repositories inside the folder since these services interfere with Git.
  • Don't nest the folder too deep so you avoid file name length issues:
    • Good (Windows style path): C:\Users\xgreer\Projects\BUGJam
    • Good (MacOS / Linux): /home/xgreer/Projects/BUGJam
    • Bad: /home/xgreer/Projects/Extra Projects/Seattle Blender User Group/Game Projects/BUGJam

Within the BUGJam directory there will be folders for each BUGJam project. For a project called 'Genesis' we will have a project folder called 'genesis' that serves as the root for all content necessary to develop the game.

File Tree Structure Example

BUGJam <!-- Top-level folder for the entire studio. -->
β”œβ”€β”€ genesis <!-- Top-level folder that contains all repositories for the game. -->
β”‚ β”œβ”€β”€ genesis-art <!-- Repository for large art content, stored outside of the Godot project. -->
β”‚ β”‚ β”œβ”€β”€ .forgejo <!-- Hidden content used for resources on Forgejo -->
β”‚ β”‚ β”‚ └── banner
β”‚ β”‚ β”‚   └── genesis_art_banner.png
β”‚ β”‚ β”œβ”€β”€ art_assets <!-- Source files for creating art -->
β”‚ β”‚ β”‚ └── characters
β”‚ β”‚ β”‚   β”œβ”€β”€ main_character
β”‚ β”‚ β”‚   β”‚ β”œβ”€β”€ animations
β”‚ β”‚ β”‚   β”‚ β”‚ └── idle.blend
β”‚ β”‚ β”‚   β”‚ β”œβ”€β”€ main_character_diffuse.png
β”‚ β”‚ β”‚   β”‚ └── main_character_rig.blend
β”‚ β”‚ β”‚   └── monster
β”‚ β”‚ β”‚     β”œβ”€β”€ animations
β”‚ β”‚ β”‚     β”‚ └── walk.blend
β”‚ β”‚ β”‚     β”œβ”€β”€ monster_diffuse.png
β”‚ β”‚ β”‚     └── monster_rig.blend
β”‚ β”‚ β”œβ”€β”€ audio_assets <!-- Source files for music and sound effects -->
β”‚ β”‚ β”‚ β”œβ”€β”€ dialogue
β”‚ β”‚ β”‚ β”œβ”€β”€ music
β”‚ β”‚ β”‚ └── sound_effects
β”‚ β”‚ └── pipeline <!-- Pipeline tools for producing content outside of the game -->
β”‚ β”‚   β”œβ”€β”€ addons
β”‚ β”‚   β”œβ”€β”€ extensions
β”‚ β”‚   └── scripts
β”‚ └── genesis-game <!-- This is the Godot root for resources: 'res://' -->
β”‚   β”œβ”€β”€ .forgejo <!-- Hidden content used for resources on Forgejo -->
β”‚   β”‚ └── banner
β”‚   β”‚   └── genesis_game_banner.png
β”‚   β”œβ”€β”€ addons <!-- Godot plugins -->
β”‚   β”œβ”€β”€ art_assets <!-- A 1:1 mirrored file structure with the genesis-art repository. -->
β”‚   β”‚ β”œβ”€β”€ characters
β”‚   β”‚ β”‚ β”œβ”€β”€ main_character
β”‚   β”‚ β”‚ β”‚ β”œβ”€β”€ main_character_mat.tres <!-- Material -->
β”‚   β”‚ β”‚ β”‚ β”œβ”€β”€ main_character_diffuse.png <!-- Texture -->
β”‚   β”‚ β”‚ β”‚ β”œβ”€β”€ main_character_diffuse.png.import <!-- Import settings and UID -->
β”‚   β”‚ β”‚ β”‚ β”œβ”€β”€ main_character_rig.bin <!-- Binary data for the model file -->
β”‚   β”‚ β”‚ β”‚ β”œβ”€β”€ main_character_rig.gltf <!-- Model file -->
β”‚   β”‚ β”‚ β”‚ └── main_character_rig.gltf.import <!-- Import settings and UID -->
β”‚   β”‚ β”‚ └── monster
β”‚   β”‚ β”‚   β”œβ”€β”€ monster_mat.tres <!-- Material -->
β”‚   β”‚ β”‚   β”œβ”€β”€ monster_diffuse.png <!-- Texture -->
β”‚   β”‚ β”‚   β”œβ”€β”€ monster_rig.bin <!-- Binary data for the model file -->
β”‚   β”‚ β”‚   β”œβ”€β”€ monster_rig.gltf <!-- Model file -->
β”‚   β”‚ β”‚   └── monster_rig.gltf.import <!-- Import settings and UID -->
β”‚   β”‚ β”œβ”€β”€ common
β”‚   β”‚ β”‚ └── textures
β”‚   β”‚ β”‚   └── blue_noise_64.png
β”‚   β”‚ β”œβ”€β”€ environments
β”‚   β”‚ β”‚ β”œβ”€β”€ rock
β”‚   β”‚ β”‚ β”‚ └── [...]
β”‚   β”‚ β”‚ └── wall
β”‚   β”‚ β”‚   └── [...]
β”‚   β”‚ └── interactables <!-- Core puzzle elements for designing levels. -->
β”‚   β”‚   β”œβ”€β”€ coin
β”‚   β”‚   β”‚ └── [...]
β”‚   β”‚   └── door
β”‚   β”‚     └── [...]
β”‚   β”œβ”€β”€ audio_assets <!-- A 1:1 mirrored file structure with the genesis-audio repository. -->
β”‚   β”‚ β”œβ”€β”€ dialogue
β”‚   β”‚ β”œβ”€β”€ music
β”‚   β”‚ └── sound_effects
β”‚   β”œβ”€β”€ entities <!-- Complete assets that are ready to drag and drop into a level. -->
β”‚   β”‚ β”œβ”€β”€ characters
β”‚   β”‚ β”‚ β”œβ”€β”€ main_character.tscn
β”‚   β”‚ β”‚ └── monster.tscn
β”‚   β”‚ β”œβ”€β”€ environments <!-- Stuff without direct gameplay mechanics. -->
β”‚   β”‚ β”‚ β”œβ”€β”€ rock.tscn
β”‚   β”‚ β”‚ └── wall.tscn
β”‚   β”‚ └── puzzle_elements <!-- Core puzzle elements for designing levels. -->
β”‚   β”‚   β”œβ”€β”€ button.tscn
β”‚   β”‚   └── pusher.tscn
β”‚   β”œβ”€β”€ levels <!-- Playable levels. -->
β”‚   β”‚ β”œβ”€β”€ level_packs <!-- Data assets that organize levels into packs. -->
β”‚   β”‚ β”‚ β”œβ”€β”€ world1.gd
β”‚   β”‚ β”‚ └── world2.gd
β”‚   β”‚ β”œβ”€β”€ epilogue.tscn
β”‚   β”‚ β”œβ”€β”€ intro.tscn
β”‚   β”‚ └── open_world.tscn
β”‚   β”œβ”€β”€ scripts
β”‚   β”‚ └── player.gd
β”‚   β”œβ”€β”€ shaders
β”‚   β”‚ └── iris.gdshader
β”‚   β”œβ”€β”€ ui
β”‚   β”‚ └── icons.png
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ icon.png
β”‚   β”œβ”€β”€ project.godot <!-- Main Godot project file -->
β”‚   └── README.md
└── logo <!-- Example of other stuff for the studio that is not directly related to the game. -->