Shpoike / Quakespasm

Extra bloaty junk to modernise stuff a bit.
http://triptohell.info/moodles/qss/
GNU General Public License v2.0
185 stars 41 forks source link

Display problem with AD + high refresh rate + network/render isolation (+ fog (maybe)) #36

Closed adelpha closed 3 years ago

adelpha commented 3 years ago

I'm seeing a really strange micro-stuttering effect in QSS specifically when playing on AD maps with fog when using networking/renderer isolation on my 120hz monitor. It's hard to describe but it's almost as if frames are being repeated or displayed out of order.

It's very noticeable in several situations. It is most noticeable when strafing around objects. The best description might be that it almost looks like a deinterlacing or ghosting effect, as if frames are being somehow combined. To me it looks like a weird frame timing/presentation issue.

Perhaps importantly: the issue isn't present for the first few seconds after a map is loaded, but starts around the moment when the ambient sounds begin to play, so whatever is happening in the background at map start is perhaps involved.

I think it seems to be limited to AD maps with fog, or at least I haven't noticed the issue on other maps yet if it is present.

The problem doesn't occur in vanilla QS, vkQuake or FTE. I can test other engines if you like.

I have tried capturing at 120fps in OBS Studio but it just ends up with horrible framerates in the final video. I doubt I can capture a video that would properly showcase the problem.

I can provide any other information you require to diagnose this issue.

Windows 10 Pro 20H2 HexaCore Intel Core i7-5820K @ 3300 MHz 16 GB DDR4-2800 EVGA e-GeForce GTX 980 4GB GeForce Driver version 465.89

QSS 2021-03-25 Arcane Dimensions 1.80 with patch 1 1920x1080 @ 120hz host_maxfps 0 or 150 (makes no difference) vsync on or off (makes no difference)

El-Juancho commented 3 years ago

Same, my game does not look "fluid"

garoto commented 3 years ago

Maybe sys_throttle related? Try disabling it by setting it to 0 in the console.

adelpha commented 3 years ago

Sadly, changing/disabling sys_throttle makes no difference.

FWIW, with vsync off and sys_throttle 0.02 I'm getting around 200-400fps on ad_magna.

With vsync off and sys_throttle 0 i get around 320-780fps on the same map.

Even with vsync on it's fully locked at 120 no matter what. Low fps is not the issue; bizarre frame presentation is more like it. As I said before, it's fine for the first few seconds after loading, but as soon as the ambient audio begins playing it starts doing the weird micro-stuttering thing.

Also, the micro-stuttering is completely unvarying, it's always there and it's always the same, it doesn't get better or worse as you play. It goes away when I switch maps, but if I switch to a map with fog, it comes back, exactly the same.

Edit: It's not entirely unvarying. On some maps it seems to come and go depending on location/angle.

With the problem seemingly restricted to AD + fog might it be some QC-related problem with the engine? Fog transition being applied on every frame or something? (I'm just guessing, I have no idea.)

Edit: To rule out any potential custom config issues, I downloaded the latest QSS, added the 2 original pak files to id1 and the latest AD (ad_v1_80p1final.zip) with no other changes. The results are the same.

adelpha commented 3 years ago

Also, I've discovered it's not every map with fog, but I haven't found one that exhibits it that doesn't have fog. Gonna check more maps.

Fog might be a red herring here. Might have nothing to do with it, maybe just coincidence. I'll check all official AD maps and some custom AD maps and report which ones are affected, maybe that'll help narrow the cause down.

adelpha commented 3 years ago

Ok, I'm at a loss to explain it. Fog may be irrelevant - most AD maps have fog of some kind anyway.

The unaffected maps tend to be smaller and have fewer enemies so there must be SOME kind of performance component here that I'm not seeing. Bear in mind, in all cases, the framerate was >120fps with vsync off (I never saw it drop below 200). Most of the time I had vsync on.

Fully affected maps are ones where the stutter is either obvious right from the start or from very near the start.

Partially affected maps are ones where I had to play through for a while and the micro-stutter was only obvious in certain areas or when looking certain directions.

N.B. I don't know whether this is useful information, but while testing I have noticed stuff going "missing"; occasionally weapon sounds not playing, blood particles not appearing, door sounds looping when they shouldn't, etc. I don't know enough about Quake's engine to say what that means, if anything.

In vkQuake, all of these maps play smooth as silk with networking/renderer isolation on.

Unaffected maps

ad_ac ad_e1m1 ad_s1m1

Partially affected maps

ad_crucial ad_lavatomb ad_swampy

Fully affected maps (affected from the start or near the start of the map)

ad_akalakha ad_azad ad_chapters ad_dm1 ad_dm5 ad_e2m2 ad_e2m7 ad_end ad_grendel ad_magna ad_metmon ad_mountain ad_necrokeep ad_obd ad_scastle ad_sepulchur ad_tfuma ad_zendar

adelpha commented 3 years ago

I actually managed to get a capture of it!

Dropbox link to video

45 second video 1080p@120fps so it's about 110mb but it shows the issue pretty clearly. The problem begins as I'm strafing around the flame at the map start (around 14 seconds into the video) and continues until the end.

This illustrates the problem better than I can describe it with words. The weird stuttering/ghosting/blurring effect from 0:14 onwards is not a result of video compression; it is exactly what QuakeSpasm Spiked is rendering.

Viewing on a 60hz monitor will not depict the problem accurately.

ericwa commented 3 years ago

Yeah I get this as well with AD1.8 and QSS Win64 2021-April-01. Doesn't happen for me with with AD1.8 and the QSS "Fallback" build Win64 2020-August-29 (Unsupported).

When I frame step around 15s in your video (VLC: press or hold e), where you're circle strafing around the torch, every frame has the player's view angle changing as a result of your mouse movement (good), but only every second frame has player position movement (resulting in annoying stutter).

(btw I am on a 165Hz monitor, host_maxfps 250)

adelpha commented 3 years ago

That's good information, Eric, thanks!

Sadly there doesn't seem to be any dev build archive, so we can't bisect until we find the build that introduced the problem. :/

Edit: Built locally from Github ID 9ffca1de (17/10/2020) and it's fine, so the problem was introduced between October and now.

korendian commented 3 years ago

I have also been experiencing this problem with the QSS build from 2021-04-01. However, I have a second install of QSS which is on the build from 2021-03-06 (3c5059a12d505be4942ea73e3745590270443476) which does not have the same issue. I hope this helps identify the problem.

adelpha commented 3 years ago

Thanks @korendian, that might help pinpoint the change that caused it.

Does anyone know if Spike actually looks at the Github issues at all, or is it worth trying to notify him directly?

Obviously I don't want to bother him if he's busy with other things, but if he just never reads these then maybe another method of contact would be better?

adelpha commented 3 years ago

Fixed by Spike tonight. Thanks Spike. Pasting what he said in Discord for the benefit of anyone following this.

Spoike — Today at 00:04 hrm right, so it was an existing bug. and my serverside change resulted in a new bug its sending far too much entity data at the client now which is overflowing a single datagram and getting splayed across multiple packets and that's what's causing the lerp issues

sv_main.c line 2740ish: msg.maxsize = MAX_DATAGRAM;//client->limit_unreliable; if you change it to read as that, the server will send massive packets preventing the whole round-robin stuff from breaking lerps as a temp fix, of course. so yeah, if that small change 'fixes' it then its two separate bugs.

1605... why 1605 so often? it makes no cents! hmm, I might be trying to hunt the wrong thing. the 1605 entity is probably just a sprite entity. yay for AD.

StOo — Today at 00:33 AD is useful - it makes the bugs show up

Spoike — Today at 00:33 AD is abusive.

StOo — Today at 00:33 i'm sure you're right

Spoike — Today at 00:36 but yes, it should also be using particle script stuff, not sprite entities. so that's the serverside bug that's resulting in more data being sent. so the trigger is ea45849ba9f53f67bf44e8b205ac29fbd52fbf9f for the serverside bug, with the clientside interpolation bug previously existing but now getting triggered.

StOo — Today at 00:43 cool

Spoike — Today at 00:43 yup, much better.

Spoike — Today at 00:55 binaries updated. the serverside bug is fixed so it should be back to how it was before.

StOo — Today at 00:55 nice

Spoike — Today at 00:55 though the clientside bug is still there. its more awkward to fix. r_scale-with-csqc should also be fixed