VOGONS


Joystick response curves

Topic actions

First post, by tobe2199

User metadata
Rank Newbie
Rank
Newbie

Has the idea of having joystick response curves ever been raised here ?

Although my modern analogue gamepad works as intended in DosBox on my Ubuntu laptop I still find it hard to get the degree of fine control in the centre of the stick I'd need to do well at already hard games like X-Wing.

I thought having a custom response curve might help. It should allow me to eliminate the deadzone that many games implemented and scale the joystick input more appropriately to modern devices.

I've already found my way to josytick.cpp and INT 0x84 in bios.cpp but before I started I thought I'd first check in with you guys and gals.

1) Has this kind of thing already been considered, implemented, rejected ?
2) Is there some other way I could accomplish what I need using some existing Ubuntu utility. I've only noticed jscalibrator so far which doesn't seem to do this kind of thing.

Also.. any implementation hints you might want to throw in my direction would be appreciated. I was going to start by changing with JOYSTICK_Move_X/Y and then take a look at those read/write_p201 functions.

Reply 1 of 20, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Maybe you're just being loose with words, but gamepads dont have a response curve, unless you call polar on/off a curve. They don't operate the same as joysticks, the direction pads return a static value for a given position.

Reply 3 of 20, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

I'm referring to analog, the definitive gamepad of the pc being the gravis gamepad, which is also the only one that matters, because it's the one being emulated, and not that digital vs analog matters with gamepads, they operate the same way of returning set values.

   +----------------------------------------------+
¦ x = 0 kohm ¦ x = 50 kohm ¦ x = 100 kohm ¦
¦ y = 0 kohm ¦ y = 0 kohm ¦ y = 0 kohm ¦
+--------------+---------------+---------------¦
¦ x = 0 kohm ¦ x = 50 kohm ¦ x = 100 ohm ¦
¦ y = 50 kohm ¦ y = 50 kohm ¦ y = 50 ohm ¦
+--------------+---------------+---------------¦
¦ x = 0 kohm ¦ x = 50 kohm ¦ x = 100 kohm ¦
¦ y = 100 kohm ¦ y = 100 kohm ¦ y = 100 kohm ¦
+----------------------------------------------+

Reply 4 of 20, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

A response curve would be emulating low quality pots, which are more variable through their range vs good pots being consistent, and deadzone happens in a joystick with poor pots and/or poor mechanics, where a range of the joystick at the center isn't tracking movement.

I considered emulating the gravis analog joystick, which has an adjustable spring resistance, a response curve of sorts.

Reply 5 of 20, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

uhm joysticks in dosbox return a value between 0 and 100 kohm.
(the time between triggering one bit and waiting till it returns is depended on the position.)

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 20, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

ih8registrations: Whatever you are smoking, you should cut down on it. Gamepads are DIGITAL. There is no such thing as a "analog gamepad" (when we're talking about "DOS gamepads" like the Gravis). Either a contact is on, or it's off. End of story. The data may be transmitted by setting certain resistor values (as per your table, though i'm not sure what this table is supposed to say), but i boils down to "on" or "off".

Now, analog joysticks are a different matter. I've had many in the old days, and they all sucked. Even very, very expensive ones like the Gravis Thunderbird (or Firebird or whatever it was called). I don't quite understand the idea of emulating that crappyness. It's like emulating DOS crashes, just to make the experience more entertaining. Or emulating the infamous and extremely annoying joystick "drifting". If you are a masochist, please look for other ways to fulfill your phantasies. The trimming controls were for calibrating the joystick (=setting the zero position), not for configuring what you are calling a "response curve".

And as for "deadzone" and "response curve": this is a matter of the host OS, not emulation IMO. I don't think joystick or joypad functionality is a main focus of Linux devs, and thus quite basic. But strangely, even on Windows, which is more of a "gaming OS" than Linux, there are not many drivers that allow you to fine-tune your analog joystick/joypad inputs. An example of a driver that gives very fine control would be XBCD.

Reply 7 of 20, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Correction: Unless you are talking about quantum level physics, EVERYTHING in this world is ANALOGUE. Out of that continuous analogue world, engineers and electronics makes educated guesses and decides that some values should be interpreted as discrete values, and in the case of "digital" computers, as one of only 2 discrete values. But the gamepad is still analogue.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 8 of 20, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

On analog gamepads the directional pad opens and closes contacts to change resistances, but it is read in the same manner as analog gameport joysticks (timer whose length depends on the resistance). The buttons, on the other hand, are "digital" on analog gamepads and joysticks (switches close contacts that change line voltages from ground to 5V and vice versa).

The original poster is very probably talking about gamepads with analog thumbsticks, which can be used in dosbox to control the emulated joystick axes. Since the sticks are very small compared to joysticks, the poster wants to adjust their "sensitivity" (I've seen this type of adjustment in IL-2 Sturmovik flight sim).

Reply 9 of 20, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie
MiniMax wrote:

Correction: Unless you are talking about quantum level physics, EVERYTHING in this world is ANALOGUE. Out of that continuous analogue world, engineers and electronics makes educated guesses and decides that some values should be interpreted as discrete values, and in the case of "digital" computers, as one of only 2 discrete values. But the gamepad is still analogue.

Excuse my ignorance, but i am no nobel prize winning theroretical physicist like you seem to be. My approach is more of the practical persuation. Thus a button or switch to me is either on or off. There my be quantum states for that button or switch, but in real life it would be very hard to get that switch or button in such a position, wouldn't it? (;

Reply 10 of 20, by HunterZ

User metadata
Rank l33t++
Rank
l33t++
ih8registrations wrote:

I'm referring to analog, the definitive gamepad of the pc being the gravis gamepad, which is also the only one that matters, because it's the one being emulated, and not that digital vs analog matters with gamepads, they operate the same way of returning set values.

You're making an assumption that the original poster is talking about a Gravis Gamepad. He could be plugging in a PS2 or XBox style controller and (arguably incorrectly) calling it a gamepad while actually referring to the truly analog thumbstick(s).

In fact, everyone in this thread is going crazy with assumptions. A dialogue with the original poster is required because not enough information was given :p

Reply 11 of 20, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Qbix:
uhm joysticks in dosbox return a value between 0 and 100 kohm.
(the time between triggering one bit and waiting till it returns is depended on the position.)

Don't know if this is a reply to me. When I had written the joystick emulation for DOSBox, I included gamepad emulation. Checking the mapper it doesn't look like whoever did the rewrite included gamepad emulation(gravis gamepads only return the values shown in the ascii diagram). Regardless, response curves are not applicable to gamepads, unless, again, he's using "gamepads" as a loose term to refer to joysticks in general.

ADDiCT:
Gamepads are DIGITAL. There is no such thing as a "analog gamepad" (when we're talking about "DOS gamepads" like the Gravis).
Either a contact is on, or it's off. End of story. The data may be transmitted by setting certain resistor values (as per your table, though i'm not sure what this table is supposed to say), but i boils down to "on" or "off".

Incorrect. It's analog. Game port measures resistance in Ohms, the Gravis Gamepad returns those Ohm value sets for a given position as shown by the ASCII diagram. The values are 0,50, and 100 Ohms, and each position is a set.

Not all joysticks that connect to the analog game port suck. Two examples are the Microsoft Sidewinder and Logitech Wingman Interceptor, which use PCM. As a result are steady as a rock and don't require constant recalibration.

Deadzone and response curve exist in old joysticks as I've described, and they also exist in software(Aceshigh and Warbirds flight sims have elaborate joystick configuration of these two aspects.).

HunterZ: You're making an assumption that the original poster is talking about a Gravis Gamepad.

Not exactly, I'm making a distinction between joystick and gamepad types of input, and making the assumption he's using gamepad as a generic term or referring to a gamepad type controller, but you're right, he could be using a combo console controller with functionally of both types.

Last edited by ih8registrations on 2009-06-15, 23:50. Edited 1 time in total.

Reply 13 of 20, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

You were around. The patch should still be here at vogons, sourceforge or both. Yep: Joystick patch: handling through the mapper & joystick emulators. The difference is same as between the real gamepad and joysticks; immediate fixed response instead of a ranged response; full speed vs gradual speed.

Reply 15 of 20, by tobe2199

User metadata
Rank Newbie
Rank
Newbie

@ADDiCT

He's talking about emulating an analog joystick using the analog thumbstick of a gamepad, not the d-pad itself

Bang on.. what I have exactly is the Saitek P380 Dual Analog Pad (http://www.saitek.com/UK/prod/p380.htm).

jscalibrator tells me this has a range of 0 to 255 per axis with 128 being dead centre. Regardless of the means of measuring stick displacement (most likely optical and therefore digital 'cause of the limited range and high consistency) the data is most certainly delivered to the laptop digitally since it's a USB device.

Anyway.. I did notice that the joystick lib adds it's own nullzone to the joystick input and once I removed that it did noticeably improve my game experience. I'm pretty sure that the game is also implementing it's own nullzone though and that, coupled with the limited resolution and travel of the stick itself, can make those fine adjustments near the centre of the stick that you need do well at a game like X-Wing suggest to me that a joystick response curve might improve my experience further.

Reply 16 of 20, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

You were around.

2004... not really.

can make those fine adjustments near the centre of the stick that you need do well at a game like X-Wing suggest to me that a joystick response curve might improve my experience further.

I don't know how relevant this sort of adaption is for other people. Just be sure
you have a good idea of which "side" you want to tackle, the input (preferred)
or the output (emulation, joystick.cpp) side.

Reply 17 of 20, by tobe2199

User metadata
Rank Newbie
Rank
Newbie

Just be sure you have a good idea of which "side" you want to tackle, the input (preferred) or the output (emulation, joystick.cpp) side.

Sure.. which would you define as which.. it looked to me at first glance that the easiest place to put this would be at Joystick_GetMoveX/Y functions. Need to spend an evening with some debug prints to more fully understand what's called from where (no comments in code).

Reply 18 of 20, by wysiwyg

User metadata
Rank Newbie
Rank
Newbie

Hello 😀.

Yesterday I bought a wireless XBOX 360 joypad, connected it with the dedicated microsoft wireless controller to my PC and I tried to play Seek & Destroy on DOSBOX 0.74. I have a problem setting the deadzone for the left analog stick on the joypad. In game the joypad moves up/down/left/right on its own, without me touching anything. I've calibrated it from the driver, and I've calibrated it from inside the game - there's no difference. I googled and stumbled upon this topic, which seem appropriate to post about my problem 😀.

Thanks for any future suggestions.

My PCs / My series collection