Hello, avid game devs and fellow space explorers!
This week has been a fantastic day of progress for our cosmic adventure game project. Our team’s been busy refining our solar system generation script, and we’re thrilled with the strides we’ve made!
We started with an issue on asteroid spawning in our systems. The asteroids were congregating along the map’s edge, and only along the x-axis, which was far from ideal. The cosmos is three-dimensional, and we wanted our asteroids to represent that. So, we revisited our AddAsteroidFields function and successfully added a variation in the z-axis, allowing our asteroids to spawn at various depths.
One of the key changes we implemented was ensuring the asteroid field’s forward vectors always pointed toward the star, regardless of their location. Why? Our basic asteroid field object shape has a slight curvature to represent them gravitating around the most powerful orbit in a solar system – the star. As such, this tweak ensures that the curvature is always in the direction of the star.
Next on the agenda was the wreckage generation. We wanted our wreckages to feel more dynamic and realistic, so we added a random rotation factor upon their spawning. This gives each wreckage a unique appearance and orientation, adding to the feeling that these are remnants of past cosmic events.
Perhaps the most significant update of the day was the inclusion of space stations around the planets in our solar system. We’ve introduced a new data type, StationData, to represent these stations, which can be of numerous different types. A major rule we implemented was that planets with a space station would not have moons. This makes the presence of a station a significant and mutually exclusive event in our solar system generation.
To facilitate this, we had to augment our CelestialBodyGenerator class with a GenerateStation method and our SolarSystem with an AddStation method. The stations are now spawning correctly and at the appropriate locations, contributing to the depth and richness of our solar system generation.
Towards the end of the day, we also adjusted our AddJumpGate function. There was an issue where the JumpGate class was instantiated using the ‘new’ keyword, which, as we learned, doesn’t sit well with Unity’s MonoBehaviour. The solution? We’ve switched to creating a new GameObject and attaching the JumpGate component to it.
This week was all about refinement and moving our project forward, one celestial body at a time. It’s rewarding to see our codebase evolve and our solar systems take shape, becoming more vibrant and engaging. Our digital cosmos is steadily expanding, and we couldn’t be more excited to see where the next development cycle will take us.
As always, keep reaching for the stars, and happy coding!