dkfans / keeperfx

Open source remake and Fan Expansion of Dungeon Keeper.
https://keeperfx.net/
GNU General Public License v2.0
755 stars 78 forks source link

Mouse movement is slow when playing (but not in main menu) #1754

Closed AleWin32 closed 2 years ago

AleWin32 commented 2 years ago

I am a big fan of Dungeon Keeper and KeeperFX, some years ago i contributed posting many bugs i found and supply logs when the original programmer (Mefistotelis) was working on the project. I also contributed new ideas and suggestions.

Today i tried again KeeperFX after some years and i got a little bit sad: mouse cursor does not move very well, some lag/delay can be perfectly felt. If you play Age of Empires 2 (Definitive Edition) for example, the mouse moves perfectly when playing it, it does not have any kind of delay, this problem makes the user experience be very bad, it's a pity for this great game.

KeeperFX is not a very complex videogame in graphics, as it uses prerendered textures (por creatures and many things), it's from 1995 and it does not have a real 3D engine (like Dungeon Keeper 2 does). So this can be technically perfectly achieved.

If you only play KeeperFX, maybe the mouse movement is good for you as you don't have anything to compare with, but if you play any commercial strategy game you will notice the difference.

The thing is that moving the mouse on the main menu is good, but when playing it goes slower.

Does anybody knows where the problem is? Maybe it's a SDL related problem? Game engine is not well optimized? Some recurrent functions are very slow? Maybe the problem can be traced/analyzed with a profiler to see the most used code parts?

As i said before, i don't understand why this happen in this game, as it's not very CPU intensive and it's a pretty old game.

I have Win10 64 bits, 16gb RAM, an SSD NVMe disk... I don't think the problem is on my hardware

Loobinex commented 2 years ago

@AleWin32 If you open the launcher, open settings, and set mouse sensitivity to 0, then play the game, does that solve it for you? If not, try the latest alpha: https://github.com/dkfans/keeperfx/wiki/Download-and-Play-an-Alpha-version

Tell me of that helps you out.

AleWin32 commented 2 years ago

I am not very sure about the difference between 0 and 100 in "mouse sensitivity", i tried both but looks they are like the same, then i tried the latest alpha (2921) as you said, and now it runs very smoothly, mouse movements are very good now! Thanks, so this can be closed/solved.

Just out of curiosity: what was the previous FPS before this code change and what is the FPS now? It's very noticeable, good work

Loobinex commented 2 years ago

20 fps, now without limit.

rainlizard commented 2 years ago

@AleWin32 I was worried you were actually already on the alpha and criticizing it! haha The very recent FPS improvements are a result of my code here: #1746 I have yet to add an FPS counter, but if you want to you can open the console (press Enter during gameplay) and then type: !ft This will show frametime in the corner in milliseconds and if you calculate 1000 / frametime you'll have your FPS. (so a frametime of 8 is: 1000 / 8 = 125 FPS)

AleWin32 commented 2 years ago

Hi @rainlizard, no, when i wrote this post i was not on the alpha version (i tried it when @Loobinex told me it here), that's why i feel the gameplay so slow. You have made a very good job ;)