From 9ed5d09180b6c975d60828265a2cd1eee9ac1ab4 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Mon, 23 May 2022 22:38:49 -0600 Subject: edit godot project structure entry --- blog/dst/rss.xml | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'blog/dst/rss.xml') diff --git a/blog/dst/rss.xml b/blog/dst/rss.xml index d815b06..e97bc22 100644 --- a/blog/dst/rss.xml +++ b/blog/dst/rss.xml @@ -13,8 +13,8 @@ Copyright 2021 David Luévano Alvarado david@luevano.xyz (David Luévano Alvarado) david@luevano.xyz (David Luévano Alvarado) - Sun, 22 May 2022 01:23:08 GMT - Sun, 22 May 2022 01:23:08 GMT + Tue, 24 May 2022 04:35:41 GMT + Tue, 24 May 2022 04:35:41 GMT pyssg v0.7.2 https://validator.w3.org/feed/docs/rss2.html 30 @@ -32,8 +32,8 @@ 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:

+ 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 and after trying some of them I wanted to write down somewhere what I’m sticking with.

+

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
    • @@ -61,33 +61,32 @@
-

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:

+

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 and was a pretty good resource, but apparently the owner is not maintaining his site anymore; but there is this excelent comment on reddit which shows a project/directory structure more in line with what I’m currently using (and similr to the site that is down that I liked). I ended 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)
  • +
  • /assets (raw assets/editable assets/asset packs)
  • /releases (executables ready to publish)
  • /src (the actual godot project)
    • .godot/
    • actors/ (or entities)
      • player/
          -
        • assets/
        • sprites/
        • +
        • player.x
      • enemy/ (this could be a dir with subdirectories for each type of enemy for example…)
          -
        • assets/
        • sprites/
        • +
        • enemy.x
      • -
      • actor.gd
      • +
      • actor.x
    • levels/ (or scenes)
      • common/
          -
        • assets/
        • sprites/
        @@ -104,7 +103,7 @@
    • -
    • Game.tscn (I consider the “game” itself a level/scene, so I’m including it here)
    • +
    • Game.tscn (I’m considering the “Game” as a level/scene)
    • game.gd
  • @@ -133,16 +132,28 @@
+
  • sfx/
      +
    • +
    +
  • +
  • vfx/
      +
    • +
    +
  • +
  • etc/
      +
    • +
    +
  • Main.tscn (the entry point of the game)
  • main.gd
  • -
  • icon.png
  • +
  • icon.png (could also be on a separate “icons” directory)
  • 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.

    ]]>
    +

    And so on, I hope the idea is clear. I’ll probably change my mind on the long run, but for now this has been working fine.

    ]]>
    Will start blogging about gamedev -- cgit v1.2.3-54-g00ecf