Author Topic: Joysticks "Auto-Center" does only work for the first mission per session  (Read 634 times)

0 Members and 1 Guest are viewing this topic.

Joysticks "Auto-Center" does only work for the first mission per session
Hello everybody,

time for a new topic, because i did not found a similar one here.
Actually, i have some problems with my Sidewinder Force Feedback 2 Joystick.

The "Auto-Center" function seems to create some problems for a longer time now. In some builds it works without a problem, in others it were never functional or it looses the function right during a mission (that was very annoying) without any reason.
Recent nightlies create new problems with it on my system as it seems.

If i start the game, everything is alright, the Joystick centers automatically even in the menus and i can play the mission without a problem... and can finish it.
But then the problem appears, in the Debriefing it loses this function and it will never come back until i restart the game.
Actually this appears also, if i press escape or open any menu during the first mission i am playing, including alt-tabbing out of the game.

It seems, that the game transmit the "auto-center"-command only at the start of the game.

I hope somebody can help me and fix this problem :).

I used nightlies from 21st, 26th and the newest 30th march build. I am using the Win32 build, because win64 seems to run only with disabled movie playback on my system.
Shivan here, Shivan there, Shivan everywhere.

My english isn't very well, so sorry for a few mistakes.

FreeSpace Let's Plays on my Channel:
| The Great War | Silent Threat | Operation Templar | Silent Threat: Reborn | Shivans - Phantoms | Shivans - Echo Gate | Shrouding the Light: Origins | Shrouding the Light | Cardinal Spear | Cardinal Spear: Vega | Awakenings | The Destiny of Peace | Between the Ashes: Mefistofele

 

Offline m!m

  • 210
Re: Joysticks "Auto-Center" does only work for the first mission per session
What is the "Auto-Center" feature? I have never heard about that.

 
Re: Joysticks "Auto-Center" does only work for the first mission per session
It centers the joystick automatically.

If you want to turn your ship, you have so also to overcome some resistance.

Some joysticks are using springs for that, but afaik it is more likely for Force Feedback joysticks to use its engine for that. Without it, i can left the Joystick in a position for eternity. If i do not touch my control, my ship could fly circles forever.
« Last Edit: March 30, 2017, 09:35:29 am by Deepstar »
Shivan here, Shivan there, Shivan everywhere.

My english isn't very well, so sorry for a few mistakes.

FreeSpace Let's Plays on my Channel:
| The Great War | Silent Threat | Operation Templar | Silent Threat: Reborn | Shivans - Phantoms | Shivans - Echo Gate | Shrouding the Light: Origins | Shrouding the Light | Cardinal Spear | Cardinal Spear: Vega | Awakenings | The Destiny of Peace | Between the Ashes: Mefistofele

 

Offline m!m

  • 210
Re: Joysticks "Auto-Center" does only work for the first mission per session
Are you referring to force-feedback effects?

 
Re: Joysticks "Auto-Center" does only work for the first mission per session
Yes, of course i do :).

But all others force feedback effects working fine, but not this one.
Shivan here, Shivan there, Shivan everywhere.

My english isn't very well, so sorry for a few mistakes.

FreeSpace Let's Plays on my Channel:
| The Great War | Silent Threat | Operation Templar | Silent Threat: Reborn | Shivans - Phantoms | Shivans - Echo Gate | Shrouding the Light: Origins | Shrouding the Light | Cardinal Spear | Cardinal Spear: Vega | Awakenings | The Destiny of Peace | Between the Ashes: Mefistofele

 

Offline m!m

  • 210
Re: Joysticks "Auto-Center" does only work for the first mission per session
Ah, ok. Our force feedback code is in pretty rough shape since pretty much no coder has a force feedback device but maybe a debug log may help. Please post your fs2_open.log file.  Instructions on how to do this can be found in this post.

 

Offline AdmiralRalwood

  • 211
  • Mister Subspace Strikes
    • Skype
    • Steam
    • Twitter
Re: Joysticks "Auto-Center" does only work for the first mission per session
Ah, ok. Our force feedback code is in pretty rough shape since pretty much no coder has a force feedback device but maybe a debug log may help. Please post your fs2_open.log file.  Instructions on how to do this can be found in this post.
I do, and I'm pretty sure chief1983 does as well. Actually, I've been meaning to see if updating to SDL 2.0.5 would let us get rid of a hack preventing multiple connected force-feedback devices from selecting the correct one, so I can look into other problems at the same time.

EDIT: Actually, a quick look says that the spring effect should last indefinitely, although it... seems to be affected by how fast the player's ship is moving? The player's speed modifies the spring effect's coefficients, which affect how fast the force increases, so if your ship isn't moving... it's possible the spring effect would become unnoticeable? It depends on how the handling scalar works, which isn't entirely clear to me... I can try creating a test build that just removes that effect and you can see if that changes your experience.

Alternatively, maybe experiencing too many haptic effects is making your joystick "forget" the oldest one, which happens to be the spring effect? I always have a centering spring effect enabled globally, outside of the game, so I don't know if my own joystick behaves that way.
« Last Edit: March 30, 2017, 10:33:37 am by AdmiralRalwood »
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: Joysticks "Auto-Center" does only work for the first mission per session
Because i do not have any settings that i can change, my Joystick also have this feature enabled even in Windows, outside of the game.

And in the game it is also active... and works how it should. But only until any menu appear... than it does not center anymore.
That is kind of annoying, because i have to restart the game after every mission. Because i can not play without this feature very well, because you get used to this resistance, also you have this in every other flight game, that use Force Feedback.

And in older builds it is working... 3.7.4 is no problem. But that does not use SDL as far as i know.

And no, it does not matter how fast my ship is, the center-effect is completely gone.
Shivan here, Shivan there, Shivan everywhere.

My english isn't very well, so sorry for a few mistakes.

FreeSpace Let's Plays on my Channel:
| The Great War | Silent Threat | Operation Templar | Silent Threat: Reborn | Shivans - Phantoms | Shivans - Echo Gate | Shrouding the Light: Origins | Shrouding the Light | Cardinal Spear | Cardinal Spear: Vega | Awakenings | The Destiny of Peace | Between the Ashes: Mefistofele

 
Re: Joysticks "Auto-Center" does only work for the first mission per session
This is my exact problem as well. Those who do not have a Force Feedback joystick don't understand how irritating it can get to fly missions without auto-center.

This problem is definitely SDL2 related. The older 3.7.4 had no problem whatsoever.

My experience is that the auto-center often disappears when something "Force Feedback" -intensive happens or simply during cutscenes (like in JAD 2.22).

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Joysticks "Auto-Center" does only work for the first mission per session
There are references to supporting autocenter in the code, and there's SDL auto-center documentation, so maybe this is just something that was accidentally omitted.  We don't seem to be using that function currently.  In the SDL Haptic init function it seems to disable autocenter by default and set gain to max intentionally, so it looks like we may just need to re-enable autocenter after our haptic init call?  Current haptic code (I think), see SDL_HapticOpen().

I thought we wanted to bump to 2.0.5 to try to fix some other SDL issues as well, specificially with Haptic, before we go to 3.8.  Might be getting a bit close to make that change now though but I'm willing to start testing that upgrade.

Now that I read closer, I'm surprised this works for even one mission if we never call to enable SDL_HapticSetAutocenter() in our own code.
« Last Edit: March 31, 2017, 09:48:45 am by chief1983 »
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline AdmiralRalwood

  • 211
  • Mister Subspace Strikes
    • Skype
    • Steam
    • Twitter
Re: Joysticks "Auto-Center" does only work for the first mission per session
Look at the pSpring effect in the force-feedback code.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Joysticks "Auto-Center" does only work for the first mission per session
I submitted a PR that moves the windows SDL lib to 2.0.5 and reverts the Haptic hack (haven't verified if the detection bug was actually fixed in 2.0.5 yet though, couldn't find the Bugzilla report you mentioned).
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline AdmiralRalwood

  • 211
  • Mister Subspace Strikes
    • Skype
    • Steam
    • Twitter
Re: Joysticks "Auto-Center" does only work for the first mission per session
Anyone experiencing this problem: m!m wrote a potential fix and I've uploaded some test builds. Give them a try and see if they work for you.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Joysticks "Auto-Center" does only work for the first mission per session
Offtopic:  Can we get a list of coders who would appreciate a force feedback device, and a list of FF devices that would be appropriate to get?  I can't imagine it would be impossible to snag a few used FF devices over time and get them where they need to go.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Joysticks "Auto-Center" does only work for the first mission per session
I had a FF-enabled joystick a long time ago, and I DID have trouble with the FF dying after a while, but i am certain it was due to overheating, because I remember once I was playing a mission and my brother called up so I had to pause the mission for a while.  When I finished the call and came back to the game, I was able to finish the mission without the FF dying on me.
The Trivial Psychic Strikes Again!

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Joysticks "Auto-Center" does only work for the first mission per session
I'm not sure of the current state of the code, but the problem may be quite simple. When the haptic effects are created, the spring effect is immediately started. When a mission ends all haptic effects are stopped, also stopping the spring effect, and it doesn't ever get restarted.

So you should just need to either start it in joy_ff_mission_init(), or make sure that it's playing at the end of joy_ff_adjust_handling().

But don't confuse it with the SDL auto-center functionality since that isn't the same thing that the pSpring effect is going for. pSpring isn't auto-center.

 

Offline m!m

  • 210
Re: Joysticks "Auto-Center" does only work for the first mission per session
I tried restarting the spring effect when all other effects were stopped but that didn't work for some reason. I noticed that the original code only stopped a few specific effects so I tried porting that code to the SDL equivalent but it hasn't been tested yet.

Here is the PR with the current status: https://github.com/scp-fs2open/fs2open.github.com/pull/1420