Suggestion - Tweak to the current ping based swing delay system

Valoran

Well-known member
May 28, 2020
364
434
63
Hello again everyone, in this post i'll be explaining how the current swing delay system functions followed by some criticisms I have, finishing up with a proposed solution to these criticisms.

Although this post is purely targeted towards Starvault and their coding team or whoever handles the networking, I chose to post it here anyway for two reasons, one to aid public knowledge of a current game system and to create a location for any potential discussion on this topic, and two because it's easier to format information like this into a forum post than a discord PM.

A fair warning, this is a rather long and in depth post.


In order to get started, we must first establish some basics about networking and how information travels between our client PCs and the Mortal 2 server.


To aid this explanation I will enlist the help of an ms paint drawing I made. Each step in the explanation will add an element to the drawing.

Starting with the basics:
DelayExplanation_Step_1.png

In the above picture, I am displaying the communication between my PC, the MO2 server and one other client PC.

My PC has a ping of 300ms to the MO2 server, as I live in Australia. My PC is represented by my name "Valoran", in blue.

The time it takes to travel between the devices is represented by the yellow line and ms numbers.

The MO2 server is represented by the name "Server" in orange.

The other client PC connected to the server has a ping of 20ms to the server, as they are located in Europe. The European client PC is represented by "P2" in green.


Because ping is a measurement of the response time between two devices ( or round trip time if you want to be technical ) we can divide this number by 2 in order to get the one way trip time between two devices, or in other terms the time it takes to go from just my PC to the server, once.

Looking at the image we can see information from my PC takes an average of 150ms to travel to the server, and then the server will redistribute that information to all the connected clients.

In order for the information I sent to reach P2, it will take 150ms + 10ms to arrive. As it first must reach the server, then be distributed to the connected clients.



Now that we can visualise the communication between devices, we will add in another element to the image.
DelayExplanation_Step_2.png

In figure 1.2 we can now see a labelled timeline of actions, starting from the left.


Chronologically,

1. I release my left mouse button and send an update to the server that I am releasing my swing.
2. This update travels for 150ms before arriving at the server.
3. The server registers that I want to release my swing, and then distributes this information to all connected clients.
4. This update from the server travels for 10ms before arriving at P2's client PC.
5. P2 sees me release my swing in game.

This action of releasing a swing is the main topic of this post.

A few patches ago, Starvault implemented a patch that changes the above steps slightly, which we will now see.



Let's add another element to the image.
DelayExplanation_3.png
In this new element labelled "Swing delay" or figure 1.3, we can visualise the new system.

As before we will break it down in chronological steps:

1. I release my left mouse button and send an update to the server that I am releasing my swing.
1.1. My swing is now in standby mode, and will remain unreleased until the server tells me I may release it

2. This update travels for 150ms before arriving at the server.

3. The server registers that I want to release my swing, and then distributes this information to all connected clients.
3.1. The server send an "Okay to release" message back to me, indicating that I may now release my swing.

4. The update to P2 from the server travels for 10ms before arriving at P2's client PC.

5. P2 sees me release my swing in game. ( Total time passed at this point: 160ms )

6. The "Okay to release" update travels for 150ms before arriving at my PC, allowing me to release my swing and perform the animation. ( Total time passed: 300ms )


I know this part can be a little tricky to understand at first, but what this means is that in this particular situation where I, with 300 ping am fighting someone who has much lower ping, they will actually see me release my swing on their screen before I do on my own.

This results in the person with lower ping having an extreme advantage in reaction time to my swings, as well as severely reduced attack speed for myself, as every single one of my attacks must first go through a 300ms waiting period before it may be released.

NA players also feel this difference when fighting Europeans, but to a much lesser extent than I do.

This has resulted in my melon timer scores going from 11.4 seconds minimum, to 14.5 seconds minimum, with the exact same weapon.


Now that we understand how the system works, let's understand why it was implemented.

This system was designed to perform two functions:

1. To prevent people from abusing artificially increased high latency to gain an advantage in PVP.

2. To keep players in sync with each other visually.


Let's understand how it achieves function 2.

It's time for a new image element.
DelayExplanation_Sync_Explanation.png
In this new scenario, everyone involved has 150ms ping to the server.

With the current delay system in place, by the time I get the "Okay to release" message from the server, I'll be releasing my swing on my screen at the exact same time everyone else sees me release the swing on their screens, as a total of 150ms will have passed for everyone before the swing is visually released.

This is fantastic, but only works if everyone has an average of the same ping.


So, regarding function one, the system works very well.
You can no longer artificially increase your ping to 1000 and cause massive issues in the game that allow you to hit other people when they are unable to fight you properly.

However, at the same time the system has made it impossible to play properly for people like me that simply have a high ping naturally, and are not increasing it maliciously.


Regarding function two however, the system only works to keep players in sync with each other if all the players involved have roughly the same ping.
Which means the system is effectively self defeating, as if everyone has the same ping there will be no advantage imbalance.

As Mortal is a game accessible world wide, it is not only highly likely but inevitable that people will encounter other players with drastically different ping to their own.


Now that we have established an understanding of how the system works, the problems it intends to solve as well as my criticisms of it, we come to my proposed solution to this problem.


My proposed solution is a relatively simple one, that should keep everyone involved happy.

In order to avoid the crippling swing delay added by the system, my solution would be to remove the need for a response from the server before the swing is released, but still maintain the added delay, meaning only the one way trip time will be added to the swing as a buffer.

This can be achieved through any number of methods, one simple suggestion would be to monitor a players average ping over the last few seconds, divide it by 2 to get the one way trip time and add that to every swing. Like I said that that's just a simple brainstorm and i'm sure Starvault would come up with a better way of achieving this.


The resulting system would still meet the criteria of preventing people from abusing high ping, as they will still have an immense amount of delay added to their swing if they artificially increase their ping to the point where it would cause issues.

However, players would have exactly half the delay they currently see in game, making the game immensely more balanced and competitive as people outside Europe will be able to play at a closer level to the Europeans, without affecting the Europeans in any way.


The system will also still help to keep players more in sync than without it, as players will now be perfectly in sync with the server itself.


I know this was a very long post, I appreciate and congratulate anyone who had the patience to read through all of it.

Hopefully my diagrams and explanations were sufficient in explaining the issue present here, and my solution a tangible one.


If anything is not clear enough I will make more effort to explain in the comments should it be necessary.

I have been studying networking professionally for the past two and a half years, and I know it can be tough at times to explain things in a manner that people are receptive to. I tried to be as straight forward as possible, obviously omitting loads of important technical aspects, as I don't believe they are relevant to understanding this post as a whole.


Thank you, and have a wonderful day.


P.S If I have made any mistakes or incorrect statements regarding how the current system works, please let me know so I may correct them.



Too long didn't read:


Currently everyone has their ping in milliseconds added in the form of a delay to every swing.
So if I want to release a swing and I have 300 ping, it will add 300ms to the beginning of every swing.

This should be tweaked to only half of our ping, which will close the gap between EU and NA players making the game more competitive for people with high ping while not affecting low ping players at all.

Currently NA players with 150 ping will have 150ms added to their swings, with my proposed solution they will only have 75ms.

The proposed change does not detract from the purpose of the implemented system, in that it still stops people with high ping from abusing it, and keeps players in sync better.
 
Last edited:

bbihah

Well-known member
Jul 10, 2020
1,111
951
113
Seems like a good idea.
High ping players - International players are a reality and adjusting the game to fit that rather than the best case scenario is what they should be able to deduce with the insight of a previous release under the exact same circumstance as now. Second best would be to have a big enough population to afford splitting the population with multiple servers on different continents.

But lets be real here, to begin with the game will struggle with getting enough people for one server and if MO1 is any pointer it will even have a hard time fitting any big amount of people on it, too. And to build a big enough following with just one server to have it worth splitting up the server the game would have to actually be enjoyable for all.
 
  • Like
Reactions: Najwalaylah

Kevin

New member
Jun 7, 2020
24
10
3
I appreciate the effort and you have good points, an easy solution is an NA server.
 
  • Like
Reactions: PatWins

Legendary Man

New member
Jul 4, 2020
5
3
3
This actually speaks volumes to the necessity of having regional servers, the idea of a new server being a different continent is a great idea and would be awesome to see the economies develop and how people play throughout the two locations
 

WesleySnipes

Member
Jul 8, 2020
30
7
8
I wonder why they're checking the swing and not just the point of impact with another player. Having to validate every swing seems like a lot of overhead which would lead to performance degradation for everyone. For instance GW2 did a check on abilities, sounds sensible right? When you have hundreds of people fighting against each other all over the map that's a lot of checks which leads to a ton of performance issues; hence skill lag.

Would it be possible for you to find a player with substantially less ping to the server, have both people record a video and do a side by side comparison?

The developers need to decide whether MO2 is for everyone (like henrik has said in the past) or just EU. If it's the former they need to make sure everyone is on fair ground as far as latency / ping / performance is concerned.
 

Rhias

Well-known member
May 28, 2020
1,143
1,330
113
@Valoran Your suggestion should be working great for people with stable ping.
But not that great with volatile ping.
You probably know that it is not guaranteed that packages take the same route and therefore the ping between the same locations can be quite different.
 

barcode

Well-known member
Jun 2, 2020
370
352
63
maybe im late to the party but why is there any delay in the swing at all? it feels a bit sluggish in game to release the swing and have some delay before you actually do the swing.

why not simply release the swing immediately on the client. the server would have to do some checks to verify you're actually within range based on where you are and where your opponent is (tricky since technically you see the ghost of where your enemy is on your screen, but i think can be done using what the server knows as your avg ping time).

was this how it was previously and was an advantage for low ping players? was it an advantage for high ping players? maybe i dont know what the initial issue was that they tried to solve with this change

-barcode
 

Rhias

Well-known member
May 28, 2020
1,143
1,330
113
When the swing is released immediately high ping players are able to hit the other player before the other player is even able to see the swing. Therefore it would be basically impossible to parry this player unless you block in the right direction before the high ping player charges it's swing on your screen.
 

Sebastian Persson

Lead Programmer
Staff member
May 27, 2020
85
216
33
40
Sweden
With the current system if everyone has a ping of x everyone will see your released swing after x ms Including you.

With your idea everyone would see your release after x but you would see it x ms before everyone else.

I understand that this would be better for your case and probobly be more fair for you but we need a system that is fair for the average ping.
 
  • Like
Reactions: bbihah

barcode

Well-known member
Jun 2, 2020
370
352
63
i guess my question is more how is the hit calculated, and at what point do blocks count?

im assuming the hit is calculated from the swinging client, perhaps the block is calculated from the swinging client based on what it thinks the other guy's blocking state is? maybe its calculated on the server based on the time the client hit? are gamestate timestamps used instead?


lets say you have a round trip ping of 300, the enemy has a ping of 50, and you both have a weapon that has a 500ms charge, and you swing immediately

t0 -> start charging
t150 -> server knows you started charging
t175 -> enemy knows you started charging
t325 -> last time enemy can block to have it registered by your client that they blocked by the time your swing gets there
t500 -> you finish charging and swing
t625 -> last time enemy can block to have it registered by server that they blocked by the time your swing gets there
t650 -> server knows you finished charging and swang
t675 -> enemy knows you finished charging and swang

reaction time to block from client authority: t325 - t175 = 150ms
reaction time to block from server authority: t625 - t175 = 450ms

and as the low ping player:

t0 -> start charging
t25 -> server knows you started charging
t175 -> enemy knows you started charging
t325 -> last time enemy can block to have it registered by your client that they blocked by the time your swing gets there
t350-> last time enemy can block to have it registered by server that they blocked by the time your swing gets there
t500 -> you finish charging and swing
t525-> server knows you finished charging and swang
t675 -> enemy knows you finished charging and swang

reaction time to block from client authority: t325 - t175 = 150ms
reaction time to block from server authority: t350 - t175 = 175ms

so now lets add in delay

t0 -> start charging
t150 -> server knows you started charging
t175 -> enemy knows you started charging
t500 -> you finish charging and tell the server you wanna swing
t625 -> last time enemy can block to have it registered by your client that they blocked by the time your swing gets there
t650 -> server knows you finished charging and want to swing
t675 -> enemy knows you swing
t800 -> you know you swing, and calculate the hit
t925 -> last time enemy can block to have it registered by server that they blocked by the time your swing gets there
t950 -> server knows if your client said it hit or not

time to block from client authority: t625 - t175 = 450ms
time to block from server authority: t925 - t175 = 750ms

and as the low ping player:

t0 -> start charging
t25 -> server knows you started charging
t175 -> enemy knows you started charging
t375 -> last time enemy can block to have it registered by your client that they blocked by the time your swing gets there
t425 -> last time enemy can block to have it registered by server that they blocked by the time your swing gets there
t500 -> you finish charging and tell the server you wanna swing
t525 -> server knows you finished charging and want to swing
t550 -> you know you swing, and calculate the hit
t575 -> server knows if your client said it hit or not
t675 -> enemy knows you swing

time to block from client authority: t375 - t175 = 200ms
time to block from server authority: t425 - t175 = 250ms

am i missing something? how has this improved anything for the high ping guy? sure he gets an extra 50ms (the low ping guy's round trip time) to activate a block but the other guy gets an extra 300ms (the high ping guy's round trip time)

-barcode
 

barcode

Well-known member
Jun 2, 2020
370
352
63
The hit is calculated on the client that release the swing. Block or parry is calculated on server
did i do my math right then? the delay gives the other guy more time in proportion to your ping time, so low ping guys get an even wider gap vs high ping people?

-barcode
 

Teknique

Well-known member
Jun 15, 2020
1,758
1,359
113
When did people ever care about high ping in mo 1 other than the occasional carnage meme
 

Rorry

Well-known member
May 30, 2020
1,018
531
113
44
Kansas
With the current system if everyone has a ping of x everyone will see your released swing after x ms Including you.

With your idea everyone would see your release after x but you would see it x ms before everyone else.

I understand that this would be better for your case and probobly be more fair for you but we need a system that is fair for the average ping.
What are you considering the average ping? If it is a target number that you have calculated for, I mean. Being from NA, the system we have now will most likely keep me from wanting to PVP at all.
 

Valoran

Well-known member
May 28, 2020
364
434
63
With the current system if everyone has a ping of x everyone will see your released swing after x ms Including you.

With your idea everyone would see your release after x but you would see it x ms before everyone else.

I understand that this would be better for your case and probobly be more fair for you but we need a system that is fair for the average ping.
I believe I addressed this in my post.

The problem is that balancing the game around a theoretical average ping is bound to fail, when the ping between two randomly selected people can be anywhere between 20 and 300+.

Currently NA players are feeling the 100-180ms disadvantage they have against Europeans, because a fight between those two groups is currently not fair.

I believe my solution makes it more fair for everyone involved, as maintaining perfect sync with the server is more reasonable than maintaining sync with only other people that have the exact same ping as you, and creating significant disadvantage against people with drastically different ping.

Especially when encountering someone with drastically different ping in a one server game is inevitable, meaning that encountering a significantly unfair fight is inevitable.
 

Kevin

New member
Jun 7, 2020
24
10
3
Sebastion has to make a tailored prediction system that scans an individuals ping and calculates differently based on each person, a blanket prediction system will have discrepancies in it due to wide range of ping.