Announcement

Collapse
No announcement yet.

HUGE feature request for the upcoming Chaos physics engine.

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

    [FEATURE REQUEST] HUGE feature request for the upcoming Chaos physics engine.

    A problem as old as networking gaming, is the difficulty involved in simulating player-controlled physics objects in network games and having them be Server authoritative. Chaos could really help to address this by making life easier for us in some areas.

    I know it's still early days, but I have been fighting with vehicles and physics in multiplayer since what feels like the birth of the universe as we know it. For the most part it is an unsolvable problem, but there are plenty of ways we can do this with acceptable results if the simulation gives us a little more control.

    I therefore ask that when designing the simulation layer - PLEASE allow us to simulate individual physics bodies (or groups of) manually at any given time, within the context of the main physics scene, with whatever delta times and paramaters we desire. Those who are familiar with the way Character Movement Component works may cotton on to why I want this so badly.

    PhysX doesn't let you do this, you either simulate the whole scene as one or you simulate an object in it's own scene. I understand why - but it's infuriating. Being able to simulate a single body within the context of all other bodies individually, would allow for an acceptable method of handling server-authoritative, predicted physics for player-controlled objects - without the need for complex buffering and fixed simulation sizes.

    I'd be eternally grateful. Please reach out to me if I can help with this or explain more.

    If you want anymore background for this request, see this:
    https://github.com/NVIDIAGameWorks/PhysX/issues/77

    #2
    Seconded. This is really important.
    Helium Rain, a realistic space opera

    Comment


      #3
      That would be a great feature.
      Youtube Channel

      Comment


        #4
        Definitely +1!
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          This indeed.

          Comment


            #6
            Also fixed timestep by default with proper interpolation for rendering!

            Comment


              #7
              I doubt, unfortunately.
              Epic are no fans of data-oriented approach in core low-level systems.
              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

              Comment


                #8
                Originally posted by BrUnO XaVIeR View Post
                I doubt, unfortunately.
                Epic are no fans of data-oriented approach in core low-level systems.
                If you look at Chaos code it's pretty much DOD design. Simple tighly packed arrays everywhere, with parallel for to maximize multithreading.

                It's kind of impossible to make this kind of system perform so well across platforms without DOD.
                https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                Comment


                  #9
                  More likely option would be that they would expose individual solvers IMO. It would enable you to do that and Epic wouldn't need to care about how to solve each funky bug that comes into physics scene from doing that..

                  Tbh, I'd be more thrilled just to get more control over things:
                  - expose physics ticks by design, don't keep the old delegate route where people has to know the right places to read the data from due to internal engine transform caching not being up-to-date on physics steps.
                  - expose physics stepping mechnanism: let people step physics like they want, don't hardcode it like it's done now
                  - allow option for fixed timesteps and interpolation for it
                  - expose individual physics solvers

                  UE4 competition has done all that except the last one for years, would be nice if actual physics sim got more flexibility instead of keeping the focus on pure visuals.
                  Last edited by 0lento; 03-26-2019, 11:02 PM.
                  https://github.com/0lento/UnrealEngine (GameWorks tech merges & upgrades, UE4 physics modifications)

                  Comment


                    #10
                    You can kind of do that already using PhysX immediate mode - but the caveat is that it doesn't scale well because you have to copy data between scenes/simulations. Here's the approach I would like to take for Server-Auth physics that I believe is scalable, and could also produce acceptable results for most games. Certainly at least anything that uses characters could utilise this.

                    Code:
                    CMC-Style Approach to Physics Movement
                    
                    Pre-Physics (Client)
                    - Resimulate any corrected moves from Server, or delete any acked moves.
                    - Smoothly interpolate render matrix to collision prim matrix for corrected moves.
                    - Compute Server Move Delta Time
                    - Consume Player Input
                    - Create new 'Saved Move', identified with a timestamp like Character Movement
                    
                    Physics (Client)
                    - Simulate the clients object, using the calculated delta time and saved input.
                    
                    Post-Physics (Client)
                    - Gather result of the move, save, decide whether to combine with previous/next move and send to server as required.
                    
                    Pre-Physics (Server)
                    - Received client move, check validity.
                    - If valid, place client bodies back at the last acknowledged transform (alternatively, 'pause' simulation on the object between receiving moves, and accumulate forces and impacts).
                    
                    Physics (Server)
                    - Simulate the clients object from the correct starting transform, using delta time calculated from delta between received packets. Here we're using the latest version of the physics state - which hopefully is similar to client state.
                    
                    Post-Physics (Server)
                    - Compare result with client result, send ack or correction as neccesary.
                    There are two barriers to this system right now:

                    1) The Server needs to be able to simulate each client-controlled object with an arbitrary delta time, but within the latest state of the physics scene. This is not currently possible without copying all scene data to an immediatte simulation or another physics scene. This has to be done per-client!

                    2) The Client needs to be able to simulate it's controlled object many times, in the context of the main scene, but without (or with, up to you) altering other scene objects. Again this is impossible without copying data continously to an immediatte/duplicate simulation.

                    3) The client must be able to separate visual transforms from collision transforms, or risk endless move corrections from the Server. FPhysicsReplication smooths out received physics body states but the collision transform is therefore not fully in sync. This can result in huge amounts of corrections between smoothed objects.

                    ---

                    Another thing worth considering is that if this does work, we culd also create non-kinematic character movement components (wouldn't support root-motion of course).
                    Last edited by TheJamsh; 03-27-2019, 09:40 AM.

                    Comment


                      #11
                      I'm aware of the physx immediate mode, just hoping there will be something like that on Chaos and this time, properly exposed by UE4 (and not hardcoded for animation physics only like the current immediate mode plugin).

                      The core thing that annoys me on UE4 physics is that they seem to do things mainly to drive nicer visuals, there's very little control on physics given out of the box.You can work around the limitations but it's way harder path than it should be.
                      Last edited by 0lento; 03-27-2019, 06:20 AM.
                      https://github.com/0lento/UnrealEngine (GameWorks tech merges & upgrades, UE4 physics modifications)

                      Comment


                        #12
                        Yeah I agree, I guess the problem with immediatte mode is that you need to deal with a lot of PhysX types natively and reconstruct a lot of data for it - so exposing that nicely is probably easier said than done. I'm hoping the (hopefully) reduced abstration between PhysX and Unreal will help with that too - maybe even offer a performance boost.

                        Comment


                          #13
                          There won't be any reduced abstraction between physx and unreal, because Chaos is going to replace PhysX.

                          Goal of Chaos is cut any third party physics solution from vanilla engine.
                          https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                          Comment


                            #14
                            Originally posted by iniside View Post
                            There won't be any reduced abstraction between physx and unreal, because Chaos is going to replace PhysX.

                            Goal of Chaos is cut any third party physics solution from vanilla engine.
                            Yeah exactly, what I'm hoping for as a result is reduced abstraction between the physics engine and the actual engine.

                            Comment

                            Working...
                            X