Announcement

Collapse
No announcement yet.

FGear Vehicle Physics (v1.2)

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

    Originally posted by xetura View Post
    I think I found a bug with input. With my AI vehicle, he would continue to drive in a circle after being killed, which should be impossible since standard input is disabled. I checked the BP debug filter to check in realtime and I confirmed he wasn't receiving any input. So I thought maybe mStandardInput wasn't being disabled entirely, so I enabled it, set the throttle and steering to 'none', then disabled it again. Then the car wouldn't move or steer, even though the debug filter said it was getting input and standard input is supposed to be disabled. My base player and AI vehicle are now the same, so I confirmed it with player input and it's the same thing.
    EDIT: I just confirmed it with someone else on a different machine.
    what do you mean by being killed?

    when standard input is disabled it does not interfere with any vehicle input anymore so if you disable ai component and standard input is also disabled then the vehicle will continue to use the last input from ai, so this can be considered as a bug, we will fix it. if this is not what you meant please elaborate.

    Comment


      Originally posted by lazybitgames View Post

      what do you mean by being killed?

      when standard input is disabled it does not interfere with any vehicle input anymore so if you disable ai component and standard input is also disabled then the vehicle will continue to use the last input from ai, so this can be considered as a bug, we will fix it. if this is not what you meant please elaborate.
      Yes, the AI part seems to use the last received input and doesn't automatically set throttle and steering to 0.

      But it affects the player input as well. When a vehicle is killed/blown up (car combat game), or the ignition is set to ON or OFF, it sets 2 bools: IsDead? and/or IsOn?. So what's happening is when a vehicle is killed, or the player turns the vehicle off, the Vertical Axis is still driving the vehicle forward, even though it shouldn't be. I can turn the 'ignition' to 'on', put the car into gear, drive forward, turn the 'ignition' to 'off', and the vehicle still accelerates forward by pressing the Throttle. If I re-enable StandardInput to change the Axis values to 'none', then disable it, the throttle doesn't work at all, in any situation. So disabling it doesn't seem to have any real affect.

      This is my throttle controls. 'AI_Throttle' is being called from tick and is only being used by AI vehicles. When IsDead? is set to TRUE, it kills the AI throttle and steering input, but the car still drives on the last received input.
      Click image for larger version  Name:	fgear_throttle_bug_02.JPG Views:	0 Size:	102.9 KB ID:	1761052

      This is what it looks like in-game (player controlled), with the ignition set to 'off'. The vehicle moves forward in this situation, even with StandardInput disabled (vertical axis set to Forward).
      Click image for larger version  Name:	fgear_throttle_bug_03.JPG Views:	0 Size:	106.9 KB ID:	1761053

      This is with the ignition set to 'on'. This works fine if the vertical axis is set to Forward (even though StandardInput is disabled). If the Forward Axis is set to 'none' but StandardInput is still disabled, the graph looks exactly the same, but the vehicle will not move at all.
      Click image for larger version  Name:	fgear_throttle_bug_04.JPG Views:	0 Size:	105.2 KB ID:	1761054

      I hope that makes sense. Please let me know if it doesn't. Thank you.
      EDIT: Having a built-in ignition on/off switch would be awesome!
      Last edited by xetura; 05-14-2020, 04:59 PM.

      Comment


        xetura

        i thought you were using the FGearAutoDrive component so you are using your own AI solution.
        in this case there is no bug involved, i think you are just making a logical error just like your previous problem.
        while car is active call setThrottle every tick and update your "ThrottleAxis" properly.
        no need to enable/disable StandardInput, it is out of the equation, leave it disabled.
        when your car is dead you need to manually zero out all inputs and stop injecting inputs.

        Comment



          Originally posted by lazybitgames View Post
          xetura
          while car is active call setThrottle every tick and update your "ThrottleAxis" properly.
          I'm already doing this as indicated in my graph. But the problem isn't just the AI, it's the player input as well.

          Originally posted by lazybitgames View Post
          xetura
          no need to enable/disable StandardInput, it is out of the equation, leave it disabled.
          I guess I'm not sure why there is an option to disable StandardInput if it doesn't disable it. When I disable it, it should be disabled.


          Originally posted by lazybitgames View Post
          xetura
          when your car is dead you need to manually zero out all inputs and stop injecting inputs.
          This works fine for the AI, but it doesn't for the player. The car accelerates when I press the throttle no matter what.

          Comment


            I decided to run a test by deleting InputAxisForward, since it doesn't seem to do anything and I was right. It does absolutely nothing. The car still moves forward without it even being in the BP. So how does that work if StandardInput is disabled?

            Click image for larger version

Name:	fgear_throttle_bug_05.JPG
Views:	116
Size:	172.9 KB
ID:	1761117

            Comment


              Originally posted by xetura View Post
              I'm already doing this as indicated in my graph.
              no you do not, according to your graph if IsOn is false and IsDead is true then setThrottle is not called so the car will be stuck using its last value.

              Originally posted by xetura View Post
              I guess I'm not sure why there is an option to disable StandardInput if it doesn't disable it. When I disable it, it should be disabled.
              it disables it, no need to question that, the vehicle class stores the latest input data it does not matter if StandardInput is enabled or not.

              Originally posted by xetura View Post
              This works fine for the AI, but it doesn't for the player. The car accelerates when I press the throttle no matter what.
              assuming "InputAxis Forward" is player input then if IsOn is true the car will accelerate when you press throttle.

              Comment


                Originally posted by xetura View Post
                I decided to run a test by deleting InputAxisForward, since it doesn't seem to do anything and I was right. It does absolutely nothing. The car still moves forward without it even being in the BP. So how does that work if StandardInput is disabled?

                Click image for larger version

Name:	fgear_throttle_bug_05.JPG
Views:	116
Size:	172.9 KB
ID:	1761117
                i checked the source code, StandardInput is enabled automatically when the pawn is possesed and disabled automatically when unpossessed.
                this may be causing problems, you can check telemetry option for input to see if StandardtInput is really disabled or not.

                Comment



                  Originally posted by lazybitgames View Post

                  no you do not, according to your graph if IsOn is false and IsDead is true then setThrottle is not called so the car will be stuck using its last value.
                  IsOn is always set to True for AI vehicles. The top part of the graph doesn't apply to the player, only AI. And the AI_Throttle event is hooked to Tick.

                  Click image for larger version

Name:	image_192037.jpg
Views:	113
Size:	124.6 KB
ID:	1761176

                  Setting the 'ThrottleHack' to tick fixes the AI problem, but the player input is still an issue.
                  Originally posted by lazybitgames View Post

                  i checked the source code, StandardInput is enabled automatically when the pawn is possesed and disabled automatically when unpossessed.
                  this may be causing problems, you can check telemetry option for input to see if StandardtInput is really disabled or not.
                  Telemetry says it's enabled, even though I have it set to be disabled.

                  Click image for larger version

Name:	image_192038.jpg
Views:	113
Size:	492.6 KB
ID:	1761177

                  So it isn't being disabled for some reason.

                  Comment


                    Originally posted by xetura View Post
                    So it isn't being disabled for some reason.
                    it is reenabled, we will make this(auto enable/disable thing) optional.

                    for the time being try calling Vehicle.getStandardInput().setEnabled(false) after possesing the car or just call it every tick.

                    Comment


                      Originally posted by lazybitgames View Post

                      it is reenabled, we will make this(auto enable/disable thing) optional.
                      Ok, thank you.

                      Originally posted by lazybitgames View Post
                      for the time being try calling Vehicle.getStandardInput().setEnabled(false) after possesing the car or just call it every tick.
                      I have that node setup already and it doesn't seem to work on BeginPlay. I just tried putting a delay of 1 second before the node, and it seems to disable it now. Putting it on tick also seems to work. Not sure why it needs a delay to work.

                      Comment


                        I'm running into an issue when getting the 'max power' float. Telemetry shows a different value than the BP node and I'm not sure why.

                        Click image for larger version

Name:	fgear_max_power_01.JPG
Views:	49
Size:	37.5 KB
ID:	1764963

                        This is from my ui.

                        Click image for larger version  Name:	fgear_max_power_03.JPG Views:	0 Size:	5.9 KB ID:	1764960

                        This is the bp.

                        Click image for larger version  Name:	fgear_max_power_02.JPG Views:	0 Size:	113.2 KB ID:	1764961
                        The more power an engine has, the larger the discrepancy.

                        Comment


                          Originally posted by xetura View Post
                          I'm running into an issue when getting the 'max power' float. Telemetry shows a different value than the BP node and I'm not sure why.
                          ...
                          The more power an engine has, the larger the discrepancy.
                          CalculateMaxPower returns in kW(kilowatts), to get the hp value you need to multiply with a constant around 1.34

                          Comment


                            Originally posted by lazybitgames View Post

                            CalculateMaxPower returns in kW(kilowatts), to get the hp value you need to multiply with a constant around 1.34
                            Awesome, thank you!

                            Comment


                              https://www.unrealengine.com/marketp...ehicle-physics does client-predicted, server-authoritative networking.

                              Comment


                                4.25 binaries are now available for v1.2

                                Supline
                                i have seen that high speed self steering can be caused by the (Mx)Overturn Moment Scale parameter which is only used with the MF6.1 tire model, make it zero and let me know if it makes a difference.

                                have also seen another type of self steering issue with lower speeds, it happens when the steering comes back to zero after a turn, the vehicle does not go straight but keep on steering slowly to one side. this only happens with certain setups and i could solve the issue by resetting some tire model settings, specifically the "Combined Lateral" parameters.

                                Comment

                                Working...
                                X