Announcement

Collapse
No announcement yet.

Solar System Simulator/Generator

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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!!!!!!!!

    Click image for larger version

Name:	offset.jpg
Views:	1
Size:	156.6 KB
ID:	1181383
    Click image for larger version

Name:	blueprint.jpg
Views:	1
Size:	184.9 KB
ID:	1181384

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

    Click image for larger version

Name:	con1.jpg
Views:	1
Size:	180.1 KB
ID:	1105701

    And then adding spline mesh components:

    Click image for larger version

Name:	con2.jpg
Views:	1
Size:	178.0 KB
ID:	1105702

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

    Click image for larger version

Name:	constructed.jpg
Views:	1
Size:	181.2 KB
ID:	1105703

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

    Click image for larger version

Name:	ingame.jpg
Views:	1
Size:	203.3 KB
ID:	1105704
    Attached Files

    Comment


      #3
      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?

      Comment


        #4
        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.

        Click image for larger version

Name:	Untitled.jpg
Views:	1
Size:	165.5 KB
ID:	1105780

        Comment


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

          Comment


            #6
            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
            Attached Files

            Comment


              #7
              Why don't you close the spline and that way you wont run out of spline? I'd need to to go around forever

              Comment


                #8
                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.

                Comment


                  #9
                  Hey Everynone...

                  I got another favor to ask

                  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 ...

                  Is there a

                  Comment


                    #10
                    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.

                    Click image for larger version

Name:	Untitled.png
Views:	1
Size:	228.7 KB
ID:	1106004

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

                    Comment

                    Working...
                    X