diff options
Diffstat (limited to 'blog/dst')
-rw-r--r-- | blog/dst/g/godot_project_structure.html | 252 | ||||
-rw-r--r-- | blog/dst/index.html | 1 | ||||
-rw-r--r-- | blog/dst/rss.xml | 125 | ||||
-rw-r--r-- | blog/dst/sitemap.xml | 6 | ||||
-rw-r--r-- | blog/dst/tag/@english.html | 1 | ||||
-rw-r--r-- | blog/dst/tag/@gamedev.html | 1 | ||||
-rw-r--r-- | blog/dst/tag/@short.html | 1 |
7 files changed, 385 insertions, 2 deletions
diff --git a/blog/dst/g/godot_project_structure.html b/blog/dst/g/godot_project_structure.html new file mode 100644 index 0000000..7e3f0b5 --- /dev/null +++ b/blog/dst/g/godot_project_structure.html @@ -0,0 +1,252 @@ +<!DOCTYPE html> +<html class="theme-dark" lang="en" + prefix="og: https://ogp.me/ns#"> + <head> + <base href="https://static.luevano.xyz"> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>General Godot project structure -- Luévano's Blog</title> + <meta name="description" content"Details on the project structure I'm using for Godot, based on preference and some research I did."/> + <link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luévano's Blog RSS"> + <link rel="icon" href="images/icons/favicon.ico"> + + <!-- general style --> + <link rel="stylesheet" type="text/css" href="css/style.css"> + <link rel="stylesheet" type="text/css" href="fork-awesome/css/fork-awesome.min.css"> + <link rel="stylesheet" type="text/css" href="font-awesome/css/all.min.css"> + + <!-- highlight support for code blocks --> + <script type="text/javascript" src="hl/highlight.min.js"></script> + <!--<script type="text/javascript" src="hl/highlight-ln.min.js"></script>--> + <script type="text/javascript"> + hljs.initHighlightingOnLoad(); + // hljs.initLineNumbersOnLoad(); + </script> + + <!-- theme related --> + <script type="text/javascript" src="scripts/theme.js"></script> + <link id="theme-css" rel="stylesheet" type="text/css" href="css/theme.css"> + <link id="code-theme-css" rel="stylesheet" type="text/css" href="hl/styles/nord.min.css"> + + <!-- og meta --> + <meta property="og:title" content="General Godot project structure -- Luévano's Blog"/> + <meta property="og:type" content="article"/> + <meta property="og:url" content="https://blog.luevano.xyz/g/godot_project_structure.html"/> + <meta property="og:image" content="https://static.luevano.xyz//images/b/default.png"/> + <meta property="og:description" content="Details on the project structure I'm using for Godot, based on preference and some research I did."/> + <meta property="og:locale" content="en"/> + <meta property="og:site_name" content="Luévano's Blog"/> + </head> + + <body> + <header> + <nav> + <ul> + <li> + <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a> + </li> + + <li> + <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a> + </li> + + <li> + <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a> + </li> + + <li><i class="fab fa-git" alt="Git"></i><span>Git</span> + <ul> + <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li> + + <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li> + + <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li> + </ul> + </li> + + <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span> + <ul> + <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li> + </ul> + </li> + </ul> + </nav> + + <button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button> + </header> + + <main> + <h1>General Godot project structure</h1> + + <p>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.</p> +<p>The first place to look for is of course the official <em>Godot</em> documentation on <a href="https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html">Project organization</a>; 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:</p> +<ul> +<li>/models/town/house/<ul> +<li>house.dae</li> +<li>window.png</li> +<li>door.png</li> +</ul> +</li> +</ul> +<p>Where I would prefer to have more modularity, for example:</p> +<ul> +<li>/levels/structures/town/house (or /levels/town/structures/house)<ul> +<li>window/<ul> +<li>window.x</li> +<li>window.y</li> +<li>window.z</li> +</ul> +</li> +<li>door/<ul> +<li>…</li> +</ul> +</li> +<li>house.x</li> +<li>house.y</li> +<li>house.z</li> +</ul> +</li> +</ul> +<p>It might look like it’s more work, but I prefer it like this. I wish <a href="https://www.braindead.bzh/entry/creating-a-game-with-godot-engine-ep-2-project-organization">this site </a> 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 <a href="https://www.reddit.com/r/godot/comments/7786ee/comment/dojuzuf/?utm_source=share&utm_medium=web2x&context=3">this excelent comment on reddit</a> 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:</p> +<ul> +<li>/.git</li> +<li>/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)</li> +<li>/releases (executables ready to publish)</li> +<li>/src (the actual godot project)<ul> +<li>.godot/</li> +<li>actors/ (or entities)<ul> +<li>player/<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>enemy/ (this could be a dir with subdirectories for each type of enemy for example…)<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>actor.gd</li> +<li>…</li> +</ul> +</li> +<li>levels/ (or scenes)<ul> +<li>common/<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>main/<ul> +<li>…</li> +</ul> +</li> +<li>overworld/<ul> +<li>…</li> +</ul> +</li> +<li>dugeon/<ul> +<li>…</li> +</ul> +</li> +<li>Game.tscn (I consider the “game” itself a level/scene, so I’m including it here)</li> +<li>game.gd</li> +</ul> +</li> +<li>objects/<ul> +<li>box/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>screens/<ul> +<li>main_menu/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>globals/ (singletons/autoloads)</li> +<li>ui/<ul> +<li>menus/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>Main.tscn (the entry point of the game)</li> +<li>main.gd</li> +<li>icon.png</li> +<li>project.godot</li> +<li>…</li> +</ul> +</li> +<li>\<any other repository related files></li> +</ul> +<p>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.</p> + + <div class="page-nav"> + + <span class="index"> + <a href="https://blog.luevano.xyz" alt="Index"> + <i class="fas fa-home" alt="Home"></i> + <span>Index</span> + </a> + </span> + + <span class="previous"> + <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html" alt="Previous"> + <i class="fas fa-arrow-right" alt="Arrow right"></i> + <span>Previous</span> + </a> + </span> +</div> + + + <hr> + <div class="article-info"> + <p>By David Luévano</p> + <p>Created: Sun, May 22, 2022 @ 01:16 UTC</p> + <p>Modified: Sun, May 22, 2022 @ 01:23 UTC</p> + <div class="article-tags"> + <p>Tags: +<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@gamedev.html">gamedev</a>, <a href="https://blog.luevano.xyz/tag/@short.html">short</a> </p> +</div> + + </div> + </main> + + <footer> + <span> + <i class="fas fa-address-card" alt="Contact"></i> + <a href="https://luevano.xyz/contact.html">Contact</a> + </span> + + <span> + <i class="fas fa-donate" alt="Donate"></i> + <a href="https://luevano.xyz/donate.html">Donate</a> + </span> + + <span> + <i class="fas fa-rss" alt="RSS"></i> + <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a> + </span> + + <br> + <span class="created-with"> + <i class="fas fa-hammer" alt="Hammer"></i> + Created with <a href="https://github.com/luevano/pyssg">pyssg</a> + </span> + + <br> + <span class="copyright"> + Copyright <i class="far fa-copyright" alt="Copyright"></i> 2021 David Luévano Alvarado + </span> + </footer> + </body> +</html>
\ No newline at end of file diff --git a/blog/dst/index.html b/blog/dst/index.html index 228e2bc..320fe6b 100644 --- a/blog/dst/index.html +++ b/blog/dst/index.html @@ -95,6 +95,7 @@ <h2>Articles</h2> <ul class="page-list"> <h3>May 2022</h3> + <li>May 22 - <a href="https://blog.luevano.xyz/g/godot_project_structure.html">General Godot project structure</a></li> <li>May 17 - <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html">Will start blogging about gamedev</a></li> <li>May 15 - <a href="https://blog.luevano.xyz/a/password_manager_authenticator_setup.html">My setup for a password manager and MFA authenticator</a></li> <li>May 15 - <a href="https://blog.luevano.xyz/a/devs_android_me_trozaron.html">Los devs de Android/MIUI me trozaron</a></li> 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>Copyright 2021 David Luévano Alvarado</copyright> <managingEditor>david@luevano.xyz (David Luévano Alvarado)</managingEditor> <webMaster>david@luevano.xyz (David Luévano Alvarado)</webMaster> - <pubDate>Sun, 22 May 2022 00:27:08 GMT</pubDate> - <lastBuildDate>Sun, 22 May 2022 00:27:08 GMT</lastBuildDate> + <pubDate>Sun, 22 May 2022 01:23:08 GMT</pubDate> + <lastBuildDate>Sun, 22 May 2022 01:23:08 GMT</lastBuildDate> <generator>pyssg v0.7.2</generator> <docs>https://validator.w3.org/feed/docs/rss2.html</docs> <ttl>30</ttl> @@ -24,6 +24,127 @@ <link>https://blog.luevano.xyz</link> </image> <item> + <title>General Godot project structure</title> + <link>https://blog.luevano.xyz/g/godot_project_structure.html</link> + <guid isPermaLink="true">https://blog.luevano.xyz/g/godot_project_structure.html</guid> + <pubDate>Sun, 22 May 2022 01:16:10 GMT</pubDate> + <category>English</category> + <category>Gamedev</category> + <category>Short</category> + <description>Details on the project structure I'm using for Godot, based on preference and some research I did.</description> + <content:encoded><![CDATA[<p>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.</p> +<p>The first place to look for is of course the official <em>Godot</em> documentation on <a href="https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html">Project organization</a>; 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:</p> +<ul> +<li>/models/town/house/<ul> +<li>house.dae</li> +<li>window.png</li> +<li>door.png</li> +</ul> +</li> +</ul> +<p>Where I would prefer to have more modularity, for example:</p> +<ul> +<li>/levels/structures/town/house (or /levels/town/structures/house)<ul> +<li>window/<ul> +<li>window.x</li> +<li>window.y</li> +<li>window.z</li> +</ul> +</li> +<li>door/<ul> +<li>…</li> +</ul> +</li> +<li>house.x</li> +<li>house.y</li> +<li>house.z</li> +</ul> +</li> +</ul> +<p>It might look like it’s more work, but I prefer it like this. I wish <a href="https://www.braindead.bzh/entry/creating-a-game-with-godot-engine-ep-2-project-organization">this site </a> 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 <a href="https://www.reddit.com/r/godot/comments/7786ee/comment/dojuzuf/?utm_source=share&utm_medium=web2x&context=3">this excelent comment on reddit</a> 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:</p> +<ul> +<li>/.git</li> +<li>/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)</li> +<li>/releases (executables ready to publish)</li> +<li>/src (the actual godot project)<ul> +<li>.godot/</li> +<li>actors/ (or entities)<ul> +<li>player/<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>enemy/ (this could be a dir with subdirectories for each type of enemy for example…)<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>actor.gd</li> +<li>…</li> +</ul> +</li> +<li>levels/ (or scenes)<ul> +<li>common/<ul> +<li>assets/</li> +<li>sprites/</li> +<li>…</li> +</ul> +</li> +<li>main/<ul> +<li>…</li> +</ul> +</li> +<li>overworld/<ul> +<li>…</li> +</ul> +</li> +<li>dugeon/<ul> +<li>…</li> +</ul> +</li> +<li>Game.tscn (I consider the “game” itself a level/scene, so I’m including it here)</li> +<li>game.gd</li> +</ul> +</li> +<li>objects/<ul> +<li>box/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>screens/<ul> +<li>main_menu/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>globals/ (singletons/autoloads)</li> +<li>ui/<ul> +<li>menus/<ul> +<li>…</li> +</ul> +</li> +<li>…</li> +</ul> +</li> +<li>Main.tscn (the entry point of the game)</li> +<li>main.gd</li> +<li>icon.png</li> +<li>project.godot</li> +<li>…</li> +</ul> +</li> +<li>\<any other repository related files></li> +</ul> +<p>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.</p>]]></content:encoded> + </item> + <item> <title>Will start blogging about gamedev</title> <link>https://blog.luevano.xyz/g/starting_gamedev_blogging.html</link> <guid isPermaLink="true">https://blog.luevano.xyz/g/starting_gamedev_blogging.html</guid> diff --git a/blog/dst/sitemap.xml b/blog/dst/sitemap.xml index f966905..4ca84e6 100644 --- a/blog/dst/sitemap.xml +++ b/blog/dst/sitemap.xml @@ -3,6 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> + <loc>https://blog.luevano.xyz/g/godot_project_structure.html</loc> + <lastmod>2022-05-22</lastmod> + <changefreq>weekly</changefreq> + <priority>1.0</priority> + </url> + <url> <loc>https://blog.luevano.xyz/g/starting_gamedev_blogging.html</loc> <lastmod>2022-05-22</lastmod> <changefreq>weekly</changefreq> diff --git a/blog/dst/tag/@english.html b/blog/dst/tag/@english.html index 017dea5..7c75b2a 100644 --- a/blog/dst/tag/@english.html +++ b/blog/dst/tag/@english.html @@ -81,6 +81,7 @@ <h2>Articles</h2> <ul class="page-list"> <h3>May 2022</h3> + <li>May 22 - <a href="https://blog.luevano.xyz/g/godot_project_structure.html">General Godot project structure</a></li> <li>May 17 - <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html">Will start blogging about gamedev</a></li> <li>May 15 - <a href="https://blog.luevano.xyz/a/password_manager_authenticator_setup.html">My setup for a password manager and MFA authenticator</a></li> <h3>August 2021</h3> diff --git a/blog/dst/tag/@gamedev.html b/blog/dst/tag/@gamedev.html index cf23f17..076288e 100644 --- a/blog/dst/tag/@gamedev.html +++ b/blog/dst/tag/@gamedev.html @@ -81,6 +81,7 @@ <h2>Articles</h2> <ul class="page-list"> <h3>May 2022</h3> + <li>May 22 - <a href="https://blog.luevano.xyz/g/godot_project_structure.html">General Godot project structure</a></li> <li>May 17 - <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html">Will start blogging about gamedev</a></li> </ul> diff --git a/blog/dst/tag/@short.html b/blog/dst/tag/@short.html index a630c96..3a506a9 100644 --- a/blog/dst/tag/@short.html +++ b/blog/dst/tag/@short.html @@ -81,6 +81,7 @@ <h2>Articles</h2> <ul class="page-list"> <h3>May 2022</h3> + <li>May 22 - <a href="https://blog.luevano.xyz/g/godot_project_structure.html">General Godot project structure</a></li> <li>May 17 - <a href="https://blog.luevano.xyz/g/starting_gamedev_blogging.html">Will start blogging about gamedev</a></li> <li>May 15 - <a href="https://blog.luevano.xyz/a/password_manager_authenticator_setup.html">My setup for a password manager and MFA authenticator</a></li> <h3>April 2022</h3> |