Solar System Simulator/Generator

Hey all!
So I’m working on a little system of creating random solar systems for my game. However I’m running into an issue where I’m not sure how to create the orbit spline that shows the path of the planets. Right now Im using a 3d mesh that I imported (The red line) and scaling it up.

I take the planet offset, which is a float distance from 0,0,0 to Value,0,0 relatively.

Then I just guess and set the spline relative size by taking that value and dividing it by a number.

The first orbit seems to be okay but I think because the value is so big (3000-4000) the further I get the less chance of it fitting. It’s almost always off on the 2nd orbit probably because I need to divide by like 70.05123 u know what i mean?

Does anyone have an idea how I get properly set this system up?

THANKS!!!

d01e62a9556ec1baeb2d77d4c2f81183ccce008d.jpeg
8f977eb9993a282d19418e5b6b8f5cab66044432.jpeg

Try setting orbits & trajectories as separate actors with a spline component and generate points on the circle in the constructor:

eddc5d4846b840fab11c1a00b74ce50f4bf8a98b.jpeg

And then adding spline mesh components:

e7d9f4c6ce8c70694fb3906b09ad32f14017dbb6.jpeg

This allows for dynamic radius, complexity (smoothness), tilt and the elliptic nature of orbits to be accounted for.

ca958751b1d6cd53f1e3b799f036f467885b0704.jpeg

In game, rather than calculating the orbit distance and such, you can slide your celestial marbles along the spline.

e479ad853b1e904abe0d998a8d17ce5adf59e0de.jpeg

Wow thanks so much! I tried something similar (but your’s look cleaner) but I still had the issue of the planet not ‘snapping’ exactly to the orbit. How do you get the planets to follow the spline path?

You will want to multiply the length of your spline by a value in the range of 0-1. If you go above 1, you’ll run out of spline.

a1617e7c9af64ef1c3c452315d30ba045326ab26.jpeg

It’s strange I dont see anything :frowning: I tried copying your blueprints. Maybe I’m not putting correct numbers inside some values…
What exactly should base points / complexity / base spaci

Nevermind! It was because I had Manual attachment checked.

Works beautifully!!! Thanks so much Everynone !

I had close spline on the image below :S lol

Why don’t you close the spline and that way you wont run out of spline? I’d need to to go around forever :frowning:

I should have mentioned that, true:

Base Points: 9
Base Spacing: 40
Complexity: 2 | 4 | 8 (those three values work well)

Tilt: -0.5 <> 0.5
Ellipse: 0.85 <> 1.15

The spline is closed but you still need to move along it. It begins at 0 and ends at 1. Think about it as if it was progression percentage. As soon as it goes above 1, snap it back to 0. That’s what *modulo * does in the example above.

Hey Everynone…

I got another favor to ask :slight_smile:

SO it’s creating wayy too many mesh components and it’s bringing my FPS wayyyyyyyyyyyyyyy down to unplayable. Like from 120fps to 20fps lol It’s probably around 8k mesh or more.

Also it could be becuase I switch Complexity to 40 and Base spacing to 2 …
Now i switched it back to what you said and I dont even see anything happening anymore … :frowning:

Is there a

This is how it looks with complexity 2. Not entirely smooth but enough for what I needed it for. I only used complexity 4 for close-ups. 8 is an overkill. imho. 40 sounds redundant save for the most extreme cases. Complexity is a simple multiplier, nothing else. At 2, it generate 18 meshes, at 4 you get 36.

Again, this will depend on your mesh. This is what I’m using, the material is very simple and just uses pixel depth to avoid clutter when you have 20+ objects visible.

I’ve yet to dip below 119fps with 25 actors. stock 7970 + 3570k@4GHz.

I’m years late to this thread seeking a solution to this same problem, but all of the original images appear missing or corrupt to me. The image in the final post still appears, though. Is there any way to retrieve the now-missing images?

Nope, they we sacrificed to the Discourse Gods during the Great Forum Transition.

But we can always make more screenshots. What are we making? Clickable orbits out of splines?

Oy, I hope the Discourse Gods were well pleased, anyway.

Yes, I’m trying to draw orbital curves in 3d space without using debug drawing. It looks a bit like you have two different methods going on in your last photo – using spline meshes and particles/beams? I’d love to get a look at how you did this.

1 Like

I’ll try to dig it up today. The above method is with splines. Stay tuned.

I lifted what was relevant from an old project (opening 4.17 → 4.27 is no fun at all! :wink: but still pretty stunned it actually opens & works almost out of the box!):

Project link:

Here’s what this actor can do:

Some basic controls for this are exposed but it needs a ton of features to make it useable / more flexible. I’d start with adding controls for how many SMCs are needed for smaller / larger orbits - currently it’s a fixed number. May be fine depending on what this is going to be used for.

The mesh is made out of 3 planes with a dual sided material:

And holds up up close well enough:

The material can also do this:

I left it in, just disconnected. Do tell how it goes.

6 Likes

Oh ■■■■ this looks awesome, thank you! I’ll start poking at it and let you know how it goes.

Edit: I got into it for a bit to see how it works, and this for sure works great and makes perfect sense. Thank you x1E9, and I’ll post back once I’ve got something concocted that uses this method :slight_smile:

1 Like

I was wondering how to get this to work like the video, tried various ways cannot get same results.

Do you mean the spline highlight? I may have it somewhere. But that’d be some deep digging.

Edit: but the project is attached - so it’s probably there already, no?

Hey… thanks for the quick reply… the post where you say “the material can also do this… its just disconnected” Downloaded project but cannot figure out how to connect .

1 Like

I’ll have a look tomorrow morning.