How do I randomly generate solar systems with a star and planets

Here is everything I want help with in this post:

  1. I want to be able to randomly generate planets arranged in a solar system with a sun in the middle and a limited amount of planets in each solar system(I want to generate multiple during runtime).

  2. I would like each planet to belong to an orbit that moves around the center point(the sun, which would be an actor). I would like each orbit to be different, some perfect circles, ellipticals, some slanted, some that make the planet go in the opposite direction, some the get super close to the sun and then shoot out into space until it gets close again, yknow, variety.

  3. I would like each star to have a random but not too random( not something like dhfbhddjiskszjajdh 5) name and each planet be randomly named or named after their star. I want the name to be changeable by the player and to have a star map that shows each each solar system that you can travel to. Basically like no mans sky mechanics and galaxia.

Please do not direct me to the marketplace or any downloads or plugins unless there is absolutely no other way. Also, suppose I have already created planet actors. And finally, I would like all of this to be in blueprints. Thank you for taking time to help me if you do.

You’re basically asking someone to design an entire game for you :slight_smile:

The planet and sun part is not too bad, but the stars is a whole other thing.

In BP, each planet would have to know which sun it is to orbit around and can then contain the code to do this in a ‘random’ manner. You could spawn each solar system based on the total size of the collision box so you don’t get overlapping systems.

But for the stars, you can’t fill the map with stars, it will never run. So you probably have to use a picture of stars, but it is possible to zoom in on some areas, and there you will find a solar system.

Ok sorry if I was asking a lot. What if it wasn’t random. I’ll change the question to: how can I get an actor to revolve around an object of my choosing at a set speed?

Well, that bit’s not too bad, and once done, the angle and shape could probably be randomized fairly easily. How many planets per solar system? 10-20 or hundreds?

Probably like max 4. I can adjust it later but for now 4 is the max

So I made this:

287942-system.gif

I’ve attached the code in text files ( you just open the text file, copy all and paste into the BP sheet ).

[link text][2]
[link text][3]

The vars in the main BP are:

287946-vars.jpg

It’s a little clunky but works pretty well. One limitation is the planets are a fixed distance apart.

If you can’t get it working, tell me, and I’ll give you a project link.

( PS, the BP contains no meshes, everything is spawned, planets are random sized and move at random speeds ).

Thank you so much.