Announcement

Collapse
No announcement yet.

How can I make a TwinStick Pawn orbit a Sphere?

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

    How can I make a TwinStick Pawn orbit a Sphere?

    Hi there guys,

    I'm working on a project with some friends, and we are trying to create this:
    - The game is based on a spaceship that orbit a planet in the space.
    - It's going to spawn asteroids and other ships that will attack in 360º this planet until it gets destroyed
    - The ship that orbits the planet need to rotate when the player press "A" Counterclockwise and "clockwise" when the player press "D".

    Here is a Sketch of what I need.

    Click image for larger version

Name:	oRBIT.png
Views:	1
Size:	137.6 KB
ID:	1219950

    I'll very grateful for anyhelp!

    #2
    Make pawn physics based, for movement use physics thrusters only. Disable gravity. Then use physics constraint to hook pawn to center of sphere. I have prototype of game done like this, but all i can find are quite late backups they are too big and complicated to serve as example. I cannot find early build.

    Comment


      #3
      Originally posted by Nawrot View Post
      Make pawn physics based, for movement use physics thrusters only. Disable gravity. Then use physics constraint to hook pawn to center of sphere. I have prototype of game done like this, but all i can find are quite late backups they are too big and complicated to serve as example. I cannot find early build.
      Nawrot, I'm quite new on the Unreal community. So I understand part of your answer. Can you show some blueprints ou something more simple?
      PS: Thanks for the answer. ^^

      Comment


        #4
        That is the problem i lost blueprints of that game when it was still in simple form. Earliest backup of it i have is quite complicated, it will only confuse you. Anyway I will check once more later today.
        Also we discontinued doing that game idea because limiting game area to just orbit of planet limits gameplay, it was just no fun at all.

        There are multiple problems with gameplay on sphere, for eg: collision, shooting bullets, line trace for hitscan weapons, enemy AI (you need write it yourself from scratch), polar anomalies everywhere (about everything has potential danger for weird behavior around poles), you need to make everything physics based with constraints hooked to center. So in short a lot of battling against that polar coordinate system, without any real gain in gameplay and fun area.

        Then some dillema we totally could not solve:
        - small planet that fits on screen looks gorgeous, but then you have tine gameplay area, bullets start to sirculate whole planet.
        - big planet means big game area, but then planet looks just like bent sheet, no point in making game areound planet anymore.

        PS. and then we found this game: https://www.youtube.com/watch?v=OYMgdGuI3G4
        Last edited by Nawrot; 05-12-2017, 04:43 AM.

        Comment


          #5
          Here's a couple of alternative ideas for simplified circular movement:
          #1
          • Attach your ship to a Springarm, position it at the centre of the planet and rotate the Springarm - its length is the ship's distance from the planet's centre



          #2
          • Create a closed spline in a shape of a circle, an arc or an ellipse. You can do it manually in the editor or procedurally, the math is simple enough.
          • Position the spline at the centre
          • GetLocationAtDistanceAlongSpline and SetActorLocation(ship) - combining it with interpolation will result in smooth movement along the spline's trajectory
          • You will need to include some rotation here as well for the ship, but that depends on your game concept

          Comment


            #6
            Originally posted by Nawrot View Post
            That is the problem i lost blueprints of that game when it was still in simple form. Earliest backup of it i have is quite complicated, it will only confuse you. Anyway I will check once more later today.
            Also we discontinued doing that game idea because limiting game area to just orbit of planet limits gameplay, it was just no fun at all.

            There are multiple problems with gameplay on sphere, for eg: collision, shooting bullets, line trace for hitscan weapons, enemy AI (you need write it yourself from scratch), polar anomalies everywhere (about everything has potential danger for weird behavior around poles), you need to make everything physics based with constraints hooked to center. So in short a lot of battling against that polar coordinate system, without any real gain in gameplay and fun area.

            Then some dillema we totally could not solve:
            - small planet that fits on screen looks gorgeous, but then you have tine gameplay area, bullets start to sirculate whole planet.
            - big planet means big game area, but then planet looks just like bent sheet, no point in making game areound planet anymore.

            PS. and then we found this game: https://www.youtube.com/watch?v=OYMgdGuI3G4
            I saw the Vídeo, and it's more complex than my students idea. We were thinking about a 2D movement, like the ship only travels clockwise and counterclockWise.
            They starts to create this on Unity but they get stuck on the spawn of the asteroids and other ships. I convinced them to do it on Unreal, telling then that is much Simplier than Unity.

            To be honest, I just need the ship to orbit the planet, not automatically but when the player holds "A" and while they do it or "d".

            At this point I'm felling so frustraded, because it seems to be so easy to do, but now I know that is more complex than I expect.

            Comment


              #7
              Originally posted by Everynone View Post
              Here's a couple of alternative ideas for simplified circular movement:
              #1
              • Attach your ship to a Springarm, position it at the centre of the planet and rotate the Springarm - its length is the ship's distance from the planet's centre



              #2
              • Create a closed spline in a shape of a circle, an arc or an ellipse. You can do it manually in the editor or procedurally, the math is simple enough.
              • Position the spline at the centre
              • GetLocationAtDistanceAlongSpline and SetActorLocation(ship) - combining it with interpolation will result in smooth movement along the spline's trajectory
              • You will need to include some rotation here as well for the ship, but that depends on your game concept
              I have tried your First idea with no success, And I'll try the second. THks

              Comment


                #8
                I mean, the 1st one is the most straightforward thing I can think of, the least flexible perhaps:

                Click image for larger version

Name:	Untitled.png
Views:	1
Size:	168.0 KB
ID:	1128025

                In motion:
                https://i.gyazo.com/c80490f3fe583bd8...8dcb06d33c.mp4

                The controls should be set up better, of course; just an example.

                Comment


                  #9
                  Originally posted by Everynone View Post
                  I mean, the 1st one is the most straightforward thing I can think of, the least flexible perhaps:

                  [ATTACH=CONFIG]140862[/ATTACH]

                  In motion:
                  https://i.gyazo.com/c80490f3fe583bd8...8dcb06d33c.mp4

                  The controls should be set up better, of course; just an example.
                  This fits perfect in what I need. I'm setting the Pawn as default Now, because I was Using the Twin stick one and they don't recognize this new as standart. Thank you very much for your help, both of you. ^^

                  Comment

                  Working...
                  X