ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Uncapped is lagging a frame behind AND server unfairness

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Confirmed but Deferred Bugs
View previous topic :: View next topic  
Author Message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Thu Aug 05, 2021 11:42 pm    Post subject: Uncapped is lagging a frame behind AND server unfairness Reply with quote

Hello,

I think I've finally figured it out what's the deal with "server advantage" vs "server disadvantage".

At times, uncapped is interpolating the frames 'bad way' instead of good way. What I mean is:

100th ENGINE FRAME. Interpolation happens from 99th frame to 100th frame. This means UNCAPPED is showing every thing 1/35th of a second too slow. It shouldn't do that, it should predict what's gonna happen, since it should know it already as the packet is sent anyways. It may cause a bit more 'warping' in the screen if you get hit by opponent, but at least your reaction times are not 1/35 of a second too slow.

When that 'laggy uncapped' happens, it is better to use CAPPED (lol) to have faster reaction times. I've seen it working as intended(?) that there is no such a delay.

Second thing:
by luck, you either get PLAYER1 advantage versus PLAYER2 disadvantage.

It's the old story: when Player1 shoots at Player2 exactly at 100th engine frame, Player2's position is taken from 99th frame because Player1's states/actions get updated first, so the sprite is 'lagging' behind a bit in the vision. (At least this is the case in vanilla Doom. I can confirm this when building a demo frame by frame or when a player teleports/respawns in a deathmatch).

The result of these two mean that:
You either have 1+1 = 2 frames advantage in reaction times OR if the luck is the opposite, you get 1-1 = 0 frame advantage in reaction times. That's total of 57 ms in reaction times when you have 'server advantage'.

Now the funny thing is that when you compare TWO DIFFERENT MATCHES, it maybe so that you had +2 frame ADVANTAGE in the first match, but 2 frame DISADVANTAGE in the second match: end result difference is FOUR (4) difference between those two matches. So when you compare the results of two matches, there can be a whopping 114 ms reaction time difference.

The combination of these two things make it absolutely 'hilarious' when you compare two matches at times. Sometimes you beat your opponent so easily, but at times it seems like your opponent have faster reaction times than what humans are capable of having (according to the Olympics rule: no under 100 ms reaction times are possible.)
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Fri Aug 06, 2021 12:10 am    Post subject: Reply with quote

Proof that the uncapped lags behind a frame:
https://www.youtube.com/watch?v=9v2bdIkTL5A

Here I run a hallway straight forward (straferun), but at the same time I toggle between UNCAPPED/CAPPED very fast. Watch the video frame by frame (by stopping the video and pressing , or . keys).

If you move the video forwards frame by frame, you will see that the player moves BACKWARDS at times because of perfect timing catching the broken uncapped in action. When vid_uncapped_fps is "True", the screen warps to the wrong direction on rare cases.
Back to top
View user's profile Send private message
Krawa
There is a limit


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Fri Aug 13, 2021 4:16 pm    Post subject: Reply with quote

Hi there,

For the first thing:
The physics of the engine, calculating damage, getting input values from mouse and keyboard, etc. run each tick on the engine.
1 tick is 1000 ms / 35 (fps) ≈ 28.6 ms
So that's "real time" each tick.
Uncapped interpolation can't go to "future", because the input values are not there. So interpolation uses the fractal time of the last tick.
That means the view is somewhere between 0 and 28.6 ms delayed, depending of the timing pattern (not always 1 full tick, in average half a tick).

The diagram below shows the timing:
red: capped 35 fps
blue: uncapped 60 fps
green: delay of 3 ticks as reference e.g. the time between pressing fire SSG and damage calculation of the SSG (Single Player, no discussion about ping delay here).

So I would say:
Use capped if
- you want be sure your view is exactly tick related.
- you want to be closer to the oldschool Doom spirit.

Use uncapped if
- you prefer the smoother view.
- getting "stressed" or "getting headache" over time of the "choppy" view in capped.
- you can't really see/feel a difference between SSG firing and damage (Single Player).
- you feel better with uncapped aiming (it's easier to follow your target).

Of course it's taste of matter what you prefer.
Besides of all that theory give different settings a try to see what feels better for you.




For second thing:

That needs deeper investigations.


Last edited by Krawa on Sun Oct 31, 2021 9:54 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Sat Aug 14, 2021 6:48 am    Post subject: Reply with quote

Krawa wrote:
Hi there,

Uncapped interpolation can't go to "future", because the input values are not there. So interpolation uses the fractal time of the last tick.


It can. It just needs to be done differently. For example, wait for the 'logic tic to happen' and only then implement the turning from the interpolated frames. Now the problem is that:
1. You turn and shoot.
2. Your aim is perfect
3. Shot misses because you turned more than what you really turned.

This happens because the uncapped shows that you aimed perfect, but the logic says you turned a lot more, causing you to turn more. It is more severe the higher your FPS/HZ is (video only 60 fps). It happens way too often and it is annoying. The odds for that happening is related to the 1/35 second thing, meaning you aim wrong even with perfect aiming. Even the timing of the SSG (the visual that the SSG shoots in your screen) is affected beause of this, I don't think it is synchronized perfectly. Sometimes you get the shot timing correctly, sometimes not. Sometimes you get the turn correctly, sometimes now.

Check this video for example:
https://www.youtube.com/watch?v=l1EEtui2hgc

The very first shot in the video, check it frame by frame. The shot is not even remotely close to the point where you aim. In my opinion, it would be better that the aiming was taken from the interpolation, so the interpolation would create 'fake logic tics', so it wouldnt lag behind, and every 1/35th of a second it passed them as real logic tics. Then there would be no delay and it would be perfectly matched with the visuals. Well, there would be a delay from the 'press mouse' and then some 0-28.6ms delay till the fire command is taken, hmm. Seems like it is not possible to fix this issue.... well, maybe I use toggle capped/uncapped. When I need high reaction/fast turning, I use capped, otherwise uncapped.



The server unfairness is shown here pretty good (video taken during gameplay, not from replay) https://youtu.be/dF79Dx4--Ds?t=402

The shots that make the bullet counts from 142 -> 141 and 141 -> 140 are both hits, even though the first shot is too much off, especially when you consider that the chaingun had NO SPRAY. The game draws the spritetes 1 game logic delayed for the disadvantageous player (in this case me), another 1/35th of a second delay in the reaction times comes from the uncapped.
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Sat Aug 14, 2021 6:59 am    Post subject: Reply with quote

Hmm, is this the reason why the aiming was lagging one frame before? It fixes it in some sense, but causes other problems, heh.
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Thu Aug 19, 2021 10:43 am    Post subject: Reply with quote

I just had a tiny realization.

Isn't it a bit strange that the weapon's "FIRE" animation is shown at the beginning of the interpolation? It means that the HUD's weapon animation is incorrect, it should be synchronized accordingly with the logic frames.

This fits perfectly with the 'feeling' players have had:
sometimes it feels like SSG is shooting faster than it should
sometimes the game feels faster than what it should be

Maybe it is because sometimes the weapon in HUD is correct, sometimes not, based on pure chance. The SSG really feels faster at times than other times, but it is impossible to capture it (to the video) because it is the response time of the SSG.

I don't know if this is related BUT:
sometimes when you play single-player, the game has like 5 second input lag (no joking, it is around 5 seconds), but sometimes it works as intended. I haven't seen any logic behind it what causes it. But I know it is not web browser behind the scenes affecting anything as it happens even when you have it closed.
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Sat Aug 21, 2021 11:26 am    Post subject: Reply with quote

And here's the input lag I was talking about:
https://www.youtube.com/watch?v=2v0qy8vdnlQ

Interesting is that keyboard is not affect.
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Sat Oct 30, 2021 11:24 pm    Post subject: Reply with quote

Well, I am now quite confident that the player who joins first has the disadvantage in duels. The player joining second has the advantage.

We played with Titan:
First match in d2m1, I joined first: I had NO CHANCES of against his SSG reactions. I believe I lost all the reaction times against him. I didn't tell him about the issues nor had I said him about "join first vs join second".

In King1, I joined first, match was really close. We took a rematch. This time I changed the order of join: I was the guy who joined 2nd. Now I had the advantage and the match was really easy for me. Titan said after the match: "Shots didn't connect." (40-22 was the score).

After my win in king1, I told him that joining first gives you 'the' disadvantage. We tried king1 again, but I joined first. I swear I played as strong as I could but I lost 37-40. I simply had no chances in reaction times anymore against him + the shots had troubles connecting. After the match he said: "Shots connected good."

This bug/advantage thing is in all Doom source ports, including vanilla Doom.
Back to top
View user's profile Send private message
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Tue Nov 02, 2021 2:23 am    Post subject: Reply with quote

Check this picture out, for example:


The situation is that the player teleported on this frame. Which spot should you shoot to hit the target? The left teleport or the right teleport?

The answer: depends on the order of join.
Back to top
View user's profile Send private message
Titan_66
Unstoppable!


Joined: 20 Jun 2004

PostPosted: Sat Nov 13, 2021 12:04 am    Post subject: Reply with quote

Looper is right. Zdaemon netcode behaviour is very strange. I was testing it also with Darkenergy on finnish server. For example on d5M1, when i joined second - it was easier to hit him despite i was rushing. In opossite, when i joined first, it felt like i have delayed reaction. It was much harder to hit him properly.

It seems that player 2 has the edge everytime. However you can feel it more if players have similar pings. There is another factor which would affect it. It seems that there is a combination of "who joins first" + higher ping. I believe that if we try it on a czech server or german, i will have some ping/server advantage too. Thats why i prefer to play on euro lap edl 2, or in worse case on london. Lap server 1 edl is disadvantage to me.

It seems that everything has started since that unlagged feature has been added into zdaemon netcode. Still i am not sure, if this issue is here all the time. Looper is right that today we have better monitors (hz), hardware. However i dont remember for a such issues in the older days. In 1.08 game felt balanced much more.

This explains why many players are angry, mad etc. Duelist could feel this most. I believe that for example survival you dont care too much. I am also aware, that duelists are not important to zd team like survival players etc. Anyway if it is not possible to fix this, you should notify a player, who has advantage, disadvantage (who joins second). It is fair to play both ways (first/second) and then overall score decides. However it is more exhausting to play 10 games instead of 5 Smile

This reminds me old doom2.exe where player 1 - Green had the edge always. Indigo, player 2 was delayed little bit. It was necessary to play as both to make it fair. However now zdaemon makes green as player 2 Smile

Is it possible to make anything about this, cause it is quite frustrating to play unbalanced games.

In zdaemon 1.08 i didnt feel a problem when i had ping 60 against ping 30 on his server. It was much more playable.
Back to top
View user's profile Send private message Visit poster's website
DarkEnergy
has entered the game!


Joined: 24 Sep 2016

PostPosted: Sun Nov 14, 2021 12:40 am    Post subject: Reply with quote

It is clear that if pings are same the player who joins first has disadvantage. I saw this with Looper when we joined in duels with different orders. Player who joins first seems to have delayed reactions and player who joins after see opponent moving more smooth and has less dropped shots. And this is not just a feeling when playing but it can be also seen clearly on scores. But if I play on finnish server with someone who has high ping then I seem to have always advantage, no matter who joins first. Against Titan on finnish server I have always advantage no matter who joins first, though ping difference is small. If I join first he seems to have an advantage on reactions and he shoots before me on reaction situations, but he still dropshot a lot more which makes overall advantage for me. If I join after him then I shoot first and have all kind of advantage.
Back to top
View user's profile Send private message
AF-Domains.net
Dark Messenger of IRC


Joined: 01 Jun 2002
Location: United Kingdom

PostPosted: Sun Nov 14, 2021 4:16 pm    Post subject: Reply with quote

At a base level this topic brings up two subject matters:
1) Uncapped
2) Unlagged

Both are two completely different cases.

Keep the topics entirely separate to avoid conflaction.

Also Titan.. "I am also aware, that duelists are not important to zd team like survival players etc." - That is your opinion not fact; leave it out of here.
Back to top
View user's profile Send private message Visit poster's website
Titan_66
Unstoppable!


Joined: 20 Jun 2004

PostPosted: Sun Nov 14, 2021 8:20 pm    Post subject: Reply with quote

AF-Domains: Ok, well sorry, didnt want to be irritable Smile

yeah, maybe we should make a separate topics.

In short:

1.) Player 2 has smoother, faster reaction, player1 feels like a delayed player with higher ping

2.) Despite pings are similar, home server gives you advantage, sometimes no matter who joins first

The question is, is this a part of unlagged feature, this netcode behaviour, or was it here all the time ? Especially 1.)

Anyway i have been using uncapped, however it shouldnt affect it right ?
Back to top
View user's profile Send private message Visit poster's website
AF-Domains.net
Dark Messenger of IRC


Joined: 01 Jun 2002
Location: United Kingdom

PostPosted: Sun Nov 14, 2021 8:57 pm    Post subject: Reply with quote

As far as uncapped goes, that won't have any basis on what is transmitted to the server.

As for the "player1" / "player2" effect, that is a tough one, since that behaviour is what one would expect in the case of the original synchronous peer2peer multiplayer, rather than this asynchronous client/server multiplayer environment.

It is quite possible that this effect has always been present, but other aspects in the past muddied it somewhat which made it less noticeable (this cannot be classified as a positive or negative effect due to a multitude of factors). (1)

Regarding the "home server" effect, nothing quite beats being on a LAN without any other intermediate routes in the way. (2)

There'll likely be further digging at one point once an exact chain of events internally has been established.

Leaving this as unconfirmed for now; it isn't rejected, but I cannot flag this as confirmed just yet. It is subject to change.
Back to top
View user's profile Send private message Visit poster's website
Titan_66
Unstoppable!


Joined: 20 Jun 2004

PostPosted: Mon Nov 15, 2021 11:26 am    Post subject: Reply with quote

I have asked ocelot if he has ever noticed of "player2 advantage" in zdaemon in the past.

"No I don't remember ever noticing anything like that in Zdaemon. In doom2.exe of course, who had the advantage depended on ping. At low pings (and lan) it was Green, at high pings Indigo. Well I never noticed it, but this was 2003-2010 so the problem might have emerged after my time"

And believe me, he was perfecionist Smile
Back to top
View user's profile Send private message Visit poster's website
AF-Domains.net
Dark Messenger of IRC


Joined: 01 Jun 2002
Location: United Kingdom

PostPosted: Mon Nov 15, 2021 3:33 pm    Post subject: Reply with quote

We'll see what shakes out over time in that case.
Back to top
View user's profile Send private message Visit poster's website
Looper
Posting Spree!


Joined: 05 Apr 2020

PostPosted: Wed Nov 17, 2021 7:37 pm    Post subject: Reply with quote

I wanna point out that the "join first" vs "join second" 'rule' only applies when there are 2 players in the server. When a spectator connects to the server during a match, the advantage/disadvantage gets "another roll", meaning the advantage can shift from one player to the another. If the specator leaves then, I am not sure if the advantage/disadvantage reverts back to the 'original advantages', it's too much research for me, but I know something happens to the advantage/disadvantage, when the spec leaves.

Also, if there are already spectators in the server, the advantage/disadvantage may not be "join first gets disadvantage" and "join second gets advantage", but something random, yet consistent during the match, assuming no one leaves or connects the server.
Back to top
View user's profile Send private message
AF-Domains.net
Dark Messenger of IRC


Joined: 01 Jun 2002
Location: United Kingdom

PostPosted: Fri Dec 03, 2021 11:12 pm    Post subject: Reply with quote

Moved this to the deferred section since a great deal of investigation is required before any potential possibilities can be derived.

It hasn't been rejected.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Confirmed but Deferred Bugs All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group