Creating Galaxy Pathways in Our Space Exploration Game


Over the past few days, our team has been knee-deep in code, working on an exciting yet complex aspect of our space exploration game: generating galaxy pathways connecting stars in a dynamically created universe.

The primary challenge has been the procedural generation of these pathways between stars. The system must follow certain rules, such as only linking nearby stars and considering the type of star, which dictates how many paths it can support. This task requires a delicate balance of artificial intelligence and mathematical logic, which we've implemented in GDScript using Godot's powerful game development engine.

One of our initial hurdles involved the star comparison logic. To sort stars based on proximity, we introduced a custom comparator class, 'StarComparator'. After some trial and error, we successfully managed to get it to compare the global positions of stars, allowing us to establish connections based on actual distance in the game's world space.

Another obstacle involved ensuring no star exceeded its max path limit. This required the introduction of additional checks before adding a new pathway between stars, taking into account the maximum path count based on the star type.

However, we're currently facing challenges with the physical distribution and scaling of the pathways. Initial testing yielded an output that resembled more of a 'starburst' effect than the intended network of pathways. We've attempted to fine-tune this by adjusting a scaling factor and reintroducing a MAX_DISTANCE constraint for defining 'nearby' stars, but placement issues persist.

Despite these ongoing challenges, we are making steady progress. The joy of game development often lies in problem-solving and fine-tuning. As we continue to refine the code and improve the pathway generation, we are confident that we'll soon have a beautifully connected galaxy ready for exploration. This endeavor perfectly encapsulates the essence of game development: turning complex code into engaging and visually pleasing experiences. We're looking forward to sharing more updates soon!

Files

star_generationMKII.zip Play in browser
Jul 20, 2023

Leave a comment

Log in with itch.io to leave a comment.