Resolved Cursor Flickering in menus and world map.

Users who are viewing this thread

xssg

Recruit
kuş çözüm, 00216FA5'te baytı 00'dan 01 mb_warband.exe'e (en azn buhar sürümü için) yamatırlamak. NE
 
This is due to the program doing a SetCursor with NULL making the cursor invisible using GDI, then doing a SetCursor with DirectX to set the cursor visible again. Whilst I do not the exact mechanism as to why it causes FPS issues, I'd guess that it's due to some kind of GDI/DirectX synchronization having to occur.

A workaround is to patch byte at 00216FA5 from 00 to 01 In mb_warband.exe (for steam version at least). This causes the SetCursor to fail thereby preventing the aforementioned hitching. In my system my FPS became steady and never once dipped again.

Side effects may include a cursor being visible when it shouldn't be (though I doubt it).

This may be an NVIDIA bug, it might be a Windows GDI bug, but really, ultimately, this is just a poor programming bug. There is no reason I can think of why the cursor must be hidden by GDI just to be shown again by DirectX. Perhaps editor mode? Maybe?
-----
EDIT: -- I'd like to point out that after further research the above is actually valid and usual way of handling this according to the Microsoft documentation. Why this causes flickering is unknown, and why ignoring the setCursor fixes it is also unknown.


-----

Anyway, I develop programs for my real life, and I've written an automatic patcher to make the single byte change above (for steam version only), I'll link it below (if it works, not sure if the forum will mangle it).

It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:


You can always restore the Warband files using Steam to re-validate them if you think something is wrong.
You are wonderfull!!!
 
This is due to the program doing a SetCursor with NULL making the cursor invisible using GDI, then doing a SetCursor with DirectX to set the cursor visible again. Whilst I do not the exact mechanism as to why it causes FPS issues, I'd guess that it's due to some kind of GDI/DirectX synchronization having to occur.

A workaround is to patch byte at 00216FA5 from 00 to 01 In mb_warband.exe (for steam version at least). This causes the SetCursor to fail thereby preventing the aforementioned hitching. In my system my FPS became steady and never once dipped again.

Side effects may include a cursor being visible when it shouldn't be (though I doubt it).

This may be an NVIDIA bug, it might be a Windows GDI bug, but really, ultimately, this is just a poor programming bug. There is no reason I can think of why the cursor must be hidden by GDI just to be shown again by DirectX. Perhaps editor mode? Maybe?
-----
EDIT: -- I'd like to point out that after further research the above is actually valid and usual way of handling this according to the Microsoft documentation. Why this causes flickering is unknown, and why ignoring the setCursor fixes it is also unknown.


-----

Anyway, I develop programs for my real life, and I've written an automatic patcher to make the single byte change above (for steam version only), I'll link it below (if it works, not sure if the forum will mangle it).

It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:


You can always restore the Warband files using Steam to re-validate them if you think something is wrong.
IT WORKED!
 
This is due to the program doing a SetCursor with NULL making the cursor invisible using GDI, then doing a SetCursor with DirectX to set the cursor visible again. Whilst I do not the exact mechanism as to why it causes FPS issues, I'd guess that it's due to some kind of GDI/DirectX synchronization having to occur.

A workaround is to patch byte at 00216FA5 from 00 to 01 In mb_warband.exe (for steam version at least). This causes the SetCursor to fail thereby preventing the aforementioned hitching. In my system my FPS became steady and never once dipped again.

Side effects may include a cursor being visible when it shouldn't be (though I doubt it).

This may be an NVIDIA bug, it might be a Windows GDI bug, but really, ultimately, this is just a poor programming bug. There is no reason I can think of why the cursor must be hidden by GDI just to be shown again by DirectX. Perhaps editor mode? Maybe?
-----
EDIT: -- I'd like to point out that after further research the above is actually valid and usual way of handling this according to the Microsoft documentation. Why this causes flickering is unknown, and why ignoring the setCursor fixes it is also unknown.


-----

Anyway, I develop programs for my real life, and I've written an automatic patcher to make the single byte change above (for steam version only), I'll link it below (if it works, not sure if the forum will mangle it).

It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:


You can always restore the Warband files using Steam to re-validate them if you think something is wrong.
Seriously this is amazing, I had installed different drivers and everything and then I tried this and I'm getting 120 fps almost 99 percent of the time with no lag on the map, where as before I was lagging up and down, fps was going all around the place. Thank you.
 

N0ught

Sergeant Knight at Arms
M&BWB
This is due to the program doing a SetCursor with NULL making the cursor invisible using GDI, then doing a SetCursor with DirectX to set the cursor visible again. Whilst I do not the exact mechanism as to why it causes FPS issues, I'd guess that it's due to some kind of GDI/DirectX synchronization having to occur.

A workaround is to patch byte at 00216FA5 from 00 to 01 In mb_warband.exe (for steam version at least). This causes the SetCursor to fail thereby preventing the aforementioned hitching. In my system my FPS became steady and never once dipped again.

Side effects may include a cursor being visible when it shouldn't be (though I doubt it).

This may be an NVIDIA bug, it might be a Windows GDI bug, but really, ultimately, this is just a poor programming bug. There is no reason I can think of why the cursor must be hidden by GDI just to be shown again by DirectX. Perhaps editor mode? Maybe?
-----
EDIT: -- I'd like to point out that after further research the above is actually valid and usual way of handling this according to the Microsoft documentation. Why this causes flickering is unknown, and why ignoring the setCursor fixes it is also unknown.


-----

Anyway, I develop programs for my real life, and I've written an automatic patcher to make the single byte change above (for steam version only), I'll link it below (if it works, not sure if the forum will mangle it).

It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:


You can always restore the Warband files using Steam to re-validate them if you think something is wrong.

Could you make one of these for M&B 1.011? I am having the same problem, and a fix would truly be a blessing.
 

N0ught

Sergeant Knight at Arms
M&BWB
I am not sure which of these three things solved the problem with the map and menus stuttering/freezing when you move the mouse, and the mouse pointer flickering, in windows 10, but it might work for Warband too:
* I just installed the most recent game-ready driver from Nvidia.
* I set the compatibility mode on the .exe to Windows 8.
* I set the max framerate to my exact refresh rate (144 in my case).
... No more stutters or flickering! Runs perfect, and I can alt+tab without crashing. This worked for me! :smile:
 

Spikeles

Recruit
The latest NVIDIA drivers at the time of writing, 497.29, fully resolve this issue.

Whilst not directly noted in the patch notes, it was fixed when they fixed this:

> [Supreme Command:Forged Alliance/Supreme Commander 2]: Performance drop occurs
when there is mouse movement. [3405920]
 

Banok

Knight
WBNWM&BVC
It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:

Thank you so much, I tried bunch of things including lasso but this wonderfile instantly worked. bless you sir

edit: just read the above post but hey even if it is fixed with new drivers I really appreciate you.
 
This is due to the program doing a SetCursor with NULL making the cursor invisible using GDI, then doing a SetCursor with DirectX to set the cursor visible again. Whilst I do not the exact mechanism as to why it causes FPS issues, I'd guess that it's due to some kind of GDI/DirectX synchronization having to occur.

A workaround is to patch byte at 00216FA5 from 00 to 01 In mb_warband.exe (for steam version at least). This causes the SetCursor to fail thereby preventing the aforementioned hitching. In my system my FPS became steady and never once dipped again.

Side effects may include a cursor being visible when it shouldn't be (though I doubt it).

This may be an NVIDIA bug, it might be a Windows GDI bug, but really, ultimately, this is just a poor programming bug. There is no reason I can think of why the cursor must be hidden by GDI just to be shown again by DirectX. Perhaps editor mode? Maybe?
-----
EDIT: -- I'd like to point out that after further research the above is actually valid and usual way of handling this according to the Microsoft documentation. Why this causes flickering is unknown, and why ignoring the setCursor fixes it is also unknown.


-----

Anyway, I develop programs for my real life, and I've written an automatic patcher to make the single byte change above (for steam version only), I'll link it below (if it works, not sure if the forum will mangle it).

It's an exe file because that is easiest to distribute. Reminder that you should never download .exe files the internet, but here you go:


You can always restore the Warband files using Steam to re-validate them if you think something is wrong.
Hello and thank you for such a wonderful tool you share! Could you please teach me how to apply the same modification to native m&b? I tried to change '6A0074' to '6A0174' in the native m&b file because it fits the pattern in the m&b warband file, but then the game refused to launch at all.
 

Spikeles

Recruit
The byte patch won't work on the original native Mount and Blade executable.

The proper way to solve this issue is to update your video card drivers.
 
Top Bottom