Would it be possible to make an auto generated planet? I want to make it so random planets will be generated, with different environments and stuff like that. But i’m not sure if it’s actually possible.
There are many algorithms to procedurally generate terrain and you could use one. But could you please be more specific with the whole planets thing?
It’s very possible and i’ve been working on my own script slowly too, althougb I haven’t gotten very far.
I suggest looking into Perlin Noise if you wish to generate terrain too.
This is a very interesting read, and can be used for other random generations too.
You may wish to use and look into functions like math.random() or better yet Random.new() and look into using those as well.
I can’t provide much more detail since i’ve not spent too much time on it myself. You would likley have lists or dictionaries storing different planet types etc. The article mentions possible settings you can add for generating random biomes. I suggest paying close attention the the part where it shows how to generate “islands,” or rather maps where theres ordinary terrain in the middle which becomes oceans at the edges, in order to create finite worlds. Of course, this can be tweaked to create tall hills surrounding the map too.
If you don’t wish to use terrain, this is a less resource intensive option but may have some additional limits. Combined with the article’s knowledge, you could do great things:
Another benefit of not using terrain is you can have steeper hollow terrain. Only generating the surface layer with terrain can lead to holes, although if you want to be fancy you could program the terrain to be deeper when steeper to prevent holes, or just not have very jaggy hills.
When adapting the knowledge for planets, since planets will have generally different climates, if you are using humidity maps etc to randomise biomes, which the article also explains, you may wish to add additional variables for the “limits” and “range” for humidity/temperature, dependent on the “planet type”
Here is a plugin that does client-side infinite terrain very well.
I just tried it out and it is very good but do you know if there’s a way to make the terrain go into a sphere?
No the plugin is based on a heightmap that doesn’t support 3D shapes, it might be better to fake the planets than have a slight curve; unless you already have code to support walking around a sphere
Do you mean like this game? I would suggest one planet before making many planets:
Mars was generated in this game, not built with terrain.
This wouldn’t work too well.
First off, turning a rectangle into a sphere is problematic. There are issues with areas stretching and overlapping, which makes it kind of a mess. Look up “Map Projections”, it’s essentially the same problem but in reverse.
Secondly, scale becomes an issue. For the planet to feel like a planet, it would need to be massive, yet retain continuity and make the player feel as if it’s normal. When you walk around on earth, it feels like you’re walking on a flat surface, because the curvature only has effects on large scales. When you’re just walking on a planet, you wouldn’t actually notice that it’s a planet until you circle back to where you started and realize it’s a continuous surface or go to a very high altitude. This is something to keep in mind.
Additionally, gravity pulls you towards the center of the planet, not just down. There really isn’t a set up or down when working with planets.