Announcement

Collapse
No announcement yet.

Electric Slot Car Racing Sim, N-Wheel Vehicles, Tracks & Loops

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

    Electric Slot Car Racing Sim, N-Wheel Vehicles, Tracks & Loops

    Hello Fellow UE4 Developers,

    Seek advice from Vehicle Gurus. Working on Electric Slot Car Racing Sim using the advanced Vehicle Template. Works well on Track straight-aways, bank/twist, and curves, but I ran into a issue with the car staying on track in Loops.

    I expect RC Sim to be used in fantastic ways with unrealistic loops.

    My solution is a dual wheel upper/lower configuration for front and rear wheels (black) in which the track is sandwiched, keeping the car (red) on the track (yellow) when upside down.
    It is not necessary for the low wheels to be visible. So I figured I just go into PHAT and duplicate the F/R Wheel Sphyls bodies. However, I'm not seeing the effect of the physics in game

    No other modifications have been made. Do I need to modify the Vehicle Animation BP? Any advice will be gladly accepted.




    HeadlessStudios.com is now part of TheGameDevStore.com

    #2
    To my understanding PhysX vehicles in UE4 are treated as kinematic bodies, which means - you can attach physics bodies to it but they won't affect kinematic body. The point is that "roller-coster wheel" setup won't work with PhysX vehicle as a base class.
    There were multiple discussions in past regarding issues Physx vehicle experience on looped tracks:
    http://gamedev.stackexchange.com/que...ng-as-expected
    https://devtalk.nvidia.com/default/t...-from-track/1/
    Youtube Channel

    Comment


      #3
      Since you are having your vehicle stuck on a track why bother in creating an actual vehicle anyway? All you want to do is essentially animate it going along a spline path and check if its going too fast along the corners to make it fall off right?

      Comment


        #4
        Originally posted by BoredEngineer View Post
        To my understanding PhysX vehicles in UE4 are treated as kinematic bodies, which means - you can attach physics bodies to it but they won't affect kinematic body. The point is that "roller-coster wheel" setup won't work with PhysX vehicle as a base class.
        There were multiple discussions in past regarding issues Physx vehicle experience on looped tracks:
        http://gamedev.stackexchange.com/que...ng-as-expected
        https://devtalk.nvidia.com/default/t...-from-track/1/
        Hi BoredEngineer Thank you for weighing in on this, and the information.

        There are 4 areas that I'm looking at in the implementation:
        1. Track Design (with Top beams to prevent fall)
        2. Splines Mesh for Track
        3. Vehicle PHAT setup
        4. Gravity.

        The physics are finicky with standard setup. The vehicle will intermittently complete the loop, just not on a guaranteed basis. I'm also considering this technique for racer in which cars hang upside down on the track. Ill start looking into the other areas. Thanks again.
        HeadlessStudios.com is now part of TheGameDevStore.com

        Comment


          #5
          Originally posted by ZoltanJr View Post
          Since you are having your vehicle stuck on a track why bother in creating an actual vehicle anyway? All you want to do is essentially animate it going along a spline path and check if its going too fast along the corners to make it fall off right?
          Hello ZoltanJr, thanks for reading and responding.

          The Vehicle solves a lot of custom physics issues and works every now and then. There are issues using Spline loops as show here. I'm actively seeking a solution to this to simplify track construction. One idea is to use two tracks, equal and opposite-side up.
          HeadlessStudios.com is now part of TheGameDevStore.com

          Comment


            #6
            I'm taking a deep look into Dynamic Gravity, which I believe will solve this Track Loop problem instantly. Perhaps attach a Physics Thruster Component on the Car and activate when going into the loop.
            Last edited by TechLord; 09-23-2015, 09:10 PM.
            HeadlessStudios.com is now part of TheGameDevStore.com

            Comment


              #7
              I don't think it will solve it if you use Vehicle template - they are not physical bodies, they like a character movement component. You will have to dig into their C++ implementation to solve this. ZoltaJr raises a good question, it doesn't look like you have a use case for physically simulated cars. That issue with spline you've mention can be simply related to not enough geometry of the track section or he doesn't properly handle "flipping" of the spline as it always points to up vector that you provide in settings.
              Last edited by BoredEngineer; 09-24-2015, 08:00 AM.
              Youtube Channel

              Comment


                #8
                Originally posted by BoredEngineer View Post
                I don't think it will solve it if you use Vehicle template - they are not physical bodies, they like a character movement component. You will have to dig into their C++ implementation to solve this. ZoltaJr raises a good question, it doesn't look like you have a use case for physically simulated cars. That issue with spline you've mention can be simply related to not enough geometry of the track section or he doesn't properly handle "flipping" of the spline as it always points to up vector that you provide in settings.
                Hi BoredEngineer. I'm restricted to finding a Blueprints Solution. I'm using a custom made track mesh with plenty of geometry (learned the hardway). The spline flipping is a commonly known issue, but there may be a hack for it here. Spline Meshes are great to create simple track straight-aways, with slight curves/bends. My back up plan is to use Static Track pieces/sections for complex loops and twists.
                HeadlessStudios.com is now part of TheGameDevStore.com

                Comment


                  #9
                  Originally posted by TooManyfps
                  What I can think of from the top of my head if spline loop make trouble is exporting the spline mesh to fbx and reimporting it to have it as a real static mesh. That's what I do with the procedural nature pack all the time for trees.
                  Other than that I would try some force based track stabilisation. Say you have a spline, you have your all physics vehicle (not the kinematic one from the adv. template) and then you measure the distance to the nearest spline point and based on that you apply a force to push it close the spline. At the same point you accelerate forward with another force. It would feel a bit like the WipeOut titles way back.
                  You could easily try this by using a simple static mesh and a spline for prototyping.

                  Hi TooManyfps, thanks for reading and responding. I'm using two Thrusters: Forward Propulsion, Counter-Gravity. The results are pretty good and rather entertaining. I'll consider your recommendation for a means to automate thruster control.
                  HeadlessStudios.com is now part of TheGameDevStore.com

                  Comment


                    #10
                    Yes, that's one of the ways to fix it. For tank tracks for example I'm just checking if Y component of spline direction vector is positive or negative and roll mesh according to that by 180 degrees. This won't work in exactly the same way for free firm spline - tracks are parallel to X axis of tank, but something similar can be done.
                    Youtube Channel

                    Comment

                    Working...
                    X