Announcement

Collapse
No announcement yet.

UT2004 Movement Mutator [8/13/17]

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

  • #16
    Originally posted by exo7341 View Post
    I'm not sure about warping - this might be due to how you modded movement in particular, in conjunction with client-server sync (something in Tick, etc?)...
    Originally posted by RattleSN4K3 View Post
    My guess. Movement values aren't replicated and you are only setting these server-sided and thus the client "syncs" the player back... and with the next server update, the position goes "back".
    Of course. Do either of you know how to set it to replicate through blueprint? I believe they used C++ for the player. Here's how I have the mutator set up:
     
    Spoiler

    I checked the Replicates, Replicate Movement, and Net Load on Client checkboxes for the mutator class, but it still doesn't work.

    I'll have to look into those values, especially eye height. I still have a lot of work to do to make it 1:1.
    UT2004 Movement Mutator

    Comment


    • #17
      I bet Snake could help here better than me...

      My suggestion would be trying Dedicated Server option in Editor:
      Click image for larger version

Name:	ue4_ded.png
Views:	1
Size:	82.9 KB
ID:	391105

      with this you'll get two windows - one for Server, and other for client. That way you should be able to reproduce that bug (and other sync-related ones as well).
      - got sig? -

      Comment


      • #18
        Originally posted by exo7341 View Post

        My suggestion would be trying Dedicated Server option in Editor: Click image for larger version  Name:	ue4_ded.png Views:	1 Size:	82.9 KB ID:	391105
        Yep, that's what I'm doing now. I did New Editor Window and added two players, one server and one client. When looking through the server, the player looks like a slideshow when moving, and the other way around is fine. It's a very helpful feature.

        After a few hours of testing, I think it has to do with how the actual mutator is executed. Event Init is run from the server, where I believe it doesn't hand over authority to the client to do movement. I'm not sure how to do this. Alas, the slideshow movement happens with the default movement too.
        Last edited by Calypto; 07-19-2017, 07:59 AM.
        UT2004 Movement Mutator

        Comment


        • #19
          Originally posted by Calypto View Post
          I checked the Replicates, Replicate Movement, and Net Load on Client checkboxes for the mutator class, but it still doesn't work.
          The mutator isn't the problem... if you are only replacing the Pawn class.

          By replacing the Pawn class, replication is fine per se. The client does use the default values of your custom class just fine. ... unless you are modifying movement values on runtime dynamically. Without knowing how you really implemented the Pawn class, I would agree with what exo initiall said, the movement itself in conjunction with your custom code (e.g. Tick/Timer/Delay etc.). Some values are hardcoded and optimized to work for a specific case in which case using some other values (modded ones) could result into undesired behavior such as this warping you get.

          For testing, fully override "PlayJump" and "OnDodge". There's a lot of "Bob" Epic is adding when the character jumps, lands etc.

          Also, you could log the position/rotation (and diff) with a Tick and the inventory event for "Dodge" (with a custom inventory or the one you've also added "BP Shield Gun")... on client and server. Also, with "DodgeOverride" to log the state of the Pawn before the Dodge jump is executed.


          Originally posted by Calypto View Post
          After a few hours of testing, I think it has to do with how the actual mutator is executed. Event Init is run from the server, where I believe it doesn't hand over authority to the client to do movement.
          Clients rarely have authority over any actor (by default); the mutator only exists on the server (by default) and it should never exist on clients (by modifying the replication flags on the mutator class). The mutator is just fine by judging the screenshot you provided. You are replacing the Pawn class which the server is spawning for each client, the client will then possess that character (on the server and the client). The base Pawn class itself is setup to be replicated.
          ] Map Scaler Tool | Betrayal for UT4 | No Spawn Protection | No Pickup Timer | BioLauncher (revived) | ForcePickupSpawn | Map cosmetics::P | Safe Spawn::P | Why numbers for Health/Armor suck!::ANALYSIS/CONCEPT
          ] UT3 Addons: NoMoreDemoGuy | PickupRespawnTweak | Mutate Spec | MutePawnSounds | NoPlayerBeacon | Epic FTW | Epic FOCK | TripodSound (... and many more)

          Comment


          • #20
            I actually had similar issue with my vehicle - I needed player to stay in place when he controls a vehicle... so I did that via direct location manipulation in Tick. It worked fine offline, but caused player warping online. So, I think since location is dependent on velocity/acceleration too - direct affecting those on runtime could also cause problems (if you have something like that in your code).
            - got sig? -

            Comment


            • #21
              Originally posted by RattleSN4K3 View Post
              The mutator isn't the problem... if you are only replacing the Pawn class.
              Originally posted by exo7341 View Post
              I actually had similar issue with my vehicle - I needed player to stay in place when he controls a vehicle... so I did that via direct location manipulation in Tick. It worked fine offline, but caused player warping online. So, I think since location is dependent on velocity/acceleration too - direct affecting those on runtime could also cause problems (if you have something like that in your code).
              Thanks for the quick explanations.
              You're overestimating me. All I'm doing is extending UnrealTournament.UTCharacter and using modified values, then swapping out the pawn using the mutator blueprint as shown above. Nothing fancy at all. This isn't done at runtime, is it?
              I tried extending BaseUTCharacter and moving the values there and still had the sync issues. The pawn itself has no blueprint code, just the mutator. Perhaps modified values in the new pawn class are changed at runtime? Although, I don't see how this is a problem if the pawn is swapped with a new one. And yes, I'm changing velocity/accel/gravity values and as suggested above, may be the hardcoded ones. If so, I'm screwed. Proper movement replication is a complex task and certainly above my skill level.
              Last edited by Calypto; 07-21-2017, 08:27 AM.
              UT2004 Movement Mutator

              Comment


              • #22
                With that setup, there's no problem with your code/replication etc.. The Pawn class is replaced by your mutator on runtime but the server is spawning the class for both sides which is then simulated. It is likely additoinal code is added to the base character (UTCharacter) and/or some values don't work well together with how you set these up. And also, the engine can still have some issues.

                Are you sure the warping does not happen with the mutator nor running but playing on the same server with the same computer? What values did you modify?
                ] Map Scaler Tool | Betrayal for UT4 | No Spawn Protection | No Pickup Timer | BioLauncher (revived) | ForcePickupSpawn | Map cosmetics::P | Safe Spawn::P | Why numbers for Health/Armor suck!::ANALYSIS/CONCEPT
                ] UT3 Addons: NoMoreDemoGuy | PickupRespawnTweak | Mutate Spec | MutePawnSounds | NoPlayerBeacon | Epic FTW | Epic FOCK | TripodSound (... and many more)

                Comment


                • #23
                  Originally posted by RattleSN4K3 View Post
                  Are you sure the warping does not happen with the mutator nor running but playing on the same server with the same computer? What values did you modify?
                  I initially found out because a server owner messaged me saying they had warping when running the mutator. I tested it in the editor, and had the same issue. I'd like to note that the server player doesn't have any problems, just the clients.
                  I've modified almost every value. Gravity, dodge speed, walk speed, dodge height, jump height (and double jump), landing speed factor, landing inertia, acceleration, player size, capsule size, etc. As close as I could get it to UT2004 movement.
                  UT2004 Movement Mutator

                  Comment


                  • #24
                    Originally posted by Calypto View Post
                    I initially found out because a server owner messaged me saying they had warping when running the mutator. I tested it in the editor, and had the same issue. I'd like to note that the server player doesn't have any problems, just the clients.
                    I've modified almost every value. Gravity, dodge speed, walk speed, dodge height, jump height (and double jump), landing speed factor, landing inertia, acceleration, player size, capsule size, etc. As close as I could get it to UT2004 movement.
                    I've just seen you provided the source code (how much is it outdated tho?). Gonna take a look. From what I can see in the video, it only happens with/when dodging.

                    Edit: Not even "slomo" works nowadays in editor. ...
                    Last edited by RattleSN4K3; 07-22-2017, 07:01 AM.
                    ] Map Scaler Tool | Betrayal for UT4 | No Spawn Protection | No Pickup Timer | BioLauncher (revived) | ForcePickupSpawn | Map cosmetics::P | Safe Spawn::P | Why numbers for Health/Armor suck!::ANALYSIS/CONCEPT
                    ] UT3 Addons: NoMoreDemoGuy | PickupRespawnTweak | Mutate Spec | MutePawnSounds | NoPlayerBeacon | Epic FTW | Epic FOCK | TripodSound (... and many more)

                    Comment


                    • #25
                      I've noticed some warping in the editor and checked some values. I saw you were scaling the collision component (CapsuleComponent). Scaling collision objects not always work well since scaling is less checked (by the developers). In this case the movement replication (and the interpolation, making movement smooth) is likely bugging.

                      Solving that issue, you can scale the CapsuleComponent by setting the size and not the engine "Scale" property. Do so by adding some code in the construction script.
                      Click image for larger version

Name:	UT2004Movement_Warping_Fix_Script.png
Views:	1
Size:	150.5 KB
ID:	391240

                      ... additionally by clearing out the capsulecomponent's scale
                      Click image for larger version

Name:	UT2004Movement_Warping_Fix_Props.png
Views:	1
Size:	28.6 KB
ID:	391241
                      ] Map Scaler Tool | Betrayal for UT4 | No Spawn Protection | No Pickup Timer | BioLauncher (revived) | ForcePickupSpawn | Map cosmetics::P | Safe Spawn::P | Why numbers for Health/Armor suck!::ANALYSIS/CONCEPT
                      ] UT3 Addons: NoMoreDemoGuy | PickupRespawnTweak | Mutate Spec | MutePawnSounds | NoPlayerBeacon | Epic FTW | Epic FOCK | TripodSound (... and many more)

                      Comment


                      • #26
                        Originally posted by RattleSN4K3 View Post
                        Solving that issue, you can scale the CapsuleComponent by setting the size and not the engine "Scale" property. Do so by adding some code in the construction script.

                        ... additionally by clearing out the capsulecomponent's scale
                        Thank you so much Rattle, that solved it. I actually reverted the scale and changed the half height and radius right from the details menu. Unfortunately I couldn't get my BP to look like yours, but this works too. It works perfectly fine online from what I can tell. I guess the editor isn't the best for playtesting.

                        From what I can tell, it's not possible to change the capsule to a cylinder collision for the player without redoing UTCharacter, is it? UE4 seems to only like capsules for players.
                        Last edited by Calypto; 07-25-2017, 07:41 PM. Reason: change→changed box→cylinder
                        UT2004 Movement Mutator

                        Comment


                        • #27
                          Good to know that it fixes the problem. Settings the values directly from the details panel should work fine, I just used the ConstructionScript for more convience due to having the other meshes/component also scale by percentage.

                          AFAIK, there's no way to replace the constructed component such as the CollisionComponent. This is what I really miss compared to what UnrealScript had allowed. In C++ it would be possible...
                           
                          Spoiler
                          ] Map Scaler Tool | Betrayal for UT4 | No Spawn Protection | No Pickup Timer | BioLauncher (revived) | ForcePickupSpawn | Map cosmetics::P | Safe Spawn::P | Why numbers for Health/Armor suck!::ANALYSIS/CONCEPT
                          ] UT3 Addons: NoMoreDemoGuy | PickupRespawnTweak | Mutate Spec | MutePawnSounds | NoPlayerBeacon | Epic FTW | Epic FOCK | TripodSound (... and many more)

                          Comment


                          • #28
                            Yes. Apart from ease of use, blueprint seems to lack basic functionality that UScript had, which is really bad. I believe it's not possible to remove sliding, the additional dodge after doing a dodge, or elevator boost dodging. I really hope they add these options to the blueprint default properties. I can't truthfully call it a UT2004 movement mutator with these major issues.
                            UT2004 Movement Mutator

                            Comment


                            • #29
                              WOW...this mutator is perfect! are there some eu server running it?

                              Comment


                              • #30
                                Originally posted by Ghiacciolo View Post
                                WOW...this mutator is perfect! are there some eu server running it?
                                Thanks. Not that I know of.
                                UT2004 Movement Mutator

                                Comment

                                Working...
                                X