Perfect Block Window relative to Ping on Multiplayer

Devano

Green Slime
Sometimes I have high ping when playing multiplayer and it makes a perfect block practically impossible. There are even times when I am being hit by an enemy that is not within range of me yet. I think it would be a good idea to slightly increase the perfect block window for multiplayer participants (excluding the host) relative to their average ping.
 

ark626

Moderator
I think this is an issue which isnt possible to solve because you simply cant estimate which ping the clients exact have and i think implementing like that would lead to far worse timings for the perfect guard.
See the ping is sth. changing every slice of a second and each Roundtriptime can differ to more than trice the amount it had just a tick ago. If you increase this and one of the clients would have a pingtimeout it will increase the shieldguard for an entity to infinity i think or it is leading to some other serious bugs.
Also you have to see that those systems dont work like that otherwise games like CSS would have implemented them.

WHich connection (DSL) do you and your friends have? THe issue might solve if somebody else of your group hostes.
THe one with the best DSL should host anyways because the upstream is the bottleneck at tasks like this
 

Pok

Rabby
Ark, what if the perfect guard frames was increased based on only that person ping to the host instead of increasing every clients based on the worst?
 

ark626

Moderator
How would you implement that? You cant seperatley increase the Perfect Guard frames for one client.
For every player the same frames are set and this CANT be changed.
So either it is unfair for people with the high ping (way it currently is)
Or it is okay for even high pings but if there is a high ping it is IMPOSSIBLE to NOT perfect guard for the ones with less Ping and for the host because its ping is 0
 

Pok

Rabby
Make it a lag buff that's individualized for the player? (Like having haste on only one guy). Have it read the ping and then increase the shield frames to match.
 

ark626

Moderator
Okay as i explained before
The ping is different from tick to tick and the reason why it desyncs the perfect guard from the host.
If you send another information it will only get from host to client OR from client to host WITH that ping.

Even if the info is something like a command. You CANT sync it if the ping is higher than 100 ms because 100 ms is the line on which humans start to taking a action as respond

Example i press a button and 100 ms later i receive an answhere i think first it was a respond to my button press.
If it takes longer than 100 ms we start to think if its a lag.(took this out of A.I. courses)

So it is not important what you try the client and the host are NEVER really synched, because of the ping and it isnt important how you implement it they CANT be synched better then they are because each calculation you do need to get from host to client or vice versa and then a new ping occures which delays that info
 

Devano

Green Slime
You can easily write a bit that will cause a ping check for 2-3 seconds every five or so minutes. Take the average and apply an appropriate buff.
 
  • Like
Reactions: Pok

ark626

Moderator
Yeah and as i said earlier that buff is applied to both Host and ALL clients so the ones with a good ping would receive a perfect block which is probably usable after the enemie which attacked died.

There are two things you can do. Make everybody wait for the one with the lowest or for an average ping
=> Causes lagging esque behaivior for Host and everybody with a ping above average.

Or you leave it as it is
=> Causes lagging for high pings.

Waiting is no option in networking cases becasue this are asynchronous networking events.
Trust me i have worked with that kind of network based events and it is NOT as you could easily write a bit that causes a ping check every 2-3 secs and then the buff thing is what is also not working as you mentioned because you only can estimate the next roundtriptime,but as networking is not exact you would get strange behaivior like way too long time for the perfect guard or even a smaller time in perfect guard as it is right now.

There just is NO way of implementing it if you dont trust my simply TRY it out. Download any game maker software write a simple network game and try it.

The next problem is IF a lag occures you LOST packages so the CLIENT does NOT know where the enemie is.
He could have moved he could have stayed. Maybe he killed your Charakter and the client doesnt see that cause he hasnt received that packages.

If the next packages arrive the info will update and BAM all enemies seem to have teleportet as for every other player and even your charakter because every hit causes a change in the x,y values which are not made on your client.

your client ONLY shows images he has nearly NO real data. he only receives the data from the host each tick.
The host receives only key presses from the client and then he executes a skript to handle these(the skripts changes data like you press up this is the info the Server gets from a client, then the server sais okay up is -4 in y so if everything goes as expected he sends y-4 to the client back.

Just try a little around with Game Makers Network example or with Unity and youll see that what you are asking for is clearly not possible.
 

Pok

Rabby
Yeah and as i said earlier that buff is applied to both Host and ALL clients so the ones with a good ping would receive a perfect block which is probably usable after the enemie which attacked died.

And we suggested not having the buff be the same for each player, call them different things if need be (Client 1, Client 2, Client 3) and have them based off of that individuals ping.


There are two things you can do. Make everybody wait for the one with the lowest or for an average ping
=> Causes lagging esque behaivior for Host and everybody with a ping above average.

Or you leave it as it is
=> Causes lagging for high pings.

We weren't suggesting a change to how the latency system works, just something on top of it.


Waiting is no option in networking cases becasue this are asynchronous networking events.
Trust me i have worked with that kind of network based events and it is NOT as you could easily write a bit that causes a ping check every 2-3 secs and then the buff thing is what is also not working as you mentioned because you only can estimate the next roundtriptime,but as networking is not exact you would get strange behaivior like way too long time for the perfect guard or even a smaller time in perfect guard as it is right now.

The lobby currently does the ping-check every few seconds, and an estimation based on your previous ping check is fine (in my opinion) in some very laggy cases you might have a very long perfect guard chance, but so what? I can't imagine it would be abused. I also can't imagine having a situation that had your ping less than zero making you have a smaller perfect guard time.


The next problem is IF a lag occures you LOST packages so the CLIENT does NOT know where the enemie is.
He could have moved he could have stayed. Maybe he killed your Charakter and the client doesnt see that cause he hasnt received that packages.

If the next packages arrive the info will update and BAM all enemies seem to have teleportet as for every other player and even your charakter because every hit causes a change in the x,y values which are not made on your client.

your client ONLY shows images he has nearly NO real data. he only receives the data from the host each tick.
The host receives only key presses from the client and then he executes a skript to handle these(the skripts changes data like you press up this is the info the Server gets from a client, then the server sais okay up is -4 in y so if everything goes as expected he sends y-4 to the client back.

It looks like you think that we're suggesting to somehow make the client react faster than the client can, we're not. What we are suggesting is to have a buff for the clients based off of their individual ping. This buff would add extra frames of perfect guard, that's it.

Individual client buff = Standard perfect guard frames + (ratio * client based ping).



I hope I'm not missing your point here.
 

ark626

Moderator
Yeah a ping check is possible BUT
You cant do something for one client and NOT for the others.

Just to explain this on an example.
I have a ping of 260 ms the others have pings of 20 ms. so NOW i try to implement that system that only now that is taking MY average of 260 ms and adding that to the perfect guard time. Now that Script is inside each enemie so i have to give each enemie entity the pingdata of each client and a null for the host (now i would have to make a if case for every player)

If i attack the player the collision script has to send the entity id of the player together with the ping of the player to an enemie. Now comes the tricky part, the ping inst something that is nice.

if i press a button the server will only recognice that after pingtime,

Now imagine a fight with a bee. The bee attacks ME and i hit the button just in time.
The server wont know that i had blocked because he gets the info on the time bee hits me + ping.
So now the perfect guard thing => it waits perfect guardtimer + ping. so AFTER i got hit the server sees im blocking and BANG perfect guard?

=> I lost HP the bee has got perfect guard blocked and lays on the ground.

and as i said earlier you normaly can not do something sync relevant for 1 player and sync in other timings for others.

Because if scenario above applies but before bee hits me the host with ping blocks the bee in front of me.
After that the bee is perfect guarded my charakter is perfect guarding the bee again with 260 ms. after the host because of this system.
 

Pok

Rabby
Yeah a ping check is possible BUT
You cant do something for one client and NOT for the others.

Just to explain this on an example.
I have a ping of 260 ms the others have pings of 20 ms. so NOW i try to implement that system that only now that is taking MY average of 260 ms and adding that to the perfect guard time. Now that Script is inside each enemie so i have to give each enemie entity the pingdata of each client and a null for the host (now i would have to make a if case for every player)

See, this is where I'm confused, why is the script based on the enemies instead of on the player? Would it not be possible for a player to have a passive skill that increased just their individual frames for perfect guard? If this is the case, wouldn't it be possible to have a passive based on their ping ratios to increase their perfect guard?


Now imagine a fight with a bee. The bee attacks ME and i hit the button just in time.
The server wont know that i had blocked because he gets the info on the time bee hits me + ping.
So now the perfect guard thing => it waits perfect guardtimer + ping. so AFTER i got hit the server sees im blocking and BANG perfect guard?

=> I lost HP the bee has got perfect guard blocked and lays on the ground.

I understand that the client sees a different game than the host, but if they had increased frames I imagine it like this.

Client sees bee coming in
They block early (knowing they have extra frames)
They get a perfect guard with the extra frames
Host notices perfect guard as well (even though the client would appear to shield later and longer on their side
 

Teddy

Developer
Staff member
Here's how perfect guarding works:

You press the shield button, and for 0.2 seconds any hits to the shield will be perfect guarded. It's basically the startup animation for your shield. Now let's add lag to this equation.

On a relatively high ping, say 100, your command to raise the shield will arrive to the server 0.1 seconds after you pressed the button. Thus, the perfect guard window is moved to 0.1-0.3 seconds after the button press.

Your high ping also means that all the enemies are 0.1 seconds away from where they are as well, meaning they will hit you 0.1 seconds earlier than they would playing locally (or 0 ping).

The problem with adjusting for all this, especially when talking about perfect guards, is that in general increasing the perfect guard window wouldn't even help all that much. As Ark said, if you get hit you pressed the button too late, and no code could ever be made to handle something that hasn't even happened yet (as far as the server is concerned).

Implementing a system where ping would give an easier time to perfect guard would both take a lot of work, be tricky to test and probably not improve the gameplay experience regardless. It could not avoid the client taking damage which is the biggest loss of missing a perfect guard (compared to just blocking normally).

A general tip if you know you're lagging is to exaggerate how early you press the shield button. 0.2 seconds is actually quite a long time, so instead of lifting your shield as late as possible try to catch the attack with the end of your startup animation. For up to about 100 ping, this should let you perfect guard correctly most of the time.
 
Top