Worms Ultimate Mayhem

Worms Ultimate Mayhem

Heatray Mar 20, 2022 @ 1:18pm
Frame Rate Problem Explained
Experimentally, I found out that the problem of frame rate drop lies in the frame limiter.

The game has a programmed frame interval of 16 ms (1000 / 16 = 62.5 FPS).
Any modern hardware can render a frame faster than 16 ms (3-8 ms on mine).
If the frame rendering time is less than 16 ms, thread is stopped using the Sleep()[docs.microsoft.com] function from kernel32.dll for a certain time, for 16 ms in total, but for some reason thread does not wake up immediately, but with a delay of 15-25 ms.

The problem here may be either in windows or in hardware, or both. Thread priority seems to be set to maximum.

Ways to solve the problem:

1. Enforce V-Sync in the GPU software. Creates a delay in the frame rendering by the driver and leads to the fact that Sleep() is not called by condition. I don't recommend it, because it may not work in full-screen mode.

2. Install Special K[www.pcgamingwiki.com]. Copy SpecialK32.dll to the game folder and rename it to OpenGL32.dll. Launch game twice, press Ctrl+Shift+Backspace and enable the Sleepless Window Thread option. Replaces the Sleep() function with its own implementation.

3. My Anniversary Patch[github.com]. Just changes the frame interval to 0 (unlimited FPS), so the Sleep() function is never called.
https://steamcommunity.com/sharedfiles/filedetails/?id=2782432232
Last edited by Heatray; May 25, 2022 @ 12:44am
< >
Showing 1-11 of 11 comments
Markie Mar 20, 2022 @ 5:55pm 
Hey, I saw your answer to my post in Reddit so I deleted it to avoid spreading misinformation regarding the cause of the issue. Interesting, so the problem lies on the game engine rather than the graphics API it used then? Because FF XVIII remastered also happens to run under OpenGL and has the same exact issue, with the same fix working as well, that's why I assumed it had something to do with OpenGL. Though other OpenGL titles actually don't have that issue here so OpenGL wouldn't be the culprit but logically it can't be the OS or the hardware either as many other people have experienced the same thing with different PC configurations. Forcing V-Sync does not solve it to me by the way (windowed or fullscreen), and would kind of miss the point which is the game not using hardware properly and being unable to reach high frame rates rather than a specific target. I have tested your fix, the game runs well now and the other features are working as well, thank you for making it. I have added it to the PCGW page of the game.
Last edited by Markie; Mar 21, 2022 @ 12:24pm
Heatray Apr 1, 2022 @ 12:32pm 
No, the problem is not in the game engine, but in windows, sleep() is part of WinAPI
Worms 4 Mayhem was released in 2005 and was developed for XP. After the release, no one had any problems with FPS, but now there are. The implementation of the frame limiter does not differ from WUM.
Also there is no such problem in Wine/Proton.
Markie Apr 1, 2022 @ 12:48pm 
I see. Now that you mention it, I didn't even think of testing this game on Windows with DXVK. But it doesn't matter anymore anyway, the performance issue is already fixed with your patch.
Avi Sep 10, 2022 @ 8:44am 
Hey. i have a question regarding worms 4 mayhem not the ultimate version also struggling with 40 ish fps
hitbm47 Sep 10, 2022 @ 2:42pm 
Originally posted by Avi:
Hey. i have a question regarding worms 4 mayhem not the ultimate version also struggling with 40 ish fps
Use MSI Afterburner, then set the Frame-rate limit to 60FPS in RivaTuner Statistics Server (RTSS), you might have to restart the game a few times, but it helps to alleviate the sleeper-thread described above and will give you a consistent 60FPS if your PC is suitable enough.
Last edited by hitbm47; Sep 10, 2022 @ 2:42pm
Theronguard Apr 2, 2023 @ 6:13am 
Hey. I seem to have a problem after patching the game. It fixed my jittery mouse and fps problem but - I have two monitors and whenever I move my mouse to the right it goes off screen and I cannot rotate in game anymore. Also when trying to look up/down or left the mouse stops at the screen edges and I cant rotate further in the game. It doesnt stop when i go off to the right because I've got my second screen to the right. I don't have this issue playing vanilla worms, it happens only after patching. Any idea how to fix it? (Thanks for the patch btw.)
Mno Jul 9, 2023 @ 1:59am 
Originally posted by Heatray:
1. Enforce V-Sync in the GPU software. Creates a delay in the frame rendering by the driver and leads to the fact that Sleep() is not called by condition. I don't recommend it, because it may not work in full-screen mode.

This fixed the frame pacing for me, but the game still only runs at like 30 - 40 FPS...
Fanatiker18 Jul 24, 2024 @ 6:31am 
My Game was fixed from low Framerate 38 FPS to 60 FPS :-D

FIX = NVIDIA Control Panel / 3D Program Settings - V-Sync to FAST

Thanks for the helpfully Idea ^.^
GabyAlex999 Aug 4, 2024 @ 2:50pm 
Try with RivaTuner Statistics Server, it will works 100% for both WUM & W4M whet you set value of 60 to Frametime Limit and Scanline Sync. I found this solution because recently I go with AMD and they drivers doesn't have Fast V-Sync option like NVIDIA who can unlock the FPS WUM & W4M.
Mno Aug 4, 2024 @ 9:14pm 
Originally posted by GabyAlex999:
Try with RivaTuner Statistics Server, it will works 100% for both WUM & W4M whet you set value of 60 to Frametime Limit and Scanline Sync. I found this solution because recently I go with AMD and they drivers doesn't have Fast V-Sync option like NVIDIA who can unlock the FPS WUM & W4M.

Capping the framerate isn't a solution, especially when not everybody has the same refresh rate.
hitbm47 Aug 7, 2024 @ 7:41am 
Originally posted by GabyAlex999:
Try with RivaTuner Statistics Server, it will works 100% for both WUM & W4M whet you set value of 60 to Frametime Limit and Scanline Sync. I found this solution because recently I go with AMD and they drivers doesn't have Fast V-Sync option like NVIDIA who can unlock the FPS WUM & W4M.
AMD does have Enhanced Sync as a counter part for Fast Sync, which launched in 2017 with the drawback that it only works for DirectX9-11 and Vulkan games.

On the other hand, the VSync On/VSync Off settings in AMD Drivers do work specifically for OpenGL rendered applications (which Worms Ultimate Mayhem uses). Limiting to 60FPS in RivaTuner is the best option for this game without the need to actually disable VSync.

One solution might actually be to turn on Triple Buffering and VSync On in the Radeon settings with the 60FPS RivaTuner limit.
< >
Showing 1-11 of 11 comments
Per page: 1530 50