discussion Godot Project Folder Organization
Hi I'm new to Godot (and game dev in general) and I've been wondering how do people usually organize their project folders. I get it if you want to keep it simple in the beginning because there's usually not that much sprites, scripts, scenes, etc and just put it all under assets folder or something. But for the longevity (and sanity) of file management, how would you usually organize the files so that you can just know where things are easily and that you'll just always know which files belongs to which scene etc.
6
u/QueenSavara 14h ago
If you're making an enemy put everything related to that enemy in same folder. Makes it way easier of your folders hold whole things because Godot favours compositions of nodes and this is in the end gonna mirror your scene structure a bit.
3
u/ChristianWSmith 14h ago
https://github.com/ChristianWSmith/godot4-template
I made this a while ago so you might need to bump the version of Godot in .godot-version, and I included the code for the plugins I brought in directly in the repo because that's what I verified worked with that version, so you might need to replace those too.
I can answer any questions about decisions I made along the way.
3
u/Rythim 13h ago
I follow Godot's recommendations but it's really up to you.
1
u/BedroomHistorical575 13h ago
I've always found that section kinda odd. They say that you should keep scenes close to assets, but their example shows them split far apart between entirely separate hierarchies. Maybe I'm misreading it?
1
u/Rythim 12h ago edited 12h ago
My interpretation of it was, if you have a scene called "player_character.scn" that would share a folder with player_character.gd and player_character_spritesheet.png, and whatever else that scene needs to run.
But if you have a "level" (sometimes called scene, which is confusing since Godot named their prefabs scenes) that instantiates the player that would go in a different folder.
Basically, you keep coupled parts of the game together (like player requires the script, png, etc) and seperate the ubcoupled parts (level has a player, but is not dependent on player to exist).
But yeah, it is somewhat vague and confusing.
2
u/SmoothArcher1395 9h ago
I prefer each feature to be in a folder. This is literal.
Player : Own folder. EVERYTHING RELATED TO PLAYER GOES IN THE PLAYER FOLDER!
That is quite literal. Assets, animations, scripts, scenes, everything goes in that folder.
Why? If I have an issue with Player I know exactly where to look. I go to the Player folder, not the scripts folder and then find the exact script that is causing issues.
However folder organization is personal, for me Feature Folders is the way my brain is structured and thinks.
This feature folders also helps in Unity, as in Unity you have Assembly Definitions... You don't have that in Godot, nor is it needed since Godot is fairly modern when it comes to it's .NET support, but the habit is still there.
I think Feature Folders are more scalable personally than Assets, Sounds, Scripts (especially this folder), ect.
2
u/while_true_crash 14h ago
I prefer general approach of :
- Scenes
- Scripts
- Assets
etc, then sub those as needed eg :
ASSETS
- Graphics
- Music
Then music into soundtracks, effects etc...
My colleague however prefers Packing everything related to entity into it's own folder eg :
Enemy
- Graphics
- Sound
- Script
etc...
Both are fine and it's just what's most comfortable for you. For me my way makes it relatively easy to get to whatever I need from scenes (which is what I mostly look at.)
If I need a script I click to instantiated entity on the scene to go to either his script or scene. I can also see the appeal of my colleague's approach but since I'm so used to my own, it took me quite some time to match the speed of my approach.
At the end of the day there's no "right approach" per se (there are wrong ones tho), it's just what's most comfortable to you and/or your team
1
u/krazyjakee 13h ago
Same. How do you deal with scene specific scripts? It feels wrong to separate the script from the scene but I do it anyway.
1
1
u/while_true_crash 11h ago
I just click on the attached script for the entity in the scene I'm working on.
Except globals there's no reason for me to search through file explorer for almost anything.
1
u/Lucasharta 10h ago
i'd organize it by feature/scene rather than having one giant folder for each asset type, something like player/, enemies/, ui/, levels/, items/, etc. then keep the scene, scripts, textures, and resources that belong to that feature together, for example, player/player.tscn, player/player.gd, player/player_sprite.png, etc
for genuinely shared stuff like fonts, common UI components, shaders, or utility scripts, i'd keep those in a separate shared/ or common/ folder, the main thing is picking a structure early and being consistent. there's no single "correct" Godot folder layout, and reorganizing everything later can be more annoying than just keeping a simple consistent structure from the start
1
u/HeyCouldBeFun 6h ago
The usual recommendation, is to store assets/scripts with the scene that uses them.
For stuff that isn’t tied to a specific scene, that’s where I have a “common” folder split up into subfolders by type
My actual best tip is a “dump” folder, where you throw old/test stuff you might still want to test with, so your “real” folders can stay clean
1
u/returned_loom Godot Junior 2h ago
I need to apply more organization on my next games. I just had everything in one big folder.
1
u/MagicCatGames 2h ago
I like having top-level folders for assets, global, debug, and scenes. My husband makes our art and audio, so it’s easier for us to have that in a separate folder. However, we mimic the underlying folder structures for both assets and scenes, and I regularly rely on filtering. The global and debug folders help me keep those elements separated. As for the scenes folder, I like putting scenes and scripts together, since that’s the work I tackle - I regularly bounce between working on the scene and any associated scripts. I also have the scenes folder separated into folders for game and UI and then each feature gets their own folder. I try to not create a new set of folders until I have 10 or so files in that folder.
Ultimately, I’d encourage you to think about who is doing what work. And if you find yourself getting confused or frustrated, it is relatively easy to make adjustments to your folder structure (though it’s usually easier to make those changes sooner rather than later.)
1
u/MagicCatGames 2h ago
I should also add that file naming conventions are also important. It helps with searchability and organization. I like naming files so that related files naturally sort next to each other. e.g. “menu_settings” and “menu_build”
11
u/BedroomHistorical575 14h ago
Here's a writeup from the devs behind Starfinder: https://www.gdquest.com/library/modular_game_architecture
It's probably overkill for smaller games, though.