Responsive custom movement for networked play

Discussions about Coding and Scripting
User avatar
>@tack!<
Adept
Posts: 338
Joined: Sat Apr 17, 2010 4:51 pm
Personal rank: lol?

Responsive custom movement for networked play

Post by >@tack!< » Mon Oct 30, 2017 9:18 pm

I'm currently making a walldodge mod and I stumbled upon the issue that, when using it online, there is a delay when performing the walldodge (right now the client calls a function on the server which does some calculations and changes the velocity of the playerpawn). The higher the ping the bigger the delay of course. This also happens with most other things like the jumpboots. But preferably it should be responsive like dodging and jumping.

How do I do this?

I understand that there needs to be some kind of clientside simulation/prediction while the server has to correct the client to its actual location.
I have looked into the playerpawn class and saw the several functions that seem to be responsible for this like PlayerMove, ProcessMove, ReplicateMove and ServerMove. I kind of understand what these functions do but I don't know if I can use these to my advantage. I also would want to avoid making custom playerpawns since I do not want to break other mods that might do so.

So to summarize, I want to make a custom movement, in the form of an instant velocity change, responsive on the client like jumping and dodging already are.

Thanks in advance

JackGriffin
Godlike
Posts: 3765
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Responsive custom movement for networked play

Post by JackGriffin » Mon Oct 30, 2017 10:35 pm

Look at the guided redeemer for what to expect in terms of response time. Doing it externally like you want will be messy and laggy if you are making alterations to the existing prediction code for player location.
So long, and thanks for all the fish

User avatar
>@tack!<
Adept
Posts: 338
Joined: Sat Apr 17, 2010 4:51 pm
Personal rank: lol?

Re: Responsive custom movement for networked play

Post by >@tack!< » Mon Nov 06, 2017 5:15 pm

Hmm yeah I figured I have to do it in playerpawn anyway. Thanks

User avatar
~{kRiD}~
Average
Posts: 50
Joined: Sun Jan 20, 2013 7:26 pm

Re: Responsive custom movement for networked play

Post by ~{kRiD}~ » Mon Nov 27, 2017 12:36 pm

>@tack!< wrote:I'm currently making a walldodge mod and I stumbled upon the issue that, when using it online, there is a delay when performing the walldodge (right now the client calls a function on the server which does some calculations and changes the velocity of the playerpawn). The higher the ping the bigger the delay of course. This also happens with most other things like the jumpboots. But preferably it should be responsive like dodging and jumping.

How do I do this?

I understand that there needs to be some kind of clientside simulation/prediction while the server has to correct the client to its actual location.
I have looked into the playerpawn class and saw the several functions that seem to be responsible for this like PlayerMove, ProcessMove, ReplicateMove and ServerMove. I kind of understand what these functions do but I don't know if I can use these to my advantage. I also would want to avoid making custom playerpawns since I do not want to break other mods that might do so.

So to summarize, I want to make a custom movement, in the form of an instant velocity change, responsive on the client like jumping and dodging already are.

Thanks in advance
hey buddy i was looking into this a while back ago also. any way to do this in mutator for is buggy. the best way would be to create a new TournamentPlayer class, txtend off of parent class and proceed to add in your new states and functions.
Image