Skip to content

Instantly share code, notes, and snippets.

@gnat
Last active April 10, 2025 12:55
Show Gist options
  • Save gnat/b90ef70191d1c531c396ad08b37abb75 to your computer and use it in GitHub Desktop.
Save gnat/b90ef70191d1c531c396ad08b37abb75 to your computer and use it in GitHub Desktop.
General Project Layout

Why a base project layout?

  • ⭐ Works for many different project types: game, website, app.
  • ⭐ /main lets us have supporting files excluded from Caddy, Godot, etc with zero extra config!
  • ⭐ Avoids industry jargon.

Use ideas you like, leave ideas you dislike. The intention is to be simple adaptable starting point.

Project Layout

  • πŸ“‚ /<group> - 🏦 Group to contain many related projects (ex: "company")
    • πŸ“‚ /<name> - πŸ’Ό Project name (ex "blah.com", "fungame"). Good level to start git.
      • πŸ“ /main - πŸ’» Main project files.
        • πŸ“ /common - 🚚 Internal dependencies.
        • πŸ“ /vendor - 🚚 External dependencies.
      • πŸ“ /notes - πŸ“ Scratch pad. Can be docs, diagrams, "also" files.
      • πŸ“ /run - βš™οΈ Files to run project: Caddy, Godot, Dockerfiles, etc.
      • βš™οΈ run.sh - Task runner. Often calls into /run (Unified github /scripts directory into 1 file)

Project Ideas

Website

  • πŸ“‚ /<group>
    • πŸ“‚ /<name>
      • πŸ“ /main
        • πŸ“ /public - 🌐 Point the web server here!
          • πŸ“ /css - 🎨 CSS assets.
          • πŸ“ /images - πŸ–ΌοΈ Image assets.
          • πŸ“ /js - πŸ“œ Javascript assets.
        • πŸ“ /systems - πŸ€– Singletons, libraries, helpers, managers, utilities.
          • πŸ“ /languages - πŸ’¬ Translations, countries.
          • πŸ“ /tables - πŸ₯ž Tables in data store. (models)
        • πŸ“ /templates - πŸ“ Snippets used in /urls. (views)
        • πŸ“ /urls - πŸ‘ URL endpoints using 1:1 file based routing. (PHP? just use /public)

Game

  • πŸ“‚ /<group>
    • πŸ“‚ /<name>
      • πŸ“ /release - 🚒 Releaseable builds (if applicable).

Versioning

  • πŸ“‚ /<group>
    • πŸ“‚ /<name>
      • πŸ“ /main
      • πŸ“ /demo

Stages / Environments

  • Why move away from dev / staging / production ?
    • Reduced ambiguity. Remove industry jargon.
    • Better applied to non-developer teams (ex: art)
    • Better applied to Task Board categories.
    • Better applied to web, game and apps.
  • πŸ›  work - Development.
    • Environments for working.
    • "workspace" ... "workstation" ... "workflow"
  • πŸ”¬ test - Review, feedback, staging.
    • Environments where feedback, reviews, testing and benchmarks happen.
    • "The feature is in testing."
    • Deploy to Testing: test.yml
  • 🌎 live - Release, production, shipping.
    • Environments available to customers.
    • You "release" to the live environment.
    • "The feature is live." - Super obvious.
    • "The bug is live." - Super obvious.
    • Deploy to Live: live.yml

Task Board (Kanban)

Can be good to adjust these depending on the team (developers, art, business, etc). Ex: "Testing" does not make sense for artists. However these should work for most teams.

πŸ“¬ Ideas ➑️ 🚧 Filter ➑️ πŸ›  Working ➑️ πŸ‘ Feedback ➑️ 🌎 Live ➑️ 🚫 Cancelled

  • πŸ“¬ Ideas: Stories to consider.
  • 🚧 Filter: Pitfall reminders to be avoided, references and notes.
  • πŸ›  Working: Ideas being developed.
  • πŸ‘ Feedback: Test and review for release.
  • 🌎 Live: Released and finished ideas.
  • 🚫 Cancelled: Ideas that were not implemented for some reason.

Notes

Other considered ideas.

  • retiring "staging" is a big deal.
  • what also makes sense for game dev?
  • work / feedback / live
  • work / test / live
  • edit / test / live
  • doing / review / live
  • create / review / release
  • dev / feedback / live
  • dev / testing / live
  • dev / review / live
  • dev / review / release
  • dev / review / launch
  • deploy, launch, live, production, shipping / shipped, release
  • publish -- too much of a verb only
  • too common as language keywords: public, online

Synonyms for MVC for games

  • views: actors, entities, parts
  • controllers: scenes, sets, groups
  • models: data, state, records, resources
  • libraries: managers, directors, common, helpers, functions

Synonyms

  • actors / directors / scenes
  • actors / directors / sets
  • actors / systems / scenes
  • parts / systems / groups
  • parts / systems / scenes
  • entitys / systems / screens
  • things / systems / scenes
  • things / systems / views
  • entitys / managers / screens
  • entitys / systems / screens
  • objects / managers / scenes
  • Godot project (Organize by feature; not type. Avoid moving things and keep the root clean!)
    • πŸ“ /actors - Good because each entity has a consistent structure.
      • πŸ“ /player
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
      • πŸ“ /scene_block_grass
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
      • πŸ“ /enemy_b
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
    • πŸ“ /common - Shared resources.
      • πŸ“ /any - Grab bag. Keep the root clean!
      • πŸ“ /fonts
      • πŸ“ /images
      • πŸ“ /languages - πŸ’¬ Strings and translations.
      • πŸ“ /models
      • πŸ“ /music
      • πŸ“ /scripts
      • πŸ“ /shaders
      • πŸ“ /sounds
      • πŸ“ /vendor - 🚚 External dependencies.
    • πŸ“ /directors - Singletons, managers, helpers.
      • πŸ“œ any.gd - Misc utilities.
      • πŸ“œ asset.gd - Special setup of assets.
      • πŸ“œ camera.gd - Camera management.
      • πŸ“œ entity.gd - Entity management.
      • πŸ“œ level.gd - Level management.
      • πŸ“œ main.gd - Main loop management.
      • πŸ“œ map.gd - When and how to display various screens.
      • πŸ“œ screen.gd - When and how to display various screens.
      • πŸ“œ sound.gd - SFX, Music.
      • πŸ“œ story.gd - One big switch case.
    • πŸ“ /scenes - Good because each level has a consistent structure.
      • πŸ“ /planet_blah
        • πŸ“œ main.gd
    • πŸ“ /uis
  • Godot project (Organize by feature; not type. Avoid moving things and keep the root clean!)
    • πŸ“ /common - Shared resources.
      • πŸ“ /any - Grab bag. Keep the root clean!
      • πŸ“ /fonts
      • πŸ“ /images
      • πŸ“ /languages - πŸ’¬ Strings and translations.
      • πŸ“ /models
      • πŸ“ /music
      • πŸ“ /scripts
      • πŸ“ /shaders
      • πŸ“ /sounds
      • πŸ“ /vendor - 🚚 External dependencies.
    • πŸ“ /entitys - Good because each entity has a consistent structure.
      • πŸ“ /player
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
      • πŸ“ /level_block_grass
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
      • πŸ“ /enemy_b
        • πŸ“œ main.gd
        • πŸ“ main.tscn
        • πŸ–ΌοΈ main.png
    • πŸ“ /levels - Format that can be created and shared easily.
      • πŸ“ `planet1_level1.json"
      • πŸ“ `planet2_level3.json"
    • πŸ“ /managers - Singletons, managers, helpers.
      • πŸ“œ any.gd - Misc utilities.
      • πŸ“œ asset.gd - Special setup of assets.
      • πŸ“œ camera.gd - Camera management.
      • πŸ“œ entity.gd - Entity management.
      • πŸ“œ level.gd - Level management.
      • πŸ“œ main.gd - Main loop management.
      • πŸ“œ map.gd - When and how to display various screens.
      • πŸ“œ screen.gd - When and how to display various screens.
      • πŸ“œ sound.gd - SFX, Music.
      • πŸ“œ story.gd - One big switch case.
    • πŸ“ /screens - Good because each level has a consistent structure.
      • πŸ“ /menu
        • πŸ“œ `main.gd
      • πŸ“ /planet_blah
        • πŸ“œ main.gd
    • πŸ“ /uis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment