narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
972 stars 70 forks source link

Mouse lag / erratic movement with Desperados makes this unusable #8

Closed Voxette closed 4 years ago

Voxette commented 7 years ago

I tried using this instead of dgVoodoo2 in order to get faster performance.

Performance is indeed faster in general, but I'm having a strange issue with mouse lag. Essentially, as more characters move around on-screen, the cursor becomes unresponsive: it moves slowly and erratically. Needless to say, this makes the game unplayable: it's impossible to move the mouse with accuracy because you can never predict where it's going to go.

Also, I ran into an issue where the game launched in a horribly distorted green and purple tinted corner of the screen. However, checking the box to "run as administrator" fixed this issue. This seems to be the error in question: "10508 16:21:30.584 Failed to find the requested display mode: 1024x768x16". See the attached log.

log.txt

I will follow up with any support you need to address the main issue with mouse lag.

narzoul commented 7 years ago

Some basic system info would be good to have, especially OS and GPU. Judging from the info you've given I suspect you're either on Windows 8 or 10 (based on the display mode errors). You're also most likely not using an AMD video card, as the game is crashing with that at the end of the map load screen. I'm surprised that I haven't found any mention of that anywhere even after some googling... but I digress.

I don't know why you're getting those display mode errors, or how can running the game as admin even help with that. It's true that I didn't implement enumeration of 8 and 16 bit display modes because the builtin Windows compatibility shims should already handle that. But for some reason in your case it's not getting triggered unless you run the game as admin. As an alternative to that, you could try setting 16 bit color mode on the Compatibility tab of game.exe. But I'll probably just implement proper enumeration anyway in the next version (if I don't forget).

If you happen to have an NVIDIA + Windows 10 combo, do you have the Windows 10 Anniversary Update installed? In my experience it helps a great deal with the speed of locking off-screen plain video memory surfaces (the kind that Desperados tends to use), so that might help somewhat with the speed issues. For Intel HD I've already implemented a small driver "hack" to help with the same, but that version has not yet been released.

In any case, the performance problem will more than likely go away as soon as I fix issue #5, as that fix will move (almost) all 2D surface handling to system memory, bypassing most issues with drivers and slow video memory access. I think it would be best to wait for the next release that includes that fix and see if the performance is acceptable for you afterwards.

If you have a save game that can reproduce the slowdown, then (assuming I have a test system similar to yours) I can also quickly check in advance if the proposed fix would indeed help.

Voxette commented 7 years ago

Thanks for your quick response!

Sorry for not including that basic information. It just slipped my mind.

I am indeed running Windows 10, with an NVIDIA GTX 1070 card. I have the Anniversary Update. Let me know if you want any more information.

Here is a save for you. (Just remove the file extension: it wouldn't let me attach it without an extension, which is how the game reads them.) The strange thing is that performance is otherwise fine: the screen scrolls around very smoothly (though with some weird "momentum" to it, i.e. it keeps drifting after you let go of the key), and the characters move around smoothly. It looks better than dgVoodoo2 (which has acceptable though not great performance); it's just the odd mouse lag issue that kills it.

mzso commented 7 years ago

@Voxette commented on 2016. dec. 19. 22:29 CET:

I tried using this instead of dgVoodoo2 in order to get faster performance.

Performance is indeed faster in general, but I'm having a strange issue with mouse lag. Essentially, as more characters move around on-screen, the cursor becomes unresponsive: it moves slowly and erratically. Needless to say, this makes the game unplayable: it's impossible to move the mouse with accuracy because you can never predict where it's going to go.

Also, I ran into an issue where the game launched in a horribly distorted green and purple tinted corner of the screen. However, checking the box to "run as administrator" fixed this issue. This seems to be the error in question: "10508 16:21:30.584 Failed to find the requested display mode: 1024x768x16". See the attached log.

log.txt

I will follow up with any support you need to address the main issue with mouse lag.

First: Which Desperados game?

I tried the original (Desperados: Wanted Dead or Alive) and it ran at full speed in every context. It just hangs a bit at quick saving. And I have much older PC.

Also your experiences sound like the windows default experience. Are you certain you you put ddraw.dll next to "game.exe" (in the "game" folder) and NOT next to "Desperados.exe"

I had that purple thing happening too, but with multiple ddraw replacements, and even after removing them. I don't know the cause, anly reinstalling fixed it. (I don't need to run it as admin)

mzso commented 7 years ago

@Voxette BTW have you tried other stuff? Such as WineD3D, dgVoodoo 2, DxWnd

Voxette commented 7 years ago

@mzso

I'm running the original Desperados, of course.

And yes, I am certain that I put ddraw.dll next to game.exe.

I have tried dgVoodoo2. At first it ran somewhat slowly (though much more playable than this), but after increasing its maximum VRAM usage to 1 GB, it works fine now. So, really, I have no more need for this tool, but I'll continue to provide feedback so it can be fixed.

The issue with the purple graphics only happened with this (not dgVoodoo2), and it was not fixed upon reinstall (which I tried). Only running it as admin fixes it. Well, that and some other compatibility options I tried first like compatibility mode for Windows XP, 98, etc.

Voxette commented 7 years ago

(Sorry, I accidentally hit the close button.)

narzoul commented 7 years ago

I haven't been able to reproduce this issue with either AMD or Intel GPUs so far. I don't have an NVIDIA card for testing currently (well, I do, but I'd have to physically replace my AMD and I wouldn't want to go through that hassle just yet).

You mentioned that the overall performance is good and only the mouse is slower than expected? That makes me think maybe it's not a graphics issue but an input processing issue. Please try the fix mentioned in this Steam discussion: https://steamcommunity.com/app/260730/discussions/0/648812304898105175/ Or try experimenting with other mouse settings (like DPI, if your mouse has such options).

Also, if you're able to compile DDrawCompat yourself, I can show you how to modify the code to push surfaces to system memory so that you can test the proposed fix early on your system (same goes for @mzso).

mzso commented 7 years ago

@Voxette Ah, okay. (Thanks for the tip BTW, I didn't think you could set it higher than 256.) It looks like win 10 has it's extra issues.

@narzoul I don't have an interest in compiling (also, had my fill of Desperados), but I'll test it when you release it.

Voxette commented 7 years ago

@narzoul I tried turning off "enhance pointer precision", i.e. mouse acceleration, but it didn't fix the issue. Adjusting DPI with the buttons my mouse has for that didn't do anything, either.

For whatever reason, the mouse just gets slower and more unresponsive the more the characters are moving around onscreen (or something associated with that).

I don't have any experience or knowledge of compiling.

narzoul commented 7 years ago

@Voxette, @mzso: I decided to provide an experimental release (on the releases page) for testing the proposed fix. Please, take a look at it and let me know if it fixes the performance issues you've experienced.

mzso commented 7 years ago

It doesn't start for me with this build:

desp-crash

narzoul commented 7 years ago

@mzso: Thanks for the feedback. That function referenced in the error message is only available on Windows 10, it had slipped my mind that this could cause problems on earlier OSes. I uploaded a fix and updated the experimental release with it as well, so it should no longer give that error message.

However, there's currently another serious issue on Windows 7 where most games continuously keep losing focus (minimizing) as soon as they're started. Some of them also continuously keep switching back to the game while others remain minimized. I'll need more time to debug this. I can't remember if it only affects Intel HD or my AMD setup also, and I didn't have a chance to retest on AMD yet. I also have no access to NVIDIA on Windows 7, so I can't tell if it will be affected. Give it a try if you feel like experimenting... otherwise it may be better to wait for the next patch.

@Voxette: Neither of these problems affect Windows 10 (at least based on my testing) so it should be OK to test the release there.

mzso commented 7 years ago

Hi! Not it seems fine. No hangs when saving. Also a level (with rain and lightning) which I remember to be jerky sometimes, seems smooth now.

I'm on win8 and I didn't experience the losing focus thing. Though, there's a tiny issue that I don't think was there. When the game cuts to a cutscene (bik video) and when it cuts back I see the desktop flash for a second.