ddnet / ddnet

DDraceNetwork, a free cooperative platformer game
https://ddnet.org
Other
557 stars 406 forks source link

Large skins cause client lag spikes #9032

Open Desour opened 2 hours ago

Desour commented 2 hours ago

I've recently noticed some client lag spikes (i.e. one frame too very long). And it seems to be related to players entering (and leaving?) the game.

I should probably add that I've also recently set my community skins download url to the not so curated https://ddstats.tw/skins/.

If I open the tee skin settings tab, there's also lag spikes. (I have a bunch of star-ed skins.)

I've done some profiling and some large skins take a considerable large amount of time to load. E.g. LoadSkin takes 91 ms samogg, and 200 ms for twitter_emoji. The graphics thread seems to spend a large amount of time in uploading textures and buffers. (I'm using the opengl3.3 backend. Switching to the vulkan one doesn't fix the issue.)

Jupeyy commented 2 hours ago

Then I can just suggest to not use that website as skin download URL. If you know the author of that website ask them to remove such skins. 4k skins are for 32k monitors, nothing else.

So I expect your to have a RTX 6090 and a 32k Monitor :P

The problem here is, what should DDNet do? Forbid these skins? That kinda sucks IMHO, breaks forward compatibility. Use OpenGL multi threaded? The OpenGL spec does not specify what multi threading is. Even for vulkan the queue operation is shared with the rendering commands.

For some reason ppl think that 4K skins are something desirable. I guess that is bcs of the common terminology: "This game is 4K ready". But a Tee skin only fills a very small portion of the screen, so 4k pixels inside this small rect: image

Tests on RX 6900 XT On a rx 6900 XT with vk for `twitter_emoji` backend I get ``` time: vk: 6215us time: vk: 5669us time: vk: 314us time: vk: 274us time: vk: 160us time: vk: 159us time: vk: 158us time: vk: 156us time: vk: 150us time: vk: 154us time: vk: 148us time: vk: 162us time: vk: 6603us time: vk: 5761us time: vk: 261us time: vk: 251us time: vk: 150us time: vk: 144us time: vk: 142us time: vk: 150us time: vk: 458us time: vk: 449us time: vk: 475us time: vk: 429us ``` for the whole skin
furo321 commented 29 minutes ago

I should probably add that I've also recently set my community skins download url to the not so curated https://ddstats.tw/skins/.

Hey, I have resized all skins to a maximum resolution of 512x256. Hope that helps!