Planets & Portals


A short Space Blog

Planets feature is almost done! I use 6 different places, with 'PlanetChunks'. Each has a height map/other maps of its own. This is used to compose the final terrain. Before on a XZ plane, I would use a heightmap on each chunk. Now it's a bit more complicated, but much cooler for space stuff.

The idea of adding planets wasn't just for cool factor, it was to add to the fantasy of a voxel space/universe. I wanted it to feel more like a universe. I played starmade in beta, and they had planets, but they did not have these kinds. Just like a floating platform. I really wanted it to feel like a small little world.

After the generation, in which I originally just had a cube based on a planet radius, I had to modify physics and the character controller. This took close to a month and was painful, but through the pain I was able to become more proficient in mathematics again and become more fluent in debug lines haha. When you reach over the edge, the gravity flips the characters rotation. It stores a 'gravity quadrant' byte on each character or physics object.  The only issue is, when I ramp up the height map of the world, the falling distance increases. So I will need something like a gravity field later for this. I also had to add in rotation support for AI behaviours.

I also had to readd all the world generation systems again from scratch, as they no longer would work with the new chunks. The good thing is i've made some improvements. For example, trees now can generate across chunks.  Before I didn't account for the Y chunks. This made me have to rewrite most of my engine haha... Luckily it was organized really well. I haven't uploaded the games build in a while because this update has temporarily broken features, so I did not want to update until they were all fixed. Regression isn't fun!



I improved the Portals :) I finally got the synch working perfectly! The travel systems are still a little buggy, so I dare not enter them. I will hopefully fix those soon. I want to make it so you pay a mage in a city, and can enter a portal from one side of the world to the other seemlessly. This should make space seem less daunting. I also want to use portals in puzzle rooms. I'm a huge portal fan. I feel like I can combine these with logic gates (redstone like logic) and more.

The mathematics was complicated, but essentially I reposition camera based on the main camera, and recalculate it's projection matrix! I did it a while ago, it took several iterations to perfect. It's only by adding asmdefs to my project, and organizing all the sub namespaces, that I was able to clean it up. My project has 666 systems atm so it can be difficult to manage. But asmdef files make it iterate faster by controlling the compilation, and also make me organize dependencies better! I also have all custom rendering and physics, so it makes it easier to manage the pipelines :)

Hopefully I can publish these features in the next month! But RL can be very hectic haha.

Get Zoxel

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.