x360ce team reachin out to the frozenbyte team :)

For discussion about Trine 3: The Artifacts of Power, released in 2015 for Windows, Mac and Linux. Is also available for PlayStation 4.
Squall Leonhart
Posts: 5
Joined: Fri Apr 24, 2015 11:14 pm

x360ce team reachin out to the frozenbyte team :)

Postby Squall Leonhart » Fri Apr 24, 2015 11:24 pm

G'day guys, I'm Danial from the x360ce project,

We seem to have run into a bit of a snag with some recent changes to our code not playing nice with your games, we're not sure exactly whats going wrong, but well... it seems to cause this in Trine Enhanced, Trine 2 and Trine 3 (Trifecta heh).

Code: Select all

BUGCHECK_STR: APPLICATION_FAULT_MEMORY_CORRUPTION_INVALID_POINTER_READ_NULL_CLASS_PTR_READ_LARGE_AFTER_CALL

PRIMARY_PROBLEM_CLASS: MEMORY_CORRUPTION_LARGE_AFTER_CALL

DEFAULT_BUCKET_ID: MEMORY_CORRUPTION_LARGE_AFTER_CALL

STACK_TEXT:
00000000 00000000 memory_corruption!trine2_32bit+0x0


SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: memory_corruption!trine2_32bit

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: memory_corruption

DEBUG_FLR_IMAGE_TIMESTAMP: 0

STACK_COMMAND: ** Pseudo Context ** ; kb

FAILURE_BUCKET_ID: MEMORY_CORRUPTION_LARGE_AFTER_CALL_c0000005_memory_corruption!trine2_32bit

BUCKET_ID: APPLICATION_FAULT_MEMORY_CORRUPTION_INVALID_POINTER_READ_NULL_CLASS_PTR_READ_LARGE_AFTER_CALL_memory_corruption!trine2_32bit

IMAGE_NAME: memory_corruption

ANALYSIS_SOURCE: UM

FAILURE_ID_HASH_STRING: um:memory_corruption_large_after_call_c0000005_memory_corruption!trine2_32bit

FAILURE_ID_HASH: {e6a3205e-c2a4-791b-91f3-4a2d0ce65172}

Followup: MachineOwner


Now this has been happening for a while, i first noticed it myself near the end of December,

The changeset i've narrowed it down to is r1044, and we've made some heavy changes since, but are no where closer to resolving the issue.

In this 7z file, you will find a debug binary, pdb and a number of crash dumps, (MediaFire)

our latest source is on github now, at https://github.com/x360ce/x360ce if you want to build it yourselves, but yeah, we're just stumped on this issue at the present.

fb_jlarja
Posts: 219
Joined: Fri Nov 11, 2011 4:45 pm

Re: x360ce team reachin out to the frozenbyte team :)

Postby fb_jlarja » Mon May 04, 2015 9:51 am

Hi, and nice to meet you :)

It seems that we have a bug in our code causing a crash if an XInput device is detected but not properly initialized. However, fixing that only allows game to run (badly, it keeps trying to re-initialize input every few seconds, which is pretty bad considering DirectInput enumeration time is hundreds of milliseconds), but doesn't actually fix the controllers.

As we are still using Visual Studio 2012 and the .dll you included requires debugging runtime from 2013, I had to compile my own version. Code downloaded from GitHub didn't readily compile, but after some tweaking and fixing, i got myself a .dll :) . So here goes.

We have this piece of code to detect whether XInput device is present or not:

Code: Select all

   XINPUT_STATE state;
   ZeroMemory(&state, sizeof(XINPUT_STATE));
   DWORD result = XInputGetState(this->id, &state);


Which fails with ERROR_BAD_ARGUMENTS. this->id is 0, and gamepad in question is actually a normal Xbox 360 wired gamepad. Removing it doesn't help. Instead of expected ERROR_DEVICE_NOT_CONNECTED it still returns ERROR_BAD_ARGUMENTS. Devices 1 and 2 (a drawing tablet driver and PS4 controller) seem to work correctly here, but later XInputGetCapabilities call fails for every controller.

Ah, seems you have

Code: Select all

   if (!pCapabilities || dwFlags != XINPUT_FLAG_GAMEPAD)
   {
      return ERROR_BAD_ARGUMENTS;
   }


in your code base. We support any type of XInput device, so we don't pass XINPUT_FLAG_GAMEPAD to XInputGetCapabilities. Still, I can't see obvious reason why XInputGetState fails for real XInput gamepad, but could be something wrong with your pass-through code.

Hope this helps. Let me know, if you need more information. We'll probably put a patch out so game won't crash anymore, but for Trine EE and Trine 2 it may take a while.

-JLarja

Squall Leonhart
Posts: 5
Joined: Fri Apr 24, 2015 11:14 pm

Re: x360ce team reachin out to the frozenbyte team :)

Postby Squall Leonhart » Mon May 04, 2015 10:46 am

Ahah!

:) We had this game working nicely prior to 1044, so I do believe that it is partly a bug on our side too, but we only came across it in testing the Trine games.

Trine has been a nice game to test against because on a number of occasions it has demonstrated misbehavior on our part that other games seem to forgive :D

This information should help our main developers identify a fix on our side so we do not cause this issues in other, as yet unidentified games.

And with a little bit of googling, i have seemingly resolved the crash on my end by changing the block you identified to

Code: Select all

  // Validate
   if (!pCapabilities || dwFlags != 0 && dwFlags != XINPUT_FLAG_GAMEPAD)
   {
     return ERROR_BAD_ARGUMENTS;
   }


[18:34] <mudlord> seems someone wasnt checking if the flags are null
[18:40] <mudlord> it checks if dwflags is actually not zero
[18:40] <mudlord> because just dwFlags != XINPUT_FLAG_GAMEPAD means it can be zero and it goes through



It seems that vibration is being spammed near constantly with almost no magnitude while the Trine games are running,

1)21:56:47.115 00021936 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 13107 LMag 0 RMag 2000 LPeriod 40000 RPeriod
2)21:56:47.116 00021936 Type 0 Axes 2 OMag 10000 LSpeed 13107 RSpeed 0 LMag 2000 RMag 0 LPeriod 40000 RPeriod
3)21:56:47.710 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod
4)21:56:47.718 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod

1 and 2 are from when the controller actually vibrates, such as from being hit by an enemy.

3 and 4 are constantly filling up the log when there is no vibration being felt from the controller at all.

fb_jlarja
Posts: 219
Joined: Fri Nov 11, 2011 4:45 pm

Re: x360ce team reachin out to the frozenbyte team :)

Postby fb_jlarja » Tue May 05, 2015 10:22 am

Squall Leonhart wrote:Ahah!

It seems that vibration is being spammed near constantly with almost no magnitude while the Trine games are running,

1)21:56:47.115 00021936 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 13107 LMag 0 RMag 2000 LPeriod 40000 RPeriod
2)21:56:47.116 00021936 Type 0 Axes 2 OMag 10000 LSpeed 13107 RSpeed 0 LMag 2000 RMag 0 LPeriod 40000 RPeriod
3)21:56:47.710 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod
4)21:56:47.718 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod

1 and 2 are from when the controller actually vibrates, such as from being hit by an enemy.

3 and 4 are constantly filling up the log when there is no vibration being felt from the controller at all.


If it is spammed constantly, then it is likely that controllers are enumerated constantly. That happens, for example, when XInput device declares it's no longer present. I think it also happens when game window loses focus, if there are DirectInput devices connected (they are released on focus loss).

Zero speed values are spammed so excessively due to consoles' TRC requirements. They have very strict limits on how long and how often vibration can be used, so we decided to err on the safe side and spam "stopVibrations" whenever there's a reason, even if we can be 99 % sure there's no vibrations running.

-JLarja

Squall Leonhart
Posts: 5
Joined: Fri Apr 24, 2015 11:14 pm

Re: x360ce team reachin out to the frozenbyte team :)

Postby Squall Leonhart » Wed May 06, 2015 2:54 am

fb_jlarja wrote:
Squall Leonhart wrote:Ahah!

It seems that vibration is being spammed near constantly with almost no magnitude while the Trine games are running,

1)21:56:47.115 00021936 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 13107 LMag 0 RMag 2000 LPeriod 40000 RPeriod
2)21:56:47.116 00021936 Type 0 Axes 2 OMag 10000 LSpeed 13107 RSpeed 0 LMag 2000 RMag 0 LPeriod 40000 RPeriod
3)21:56:47.710 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod
4)21:56:47.718 00039276 Type 0 Axes 2 OMag 10000 LSpeed 0 RSpeed 0 LMag 0 RMag 0 LPeriod 40000 RPeriod

1 and 2 are from when the controller actually vibrates, such as from being hit by an enemy.

3 and 4 are constantly filling up the log when there is no vibration being felt from the controller at all.


If it is spammed constantly, then it is likely that controllers are enumerated constantly. That happens, for example, when XInput device declares it's no longer present. I think it also happens when game window loses focus, if there are DirectInput devices connected (they are released on focus loss).

Zero speed values are spammed so excessively due to consoles' TRC requirements. They have very strict limits on how long and how often vibration can be used, so we decided to err on the safe side and spam "stopVibrations" whenever there's a reason, even if we can be 99 % sure there's no vibrations running.

-JLarja


Aha!, that explains it then :)

Thanks for the help.

User avatar
NeatNit
Posts: 34
Joined: Thu Oct 06, 2011 11:18 pm
Contact:

Re: x360ce team reachin out to the frozenbyte team :)

Postby NeatNit » Fri May 08, 2015 12:17 am

This is a bit off-topic, I'm sorry, but I have a question for you Squall.

Where is the official or best place to download x360ce from? I recently-ish got myself a DirectInput controller and started using x360ce, I'm complete baffled. Google used to point to a Google Code page which seemed to be very outdated and contradicted itself in several places.

Searching for specific things (best example: getting it to work with GTA V) found me some forum posts, and it seemed a lot of people have their own branches / versions that they use and helpfully share... But I just don't know which one is "right" anymore.

The version I have is the first one I downloaded, from the Google Code page, and I think it's from 2012-ish. Not great!


Today, thanks to this post, I went and made a new Google search, and I see that the top results are now GitHub (which you also linked to) and http://www.x360ce.com/ which itself also points to GitHub. So that's good! Finally it's in one correct and up-to-date place. But are there any features that are lost in this version, maybe that other users have patched into their own versions and which never existed in the main branch? etc etc...

Also, is it any easier / more intuitive to install?

By the way... What is TocaEdit? :P


Thanks. Awesome job by the way, this software transforms paperweights into working game controllers. :)

Squall Leonhart
Posts: 5
Joined: Fri Apr 24, 2015 11:14 pm

Re: x360ce team reachin out to the frozenbyte team :)

Postby Squall Leonhart » Wed Sep 02, 2015 6:17 pm

NeatNit wrote:This is a bit off-topic, I'm sorry, but I have a question for you Squall.

Where is the official or best place to download x360ce from? I recently-ish got myself a DirectInput controller and started using x360ce, I'm complete baffled. Google used to point to a Google Code page which seemed to be very outdated and contradicted itself in several places.

Searching for specific things (best example: getting it to work with GTA V) found me some forum posts, and it seemed a lot of people have their own branches / versions that they use and helpfully share... But I just don't know which one is "right" anymore.

The version I have is the first one I downloaded, from the Google Code page, and I think it's from 2012-ish. Not great!


Today, thanks to this post, I went and made a new Google search, and I see that the top results are now GitHub (which you also linked to) and http://www.x360ce.com/ which itself also points to GitHub. So that's good! Finally it's in one correct and up-to-date place. But are there any features that are lost in this version, maybe that other users have patched into their own versions and which never existed in the main branch? etc etc...

Also, is it any easier / more intuitive to install?

By the way... What is TocaEdit? :P


Thanks. Awesome job by the way, this software transforms paperweights into working game controllers. :)


Ah, sorry i hadn't come check this thread (no email notifications D:)

the x360ce.com website you found, is our new homepage, and we release version updates through it.

We try to keep the same features, or replace them with an increased control over those features, recently with the help of a fresh developer we have introduced controller combining, so now you can use a joystick/wheel/gamepad all at the sme time with games like GTA.

Directional constant force has been added for controller drivers that can use it, so far i can only guarantee Xbox/Xbox 360 pads using XBCD can (as i added it myself, with a bit of help from another dev working on x360ce vibration)

ToCA Edit referrs to modding the ToCA racing games i assume.


Return to “Trine 3”

Who is online

Users browsing this forum: No registered users and 2 guests