Procedural Galaxy Generator

Hello everyone

Yesterday , by pausing on my main game project , i made a procedural galaxy generator script,

his goal is to generate a galaxy in its simplest form

the script is able to generate :
Stars
Planets with different properties
Nebulae
Black holes

this script has no utilites but it’s very easy to customize and I think I might get something out of it.

I share it with you also to show you my way of programming, it’s true that I would have organized it with modules script but at least everything fits in one script so you can copy it very simply.

copy and paste the code into a script, put it in the workspace and wait ^^ , (Do whatever you want with )

The script : -- Galaxy Generator by Sheppard929/Sheppowedwait(3)-- GENERATION VARS ---- - Pastebin.com



EDIT : I created a giant galaxy (40 000 studs XZ x 2048 studs Y)

8 Likes

now make it generate a prcoedural planet from terrain voxels when u touch it

It might be cool, but if I do it I think I’ll make a much cleaner code than this one to allow for more complex additions.

but it won’t be for a while, I already have some projects to do before

Moreover it is necessary to know that the stars / planets are relatively small on this generation, we can make them bigger of course

For my space game what I did for the procedural planets was have them generate points around the 3d space like you did then make a billboard gui giving the illusion it is massive. from there i had them teleport to a seperate game which used perlin to generate voxels which then were filled with terrain

it’s a pretty cool technique, if I have time I should experiment things just to make a game with a giant galaxy without lagging behind, but later

dude this is really awesome, I’m sure this will help alot of people with upcoming space games in the near future.