One of my first issues when starting a project is how to structure everything. So I had to spend some time researching best practices and go with what I like the most.
+
The first place to look for is of course the official Godot documentation on Project organization; along with project structure discussion, also comes with best practices for code style and what-not. I don’t like this project/directory structure that much, just because it tells you to bundle everything under the same directory but it’s a really good starting point, for example it tells you to use:
+
+
/models/town/house/
+
house.dae
+
window.png
+
door.png
+
+
+
+
Where I would prefer to have more modularity, for example:
It might look like it’s more work, but I prefer it like this. I wish this site was still available, as I got most of my ideas from there, but apparently the owner is not maintaining his site anymore; but there is this excelent comment on reddit which shows a project/sirectory structure more in line with what I’m currently using (and similr to the site that is down that I liked that much). I just do somethings a bit different, and end up with:
+
+
/.git
+
/assets (raw assets/editable assets for their respective software, could also be the whole imported assets from some packs, where you can just select few of them to actually use)
+
/releases (executables ready to publish)
+
/src (the actual godot project)
+
.godot/
+
actors/ (or entities)
+
player/
+
assets/
+
sprites/
+
…
+
+
+
enemy/ (this could be a dir with subdirectories for each type of enemy for example…)
+
assets/
+
sprites/
+
…
+
+
+
actor.gd
+
…
+
+
+
levels/ (or scenes)
+
common/
+
assets/
+
sprites/
+
…
+
+
+
main/
+
…
+
+
+
overworld/
+
…
+
+
+
dugeon/
+
…
+
+
+
Game.tscn (I consider the “game” itself a level/scene, so I’m including it here)
+
game.gd
+
+
+
objects/
+
box/
+
…
+
+
+
…
+
+
+
screens/
+
main_menu/
+
…
+
+
+
…
+
+
+
globals/ (singletons/autoloads)
+
ui/
+
menus/
+
…
+
+
+
…
+
+
+
Main.tscn (the entry point of the game)
+
main.gd
+
icon.png
+
project.godot
+
…
+
+
+
\<any other repository related files>
+
+
And so on, I hope the idea is clear. Basically you need to abstract some entity/object that you’re going to use into its more basic form and use subdirectories for each level of abstraction (a player is an actor and thus we use actor/player; a box is part of the world, and is a level so we can use levels/common/decor/box or something like that). Once you have the most basic abstraction done, anything that belongs to that abstraction will have all of its assets/sounds/shaders/etc in it’s directory.
diff --git a/blog/dst/rss.xml b/blog/dst/rss.xml
index 8139408..d815b06 100644
--- a/blog/dst/rss.xml
+++ b/blog/dst/rss.xml
@@ -13,8 +13,8 @@
Copyright 2021 David Luévano Alvaradodavid@luevano.xyz (David Luévano Alvarado)david@luevano.xyz (David Luévano Alvarado)
- Sun, 22 May 2022 00:27:08 GMT
- Sun, 22 May 2022 00:27:08 GMT
+ Sun, 22 May 2022 01:23:08 GMT
+ Sun, 22 May 2022 01:23:08 GMTpyssg v0.7.2https://validator.w3.org/feed/docs/rss2.html30
@@ -23,6 +23,127 @@
Luévano's Blog
https://blog.luevano.xyz
+
+ General Godot project structure
+ https://blog.luevano.xyz/g/godot_project_structure.html
+ https://blog.luevano.xyz/g/godot_project_structure.html
+ Sun, 22 May 2022 01:16:10 GMT
+ English
+ Gamedev
+ Short
+ Details on the project structure I'm using for Godot, based on preference and some research I did.
+ One of my first issues when starting a project is how to structure everything. So I had to spend some time researching best practices and go with what I like the most.
+
The first place to look for is of course the official Godot documentation on Project organization; along with project structure discussion, also comes with best practices for code style and what-not. I don’t like this project/directory structure that much, just because it tells you to bundle everything under the same directory but it’s a really good starting point, for example it tells you to use:
+
+
/models/town/house/
+
house.dae
+
window.png
+
door.png
+
+
+
+
Where I would prefer to have more modularity, for example:
It might look like it’s more work, but I prefer it like this. I wish this site was still available, as I got most of my ideas from there, but apparently the owner is not maintaining his site anymore; but there is this excelent comment on reddit which shows a project/sirectory structure more in line with what I’m currently using (and similr to the site that is down that I liked that much). I just do somethings a bit different, and end up with:
+
+
/.git
+
/assets (raw assets/editable assets for their respective software, could also be the whole imported assets from some packs, where you can just select few of them to actually use)
+
/releases (executables ready to publish)
+
/src (the actual godot project)
+
.godot/
+
actors/ (or entities)
+
player/
+
assets/
+
sprites/
+
…
+
+
+
enemy/ (this could be a dir with subdirectories for each type of enemy for example…)
+
assets/
+
sprites/
+
…
+
+
+
actor.gd
+
…
+
+
+
levels/ (or scenes)
+
common/
+
assets/
+
sprites/
+
…
+
+
+
main/
+
…
+
+
+
overworld/
+
…
+
+
+
dugeon/
+
…
+
+
+
Game.tscn (I consider the “game” itself a level/scene, so I’m including it here)
+
game.gd
+
+
+
objects/
+
box/
+
…
+
+
+
…
+
+
+
screens/
+
main_menu/
+
…
+
+
+
…
+
+
+
globals/ (singletons/autoloads)
+
ui/
+
menus/
+
…
+
+
+
…
+
+
+
Main.tscn (the entry point of the game)
+
main.gd
+
icon.png
+
project.godot
+
…
+
+
+
\<any other repository related files>
+
+
And so on, I hope the idea is clear. Basically you need to abstract some entity/object that you’re going to use into its more basic form and use subdirectories for each level of abstraction (a player is an actor and thus we use actor/player; a box is part of the world, and is a level so we can use levels/common/decor/box or something like that). Once you have the most basic abstraction done, anything that belongs to that abstraction will have all of its assets/sounds/shaders/etc in it’s directory.
diff --git a/blog/src/.files b/blog/src/.files
index da91401..1542439 100644
--- a/blog/src/.files
+++ b/blog/src/.files
@@ -14,3 +14,4 @@ a/volviendo_a_usar_la_pagina.md 1651116062.9191298 1651116501.5491333 0f36388a5a
a/devs_android_me_trozaron.md 1652608264.4901433 1652609027.0201497 41c897ac0c6e0bd66f67ddc8286f4413 rant,spanish,update
a/password_manager_authenticator_setup.md 1652654434.4686146 1653179084.149559 ccd90b7bb896f09438696bb793eb6138 english,short,tools
g/starting_gamedev_blogging.md 1652764794.9016073 1653179221.26956 2d6665cebea06ff376dbde9643a893c4 english,gamedev,short,update
+g/godot_project_structure.md 1653182170.4395845 1653182586.3895879 791ab9c902aa15d66218e1e6e6191491 english,gamedev,short
diff --git a/blog/src/g/godot_project_structure.md b/blog/src/g/godot_project_structure.md
new file mode 100644
index 0000000..f69a74d
--- /dev/null
+++ b/blog/src/g/godot_project_structure.md
@@ -0,0 +1,82 @@
+title: General Godot project structure
+author: David Luévano
+lang: en
+summary: Details on the project structure I'm using for Godot, based on preference and some research I did.
+tags: gamedev
+ short
+ english
+
+One of my first issues when starting a project is how to structure everything. So I had to spend some time researching best practices and go with what I like the most.
+
+The first place to look for is of course the official *Godot* documentation on [Project organization](https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html); along with project structure discussion, also comes with best practices for code style and what-not. I don't like this project/directory structure that much, just because it tells you to bundle everything under the same directory but it's a really good starting point, for example it tells you to use:
+
+- /models/town/house/
+ - house.dae
+ - window.png
+ - door.png
+
+Where I would prefer to have more modularity, for example:
+
+- /levels/structures/town/house (or /levels/town/structures/house)
+ - window/
+ - window.x
+ - window.y
+ - window.z
+ - door/
+ - ...
+ - house.x
+ - house.y
+ - house.z
+
+It might look like it's more work, but I prefer it like this. I wish [this site ](https://www.braindead.bzh/entry/creating-a-game-with-godot-engine-ep-2-project-organization) was still available, as I got most of my ideas from there, but apparently the owner is not maintaining his site anymore; but there is [this excelent comment on reddit](https://www.reddit.com/r/godot/comments/7786ee/comment/dojuzuf/?utm_source=share&utm_medium=web2x&context=3) which shows a project/sirectory structure more in line with what I'm currently using (and similr to the site that is down that I liked that much). I just do somethings a bit different, and end up with:
+
+- /.git
+- /assets (raw assets/editable assets for their respective software, could also be the whole imported assets from some packs, where you can just select few of them to actually use)
+- /releases (executables ready to publish)
+- /src (the actual godot project)
+ - .godot/
+ - actors/ (or entities)
+ - player/
+ - assets/
+ - sprites/
+ - ...
+ - enemy/ (this could be a dir with subdirectories for each type of enemy for example...)
+ - assets/
+ - sprites/
+ - ...
+ - actor.gd
+ - ...
+ - levels/ (or scenes)
+ - common/
+ - assets/
+ - sprites/
+ - ...
+ - main/
+ - ...
+ - overworld/
+ - ...
+ - dugeon/
+ - ...
+ - Game.tscn (I consider the "game" itself a level/scene, so I'm including it here)
+ - game.gd
+ - objects/
+ - box/
+ - ...
+ - ...
+ - screens/
+ - main_menu/
+ - ...
+ - ...
+ - globals/ (singletons/autoloads)
+ - ui/
+ - menus/
+ - ...
+ - ...
+ - Main.tscn (the entry point of the game)
+ - main.gd
+ - icon.png
+ - project.godot
+ - ...
+- \
+
+And so on, I hope the idea is clear. Basically you need to abstract some entity/object that you're going to use into its more basic form and use subdirectories for each level of abstraction (a player is an actor and thus we use actor/player; a box is part of the world, and is a level so we can use levels/common/decor/box or something like that). Once you have the most basic abstraction done, anything that belongs to that abstraction will have all of its assets/sounds/shaders/etc in it's directory.
\ No newline at end of file
--
cgit v1.2.3-70-g09d2