Python Custom Solar system editor

mariohobbs

Modder
Moon Maker
Swingin' on a Star
Atlas
Biker Mice from Mars
ET phone home
Voyager Quest
Floater
Registered
#1
A quick lil' custom solar system maker in python. It can create things but it does not have the ability to edit planet data yet, Though it can create heightmaps. GitHub - mariohobbs645/SFS-SystemMaker: Python based custom solar system editor for Spaceflight Simulator

I am working on adding the planet editing functionality but it's taking a while so I figure i'd post it now so nobody else beats me to the chase. It runs in python, so you'll need a way to run python. To use the tool simply move it into an empty folder in your custom solar systems folder. then run the command "setup()" and it'll get you all the stuff in the example system. Then you can use the command hmap() to make a heightmap. Run command pd() to make custom planet data, though as of now that functionality has yet to be added.
 

mariohobbs

Modder
Moon Maker
Swingin' on a Star
Atlas
Biker Mice from Mars
ET phone home
Voyager Quest
Floater
Registered
#2
Alright, After a few hours of labor it can do basic planet creation now, So it can probably make like a moon or something now
 

mariohobbs

Modder
Moon Maker
Swingin' on a Star
Atlas
Biker Mice from Mars
ET phone home
Voyager Quest
Floater
Registered
#4
Probably, A heightmap is a list of points; So theoretically you'd need to define a center for the heightmap then shoot a figurative laser from the center of the shape to the edge, Then you turn that laser 360degrees. The shortest distance from the center to the edge would be the radius of the planetoid, then you could probably calculate the height map by subtracting the difference; Though i'm still new to the whole planet editing thing and my ideas are likely missing something important
 

mariohobbs

Modder
Moon Maker
Swingin' on a Star
Atlas
Biker Mice from Mars
ET phone home
Voyager Quest
Floater
Registered
#6
Alright, So it could theoretically be in Javascript, But then after being bashed in the head by semi-colons I remembered why I don't program in javascript very much; So it is entirely possible in JS, though i wouldn't recommend it; Javascript is more for web frontend. Python is a bit more suited towards image processing than JS. Same thing for the solar system editor this whole thread is about, Python is better for manipulating large bits of data and stuff than javascript is. If you need the code to run in a web browser then try pyscript: Pyscript.net Allows you to run python on the web the same way you run JS on the web. As for the errors with packages, Make sure you've downloaded the newest version of python here: Download Python And as for actually running the python I use the built in one called "IDLE" which is installed as part of the python .pkg installer. If you have any trouble with this feel free to provide more info.

But anyways for your heightmap thing here is something more in depth:

Convert your image into fully black and white, Only RGB(0,0,0) and RGB(255,255,255); Then use some data processing to find the middle of the object and the edge; Then go throughout the entire edge and find the distance from the edge to the center. I'm not a big fan of JS so i couldn't do it, I'll probably try to make the thing in python later; The main issue though is making sure the height map actually looks right in SFS, since i'm not exactly the best with height maps, I'm not exactly the best fit for this job.
 

Gurren Lagann

«★» Officer «» //PT
Professor
ET phone home
Man on the Moon
Registered
#7
I'm quite horrifyingly bad at programming in any language myself, but i can try helping here.

So to try getting the heightmap an idea i have is this:
- First, take the B&W heightmap as you described and find the center pixel of the source image
- Then measure each individual edge pixel and calculate its X,Y displacement from the center of the image
- Convert the X,Y displacement into a Rho-Delta value, where Delta is the absolute displacement from the center pixel ([X_d+Y_d]/2 IIRC) and Rho is the angle of said pixel
- From there sort all the values in the heightmap by Rho, making sure that all Rho values are exactly equally spaced from each other
- Export the sorted Delta values as the heightmap

And that's basically my idea. Hope it helps!