Game freezes when using DirectInput

Moderators: w1lla, NADEO

TheBigMiike
Posts: 1256
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: Game freezes when using DirectInput

Post by TheBigMiike »

Hylis wrote: Surprising :shock:

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
Image Image
User avatar
Miss
Posts: 2151
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Game freezes when using DirectInput

Post 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 :shock:

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 :) :thx:

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. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
Miss
Posts: 2151
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Game freezes when using DirectInput

Post 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
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
Miss
Posts: 2151
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Game freezes when using DirectInput

Post 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.. :( )
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
Miss
Posts: 2151
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Game freezes when using DirectInput

Post 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. :P (You can also look at the source code if you want)
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. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
xbx
Nadeo
Nadeo
Posts: 1289
Joined: 14 Jun 2010, 17:35

Re: Game freezes when using DirectInput

Post 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.
hackie
Posts: 1168
Joined: 19 Jul 2012, 22:43

Re: Game freezes when using DirectInput

Post 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 ? :o

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 :thumbsup: <3
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
User avatar
Miss
Posts: 2151
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Game freezes when using DirectInput

Post 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 :D)
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? :)
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
tbob21
Posts: 3
Joined: 09 Aug 2015, 07:35

Re: Game freezes when using DirectInput

Post 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.
User avatar
Dommy
Translator
Translator
Posts: 1866
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: Game freezes when using DirectInput

Post by Dommy »

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
Post Reply

Return to “Maniaplanet Reports”

Who is online

Users browsing this forum: No registered users and 1 guest