Building a Procedural Solar System in Godot

in #gamedev4 years ago

As an exercise, for the last week I tasked myself with building a procedural solar system in Godot. I'm a big fan of sci-fi and I love space games so I wanted my next project to be something that would scratch that sci-fi itch. I also wanted to flex Godot's new 3D engine and see what it could handle while also testing out some ideas I have had. As it turns out the workflow in Godot was really good for this type of task, although there were a few minor annoyances that should get cleared up in the next couple bug fixing releases.

The program itself is very lightweight. A system is generated in a few seconds and and you can fly around the planets with a pretty stable frame rate. The variety it generates is okay. I will likely continue tweaking parameters to increase the variety a bit, especially for the planets.

Here are a few sample pictures from the current state of the generator.

Current Features
  • Procedural Planets
  • Procedural Atmospheres
  • Procedural Stars
  • Procedural Nebulas
  • Flexible HUD using signed distance functions
Planned Features
  • Procedural Ships
  • Asteroid Fields
  • Dense Space Fog
  • Flying into Planetary Atmosphere
  • Space Stations

My favorite part of making the solar system was working on the background nebulae. I have often played around with small experiments, but this was my first time actually trying to implement my different ideas. In the end I took a lot of inspiration from different shadertoys in implementing the nebula.

The planets were the next most fun. Each planet has a different chemical makeup which determines its color and the color of its atmosphere. While these values are not based on real physics they are unique to each planet.

This planet has a dark green atmosphere. Its oceans are made of a similar substance and so they appear to be a darker shade of the same green

With everything put together the solar system looks like this.

Clearly the whole is less than the sum of its parts. I have spent so much time on each element of the system in isolation that when put together it feels as if it is seriously lacking something. You can see here in lieu of a ship I am just using a rectangular box. In the future I will continue working to improve the overall cohesiveness of the entire system. Thus far I have only focused on each specific feature.

If you have any questions feel free to comment, I'd love to go into more detail on how varies aspects of the system work for those interested. Also if anyone is working on something similar let me know so we can discuss various technical problems.


Looks great. Would be nice to see the source code. Is it on GitHub?

It isn't right now. But it will be soon. I am using a custom release of Godot that I built from source because of a few bugs. I don't want to release the code until people can run it with the current version of Godot. Recently the fixes were merged into the master branch though so once Godot does their 3.1 release I will release the source code.

Would you post a tutorial on how you did this?

I'd really like to do that. It will likely come after the Godot 3.1 release. For the same reasons as stated above.

Looks beautiful! You can just say the ship is a monolith :)

Great idea! Haha. If i ever did turn this into a release quality demo i think i would experiment with some simple procedural ships too.

Coin Marketplace

STEEM 0.42
TRX 0.07
JST 0.052
BTC 43135.54
ETH 3351.12
BNB 501.00
SBD 4.97