Page 3 of 4
Re: Game freezes when using DirectInput
Posted: 30 Aug 2016, 12:23
by TheBigMiike
Hylis 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
Hope this translation has no mistakes
Re: Game freezes when using DirectInput
Posted: 30 Aug 2016, 13:06
by Miss
Hylis wrote:Miss 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])
surprenant
j'ai envoyé le lien à l'ingé responsable des inputs, c'est étrange ^_^ tant mieux en tout cas si ça marche mieux et bravo
Je ne parle pas Francais mais merci
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.
Re: Game freezes when using DirectInput
Posted: 31 Aug 2016, 21:25
by Miss
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
Re: Game freezes when using DirectInput
Posted: 05 Sep 2016, 19:51
by Miss
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..

)
Re: Game freezes when using DirectInput
Posted: 06 Sep 2016, 19:09
by Miss
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)
Re: Game freezes when using DirectInput
Posted: 09 Sep 2016, 12:01
by xbx
hi,
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
Posted: 09 Sep 2016, 16:55
by hackie
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.
What ?
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

<3
Re: Game freezes when using DirectInput
Posted: 09 Sep 2016, 20:26
by Miss
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

)
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.
This is what I've been thinking, because Turbo hadn't frozen once for me.
Care to elaborate on the fix? Is it the same solution as I've found, or something cleaner?

Re: Game freezes when using DirectInput
Posted: 04 May 2017, 04:11
by tbob21
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.
Re: Game freezes when using DirectInput
Posted: 04 May 2017, 08:35
by Dommy
ManiaPlanet 4 has XInput support (like TMT). Just have to be quite patient...