Subzero Tides Devlog


Hello itch.io

First Subzero Tides devlog will focus on some technical implementations in the Godot 4 engine during the development of the Subzero Tides Contents:

  1. Quick UI prototyping.
  2. Importing 3D world mesh
  3. Managing Colonists AI

1. Quick UI prototyping:

The topic of this tutorial is a basic workflow I am using to create complex UI scenes. It is probably nowhere near optimal, but it makes sense for me, as what is most important to me is that I retain full control over where and how I want UI components displayed horizontally or vertically. Example setup is a setup from the UI of my current project.

Basic setup is as follows:

  • Control Node
  • TextureRect with a background.

Then comes a series of Hbox Containers which get displayed or hidden (Tabs, Panel Overview, Route Planner, Market, Diplomacy, etc). Basically menu and and menu items.

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

Building vertically

Next, when I expand the example tab in the screenshot above (Research) I first control vertical layout of the elements with the following structure:

Vbox container with the following nodes as child nodes

  • A series of Hbox containers with custom minimum size for Y axis.
  • Margin Containers when I want to add in a blank space.

Similar logic applies when I want to control horizontal elements.

  • Margin container with the custom minimum size on X axis
  • A series of control cones containing research tree elements.
  • Each control node contains a series of Vbox containers

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

Building Horizontal elements

If I were to expand the above highlighted Vbox container, it again contains the usual suspects; Hbox container, Margin containers and TextureRect.

Point to remember here is that you can create complex UI with only the following built-in nodes:

  • Control Node
  • TextureRect
  • Hbox Container
  • Vbox Container
  • Margin Containers
  • Label for adding text.

2. Importing 3D world mesh

You can use 3D world of your choice here, be it in Blender or some other software. I am using Gaea which has a free version, but you have to buy a license if you want to export high resolution textures. I am not going to go into the details of creating the terrain in Gaea here, but just for the reference, the files I have ready before I start working in the Godot engine are:

  • exported mesher.obj
  • exported Albedo texture (4K)
  • exported Normal map (4K)

Next, you import the mesher.obj into Godot engine. For the purposes of having organized scene I added a StaticBody3D with an imported mesher.obj as a MeshInstance3D, under which you have an option to create a CollisionShape3D in the menu under Mesh dropdown, depending on your needs and how accurate you need the collisions to be.

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

Importing Mesh

You add a Surface material override to the mesher object and texture your mesh with the imported externally created textures. Depending on your needs, you might want to experiment with the other settings too, but for my needs what works is Albedo and Normal map.

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

NavigationRegion3D settings

Next step is adding Navigation to your map, for this I am using NavigationRegion3D, I added all objects with collision shapes as a child of the NavigationRegion3D. When adding NavigationMesh you need to experiment with the Sampling, Geometry, Cells, Agents, Regions, Edges, Polygons and Details setting to get smooth navigation. This is work in progress, but settings that work for me are visible in the screenshot above.

This concludes this devlog. It didn't go into much details, more so because the NavigationRegion3D is subject to change so future updates are likely. I also went through this workflow quite some time ago so if you run into some problems replicating it feel free to contact me.

3, Managing Colonists AI

Having colonists presents an unique challenge as they need to track many events across the game world. For example:

  • where is the nearest resource type ?
  • where is the nearest stockpile ?
  • where are the nearest ice cubes waiting for transport ?
  • nearest processing plant ?
  • nearest building object ?
  • nearest resource of any type ?

The approach I took relies mostly on using Groups. Resources, Stockpiles, Building Objects, and other object are placed in the corresponding group. Then actors simply scan for the nearest object and feed it into the state machine.

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

Scanning for resources

As there are potentially many actors scanning for items across the game world I did want to measure how expansive are these actions beyond the data presented in the built in debugger. For this purpose I am running simple tests as seen below and the results are at around 5 – 10 MS per action on 1000 iterations, which is completely fine for now.

r/godot - Text tutorials/devlogs batch: Importing 3D world mesh, UI prototyping & colonists AI

Running benchmark tests

This concludes the first batch of the devlogs/tutorials. I will be posting these on my website . If you have any questions feel free to ask and I will try to answer them and if you want me to create a specific devlog/tutorial in the future let me know in the comments.

Get Subzero Tides

Leave a comment

Log in with itch.io to leave a comment.