Hope this translation has no mistakesHylis wrote: Surprising![]()
I sent the link of this topic to the engineer working on inputs. That's curious ^_^ but if your solution works, that's cool. Bravo
Game freezes when using DirectInput
-
- Posts: 1256
- Joined: 06 Mar 2013, 16:12
- Manialink: explore
- Location: Vendée | France
- Contact:
Re: Game freezes when using DirectInput
Re: Game freezes when using DirectInput
Je ne parle pas Francais mais merciHylis wrote:surprenantMiss wrote:So I am attempting a fix that (according to the OP of some of the posts I've linked to in this thread) might help. (eg. I nopped out the Unacquire call to dinput device [because it's unnecessary?])
It seems to run okay, I need to play a bit more to know for sure if this is the fix, but let's find out.
(If anyone has the same problem and would like to try this patch, in Maniaplanet.exe find the following bytes: 748B0151FF50208BF085F67927682D04000068A887460156 and replace it with: EB8B0151FF50208BF085F67927682D04000068A887460156 [first byte changed])![]()
j'ai envoyé le lien à l'ingé responsable des inputs, c'est étrange ^_^ tant mieux en tout cas si ça marche mieux et bravo


I have a suspicion you can also get rid of Acquire, because otherwise maybe calling acquire over and over again could leak memory? Not sure.. I should try that too (or at least patch it so it only calls Acquire once in the lifetime of the process). I think that should also fix the issue on Linux when you run the game under Wine, it would have short stuttering freezes at the same places the game could have this dinput freeze.
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out
openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.

Check out

I also stream and tweet.
Re: Game freezes when using DirectInput
Seems like I messed up my copypaste in my previous post.. so, search for:
56 57 8B F9 8B 4F 44 85 C9 74 33 8B 01 51 FF 50
Replace with:
56 57 8B F9 8B 4F 44 85 C9 EB 33 8B 01 51 FF 50
56 57 8B F9 8B 4F 44 85 C9 74 33 8B 01 51 FF 50
Replace with:
56 57 8B F9 8B 4F 44 85 C9 EB 33 8B 01 51 FF 50
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out
openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.

Check out

I also stream and tweet.
Re: Game freezes when using DirectInput
Found the exact reason this happens on MSDN I think:
"Device acquisition does not use a reference count. Therefore, if an application calls the IDirectInputDevice8 Interface method twice, then calls the IDirectInputDevice8 Interface method once, the device is unacquired."
So basically, Acquire should be called before polling, and immediately after that dinput has already unacquired it, so calling it again is not necessary. Seems like my fix works well, except in some scripted modes in Shootmania, where typing chat becomes impossible. (Why must the game use Dinput for mouse and keyboard? Microsoft deprecated that a long time ago in favor of Window Messages..
)
"Device acquisition does not use a reference count. Therefore, if an application calls the IDirectInputDevice8 Interface method twice, then calls the IDirectInputDevice8 Interface method once, the device is unacquired."
So basically, Acquire should be called before polling, and immediately after that dinput has already unacquired it, so calling it again is not necessary. Seems like my fix works well, except in some scripted modes in Shootmania, where typing chat becomes impossible. (Why must the game use Dinput for mouse and keyboard? Microsoft deprecated that a long time ago in favor of Window Messages..

3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out
openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.

Check out

I also stream and tweet.
Re: Game freezes when using DirectInput
Sorry for quad posting.. but here's a little easier fix 
I changed it so it calls Unacquire only for Keyboard and Mouse, this fixes earlier issues with not being able to chat in Shootmania gamemodes.
Download: https://github.com/codecat/maniafix/rel ... _1.0.0.zip
Extract it to your Maniaplanet folder (where the Maniaplanet.exe is), then instead of starting Maniaplanet.exe to start the game, run ManiafixLauncher.exe.
Hope this is okay to post here. Nadeo seemed to approve of the earlier fix post, so why not.
(You can also look at the source code if you want)

I changed it so it calls Unacquire only for Keyboard and Mouse, this fixes earlier issues with not being able to chat in Shootmania gamemodes.
Download: https://github.com/codecat/maniafix/rel ... _1.0.0.zip
Extract it to your Maniaplanet folder (where the Maniaplanet.exe is), then instead of starting Maniaplanet.exe to start the game, run ManiafixLauncher.exe.
Hope this is okay to post here. Nadeo seemed to approve of the earlier fix post, so why not.

Last edited by Miss on 23 Mar 2017, 13:06, edited 1 time in total.
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out
openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.

Check out

I also stream and tweet.
Re: Game freezes when using DirectInput
hi,
thanks for investigating this!
fwiw, the fix is actually already in trackamania turbo, so it will be included in the next maniaplanet update.
thanks for investigating this!
fwiw, the fix is actually already in trackamania turbo, so it will be included in the next maniaplanet update.
Re: Game freezes when using DirectInput
What ?xbx wrote:hi,
thanks for investigating this!
fwiw, the fix is actually already in trackamania turbo, so it will be included in the next maniaplanet update.

Then why did you not fixed it for maniaplanet trough a small update ?
Now its fixed by community and spend maybe a lot of time in it , and now you say we had already a fix laying around somewhere ?
No words.
Nice job Miss

System Specs:
OS: Windows 7 Professionnal x64
CPU: Intel Core i7-6700K / 4 GHz - 8 MB cache
GPU: MSI GTX 980TI GAMING 6G - OC Edition
Motherboard: ASUS MAXIMUS VIII RANGER
RAM : 32Gb Kingston HyperX Savage - DDR4
DirectX 11
OS: Windows 7 Professionnal x64
CPU: Intel Core i7-6700K / 4 GHz - 8 MB cache
GPU: MSI GTX 980TI GAMING 6G - OC Edition
Motherboard: ASUS MAXIMUS VIII RANGER
RAM : 32Gb Kingston HyperX Savage - DDR4
DirectX 11
Re: Game freezes when using DirectInput
Hackie, it's not common practice to update the main game if you're working on a giant update, especially if (for most people) this either doesn't happen, or only happens once or twice a day. (Except for me, where it'd happen once every 15 minutes
)
Care to elaborate on the fix? Is it the same solution as I've found, or something cleaner?

This is what I've been thinking, because Turbo hadn't frozen once for me.xbx wrote:hi,
thanks for investigating this!
fwiw, the fix is actually already in trackamania turbo, so it will be included in the next maniaplanet update.
Care to elaborate on the fix? Is it the same solution as I've found, or something cleaner?

3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out
openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.

Check out

I also stream and tweet.
Re: Game freezes when using DirectInput
Any official update to fix this? I've been having this issue for a while, maybe freezing once or twice every few hours.. Recently it's been freezing way more.
- Dommy
- Translator
- Posts: 1866
- Joined: 25 Aug 2011, 21:45
- Manialink: exchange
- Location: Poland
- Contact:
Re: Game freezes when using DirectInput
ManiaPlanet 4 has XInput support (like TMT). Just have to be quite patient...
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT
Contact me via GALAXY & PURSUIT DISCORD
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT
Contact me via GALAXY & PURSUIT DISCORD
Who is online
Users browsing this forum: No registered users and 2 guests