Responsive custom movement for networked play
Posted: 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
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