Starfield Pixel Game here we go xD
Pixel Planet Generator
A showcase of some shader code for Godot game engine. Currently there are 8 types of planets, also generates black holes, galaxies, stars and asteroids. Each type has a lot of possible variations. Also allows you to export any planets you like in either a png , gif or a spritesheet.
Drag your mouse around the planet to change the lighting.
If you want to use this for yourself you can download the source for the shader code. Lots more options for variations are available in the source.
This project is completely free to use and will stay free, but donations are very appreciated, thanks!
- Q: Can i use this in my game, tutorial, project, etc. ?
- A: Yes, it's completely free, use it however you want. Credit is appreciated but not required.
- Q: Is this available in Unity, etc?
- A: The only official version is this one, but here are some ports other people have made:
- Q: On the downloadable version, where do I find the exported files?
- A: On Windows and Linux, in the same folder the program is. On MacOS under "
- Q: How do I use spritesheets?
- A: Determine how many frames you want for an entire rotation. Set this amount of frames for the width (or height). If this exceeds the file width limit, try increasing the other dimension (width/height) for more frames. And of course whatever tool you use to display animations has to support spritesheets.
- Q: How do I use color import / export
- A: Paste in a list of html color codes separated by newlines. Keep in mind that using the copy/paste from clipboard requires browser permissions. Also clipboard access seems to be disabled in firefox.
- Feel free to ask me anything if something isn't clear, cheers!
Source on Github: https://github.com/Deep-Fold/PixelPlanets
Available under MIT license. Credit is appreciated, but not required.
Click download now to get access to the following files:
- color importing & exportingMar 18, 2023
- Layers!Jul 10, 2022
- Quality of life stuffFeb 27, 2022
- Galaxies & More PixelsDec 24, 2021
- GIF ExportsSep 07, 2021
- Dither togglingJul 03, 2021
- Random color palettesJun 06, 2021
- New thing: Black HoleMay 21, 2021
Log in with itch.io to leave a comment.
Thank you! This was a big help for my top-down space shooter game. I was redoing the 8 planets of the solar system's art but then I found this to hurry up the process! This can do everything I need! I'll make sure to put this in the credits of the game.
Hey ! Really cool, simple and beautiful generator !
Do you plan to add a "Generate random" button ? For the extra surprises !
Thanks! There is already a random color and random seed button, do you mean just one button that scrambles everything?
This tool is REALLY COOL !!!
woaw, cool stuff! <3
These are really cool! love it!
Hey! Do you have any plans for additional Pixel Generators?
I'd get a lot of use out of a Continent/City generator.
I do have some ideas, I have a WIP for a pixel spaceship generator, but still working on improving that. A continent or maybe a map generator is actually pretty interesting also. Thanks for the suggestions!
very good, anyone know if we can remove the clouds from the wet planrt and island planet?
Thank you! You can remove the clouds by clicking on "layers" and toggling the layers you don't need.
For anybody that wants a smoother looking animation, I find that you can ramp up the pixel rate to 2000 before the animation starts to lag.
Good to know, If you want to go beyond that without any lag you can also use the shaders directly to have any pixel rate. That might require a bit more knowledge of shaders though.
So amazing, can i embed your generator into my game?
Thank you! You can, but if you want to embed the entire generator then please give credit to this page.
Using these amazing shaders for planets in my game: Arcadium - Space Odyssey. Thank you!
Wow, that looks really awesome! You really made the shaders look beautiful.
Great job on the game, I'll definitely check it out!
This is awesome !!
How do you add rings to an Islands-Type planet?
Currently the ring only works for one of the gas planet types, in a future update I'll change it so that it can be enabled for any planet type.
This is absolutely AMAZING!!!
I was about to start working on a planet generator using perlin noise until I came across this beauty.
Thank you my friend, you gave me a lot of inspiration to start.
Hey I'm trying to use these shaders in Godot 4. They all work fine accept for the IceWorld's `Lakes` shader, which is now coloring the box that contains the planet (see screenshot). The shader code from Godot 3 -> 4 is identical aside from the the 3 colors in the shader being defined as `source_color` instead of `hint_color`.
I don't know anywhere near enough about shaders to troubleshoot this myself, so I'm hoping you might understand why this is happening, and maybe be able to provide me with a quick fix?
Hey. thanks for letting me know. Here's a quick little fix:
- Click on the "shader" button to see the shader code.
- Add this line: "float d_circle = distance(uv, vec2(0.5));" on line 74. Just before the line "uv = spherify(uv);".
- On line 96, replace "a *= step(distance(vec2(0.5), uv), 0.5);" with the line "a *= step(d_circle, 0.5);"
I just tested it and that works for me. It's actually a mistake I made in the original shader code, but it seems like godot 3 handles it different than 4.
Hope that helps!
can I use the source code in my game and edit it, and thank you
Yes, feel free to use the source code and shaders for your game
Glad you like it! Yeah juggling between quality and size is always a bit of a challenge.
Great job on the demo/game, looks awesome!
Nice generator. The following suggestions are provided.
1. Add a hint to spawn: The number of frames it takes for the planet to make one revolution. Games often require continuously rotating planets, but the number of frames generated is often not enough to make the planet rotate perfectly 360 degrees, and the user of this generator has no way of knowing how many frames it will take.
2. "star" planets generate with a lot of white space around them, which is different from other planets, maybe this is a bug.
Thank you for the suggestions! The planet should always make exactly one full rotation, regardless of number of frames. If you increase the amount of frames it will simply make the animation more smooth, but still one rotation. You're right on the amount of white space for a star, it's due to the way the generator is programmed. I haven't really seen it as a problem, but if it's an issue I can try a fix.
Thanks for the feedback, appreciate it!
Is a MacOS version possible?
Unfortunately not anymore, due to some changes it's now required I own a Mac to build the app, and I don't own one.
This is amazing, keep it up!
I already broke it by adding 2 more zeros to the 100 in the pixels textbox lmao but its very cool!!!
Haha, yeah that's a little bug with the rng. I think any number ending in multiple zeroes has that issue.
Oooh this is so amazing! I was working on a retro galaxy map for a sci-fi dnd campaign and had some basic planets drawn up, but these are 20x better. Thank you so much for sharing this!
Have you tried migrating this project to Godot 4?
Not yet, I might soon, but don't have a good reason for it right now. The shaders themselves should work fine in godot 4 at least.
If you're interested I can fork the repo and share my changes.
Okay thanks, good to know. Yes the forked repo would be useful, would be interested in seeing that.
Sorry for the delay. Here's the repository https://github.com/jacob-winkler/pixel-planets-godot4
No worries, thank you very much for the repo. Really appreciate it!
I'll take a look at the gifs and tiling. Might also just leave it as a Godot 3.0 project if it's too much of a hassle though.
Needed planets for my 2D space game (being built in Godot). Googled: "pixel planet generator". Clicked the first link. Jaw dropped.
Amazing how well I believe this going to suit my needs. Huge cheers to you for making this project free. I'll be sure to donate if I ever make any money I swear it lol
Haha, amazing that you searched for the exact project by accident. Glad you like it, hope you can make some good use of it!
Hello, I absolutely love this and i've used it many times, but something I recommend that would make getting what you want alot easier, is making an option to choose what tpye of something you want like for stars you could say like, generic star, neutron star, red giant, stuff like that. And maybe for galaxies, there could be, ring galaxy spiral galaxy.
Hey, glad you like it! Yeah more types would be cool, it does take some time to create each one so not sure if I want to add that many. Thanks for the suggestion though!
Hello. im a proto-dev (aka basic game developer that has no-code experience)
i wanted to make a full version of Deep space.
with new weapons.
so as planets.
Sounds awesome! Might require some coding experience, but you can learn while you try to make something like that.
uh is there a mac port, and if here is i can't find it cause i kinda wanna export it yet i can't do that in the browser thingy
There was a Mac port but unfortunately I had to remove it as I could no longer notarize the export from my windows machine. Maybe newer versions of godot do something about that, but I haven't looked yet.
Is it possible to put a camera to move sideways? To make a side view boulder like in "Rick Dangerous":
No, unfortunately because of the way the planet is generated you can't rotate it that way. however if you want to change the lighting you can just click/hold mouse on the planet where you want the light to be.
Hey! Amazing tool! Really saves a lot of time. Is it possible to add a seed for colors? Could be a chain of the actual color hexes. Example for a 2 color planet with black and white: FFFFFF000000
It would save us even more time.
Hi, glad you like it! So you mean a way to import/export colors? Yeah I think that could be a nice addition, I'll put that in a next update.
Very great tool, planet looks very cute and ready to be used in any sci-fi game (cut scene, intro/outro, background, scenery), I can't even believe what I see as being randomly generated ! Great job and congratulations on keep the will to continue improving it over and over.
There is still work to do on asteroids which looks mostly odd for now.
I've started years ago to create such tool for one of my project, didn't go too far and I got something like this:
with using only blue color for this sample (Perlin noise), with MonoGame in C#. I've plan to add atmosphere but never did it.
Thank you! Yes it's really cool what can be achieved with just some simple noise and coordinate transformations. I guess the asteroids don't really fit because they don't looks as 3 dimensional.
This is sick~ Love it :D
this is really nice
what happend to bieng able to make space
I think you're looking for this project? https://deep-fold.itch.io/space-background-generator
Thank you this is amazing for my game. How did you manage to slow down the sprite animation like that and be smooth?
Glad you enjoy it! The reason the animation is slow in the program is because it's rendered through a shader. So it actually just renders a new sprite every frame. If you want that same smoothness you probably have to use the shader files themselves in whatever engine you are using, they are available in the source. Otherwise you have to export a high number of frames in a spritesheet, and then loop through those at 60 fps.
Thank you very much! Also where can I learn to be master of shaders like you?
Haha, I still have a lot to learn with shaders. In order to get better at them I would say just practice a lot and try to make new stuff with shaders, you'll pick up a lot of tricks along the way. Also thanks for the credits, congrats on making a game!
I really love the look of these planets and the customization is amazing!
I am wanting to use generated planets in a project of mine, my question is: how can I generate and save large quantities of pngs? How would I automate downloading hundreds of each planet type? It is important that I have the sprite sheets in storage, I cannot simply generate them dynamically based on a seed #. I am not sure where to start.
Any help helps. Thanks!
Glad you like it! There is currently no way to batch export a bunch of planets, I'm not sure if I'm going to add that either. However you could use a macro program or something to automate randomizing and exporting a bunch of planet. Hope that helps!
This is one of the best thinks i have seen hhere
i cant stress enough how amazing this is. i'm making a sci fi game so this will really come in handy for inspirations, amazing work
This is a really awesome projects
I have been dreaming of making something like this for so long... And I come to find it's already made. So first off, thank you!
If I wanted to change the settings that create the layers, would it be possible to do this in the GUI some how?
I was wanting to simply play with more of the attributes that are generating these planet types.
You're welcome haha, hope you like my execution of it.
Unfortunately you can't change layer settings from the GUI. I could implement that but I wanted to keep the interface somewhat simple. But it's very easy to change settings and layers if you use the source project.
Hope that works, cheers!