Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Using joysticks / gamepads like a PRO - tutorial

spekkio

Arcane
Joined
Sep 16, 2009
Messages
8,278
BROs, how about a nice cup of tl;dr ? :obviously:

Advanced options (button / axis remapping, deadzone) for all types of joysticks / gamepads

In my case it's good old Dual Shock 2 gamepad for Playstation 2 (2 x 2axis a-stick, 10 buttons, 4-directional d-pad):

0kZosZd.jpg


Plus simple PS2 -> USB adapter (no Win7 drivers for this bitch):

ibavaVa.jpg


So, you have some simple gamepad, with close to zero configuration options (cheap shit, no drivers for newshit OS):

KZyKo7k.png

5t2mdUi.png


Yet you want to change some of its options? Well, it's possible...

A) Gamepad is DirectInput only, game is Xinput only

You will need an XInput emulator, preferably x360ce. Newest versions require .NET 3.5 or .NET 4.6.
Extract it to the game's .exe directory and launch. You'll get this:

Uz7qtef.png


Create the dll (some old games require different type / name of dll - more on this later). You can check if your pad is in the Internet database:

438ItrM.png


But most likely you'll have to configure it manually.

Before:

gyTVWgD.png


After:

612zTh3.png


:greatjob:

You can map buttons in any way you want, set deadzone, sensitivity, etc., etc.:

fwPdR8L.png


If your game requires older/newer version of XInput .dll, there's special section for that:

H9AuvsS.png


That is all.

:mca:

B) Gamepad is DirectInput or Xinput, game is DOS-only

You'll have to use DOSBox. :obviously:

All versions of DOSBox have inbuilt Mapper, accessed by pressing CTRL+F1:

uKUCPbL.png


But first, enable joystick emulation in dosbox.ini:
Code:
[joystick]
# joysticktype: Type of joystick to emulate: auto (default), none,
#               2axis (supports two joysticks),
#               4axis (supports one joystick, first joystick used),
#               4axis_2 (supports one joystick, second joystick used),
#               fcs (Thrustmaster), ch (CH Flightstick).
#               none disables joystick emulation.
#               auto chooses emulation depending on real joystick(s).
#               (Remember to reset dosbox's mapperfile if you saved it earlier)
#               Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
#        timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).
#     autofire: continuously fires as long as you keep the button pressed.
#       swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
#   buttonwrap: enable button wrapping at the number of emulated buttons.
joysticktype=auto
timed=false
autofire=false
swap34=false
buttonwrap=false
PROTIP

If you want to use exclusive hat instructions (game supports joystick's hat and certain events ingame can be done ONLY by using the hat), switch to:
Code:
joysticktype=fcs
This will enable direct hat emulation:

oRULAdh.png


This is not required if you want to use d-pad / hat to perform some event which is done ingame by pressing any other input device than the hat.
For example, if you want to map your "d-pad up" gamepad button to the "a" keyboard input, any joystick type will do.

Now you have to map buttons to inputs.

For example: you want to use "a" keyboard input with the "d-pad up" button (pressing "d-pad up" leads to the game receiving the "a" keyboard input).

1) Click "a" on the Mapper's keyboard display:

dLRmLjD.png


As you can see, "Event: key_a" ("a" keypress ingame) is bound to "a" button on real keyboard ("BIND: Key a").

2) Click "Add" to add second binding to the event:

u61XAnn.png


3) Press "d-pad up" on gamepad:

8ZJEEfU.png

5pfcwIS.png


That is all. Repeat with other buttons / axes.

PROTIP

In most cases, you don't need most of "virtual joystick" settings. It's better to map gamepad binds to keyboard events.
For example, Archimedean Dynasty supports 2axis analogue joystick with four fire buttons:

BmwirDO.png


But what if you want to use these buttons to perform some other actions / use more buttons? Well:

1) Remove ALL "virtual joystick" binds in Mapper, except the analogue movement (Axis 1/2: X+ X- Y+ Y-):

50VLMIU.png


In case of AD, it boils down to removing all "Fire" buttons (1-4), since 2nd axis isn't supported anyway. Like this:

lhWowuq.png

O5TK50M.png


2) Now add gamepad binds to any virtual keyboard / joystick events you want.

My Archimedean Dynasty input:

4PEbMPN.png

BmwirDO.png

Og1GRf8.png


Looks like this on my gamepad:

8XUq9UV.jpg

Code:
left a-stick: analogue joystick (ship's direction) [only thing controlled by analogue "virtual joystick" events]
triangle: q (afterburner)
square: enter (next torpedo)
circle: tab (fire torpedo)
cross: space (fire gun)
R1: a (max acceleration)
R2: z (max deceleration)
L1: l (lock reticle object)
L2: u (lock nearest enemy)
Select: t (lock next sensored object)
Start: p (pause)
d-pad up: n (next navpoint)
d-pad down: alt+n (lock navpoint)
d-pad left: g (lock next incoming torpedo)
d-pad right: j (lock next attacker)
right a-stick up: keypad 1 (target chase view)
right a-stick down: keypad 0 (player chase view)
right a-stick left: keypad 7 (target camera)
right a-stick right: keypad 5 (player camera)

This part:
Code:
d-pad down: alt+n (lock navpoint)
requires two events ("left alt" & "n") bound to one bind (real gamepad's d-pad down):

mLj5zOZ.png

DvskmxT.png


This way, pressing "d-pad down" will result in pressing "alt+n" on virtual keyboard.

:smug:

As you can see, I can control the game almost exclusively via gamepad...

DWI_1.png


But there's one problem with regular DOSBox... No fucking deadzone!

:rage:

This is fucking outrage. In case of many games (X-wing for example) this leads to ship drifting away slightly - virtual joystick is too sensitive / real gamepad is too loose and you can do shit about it (enabling timed intervals won't help):



But there's a solution!

Just grab a special build of DOSBox from David Walter Development page:

DosBox DWD

It has some audio fixes for Terra Nova and Wizardry 6&7, but the most important thing is a joystick deadzone patch.
Just set your preferred deadzone in dosbox.conf:
Code:
[joystick]
#     deadzone: specify the percentage of motion to ignore. Use 100 for a fake digital effect.
deadzone=5
From my experience, even 5% of deadzone is enough to fix the drifting in X-wing.

BTW, my X-wing gamepad input looks like this:

8XUq9UV.jpg


Code:
left a-stick: analogue joystick (ship's direction) [controlled by analogue "virtual joystick" events]
triangle: x (firing settings)
square: w (weapon settings)
circle: ctrl (keep pressed and use left a-stick to roll)
cross: fire [controlled by "virtual joystick" event]
L1: r (target nearest enemy)
L2: y (previous target)
R1: s (shield settings)
R2: t (next target)
Select: shift+a (assign target to wingmen)
Start: p (pause)
d-pad up: i (identification / targeting mode)
d-pad down: . (cockpit on/off)
d-pad left: f9 (laser recharge rate)
d-pad right: f10 (shield recharge rate)
right a-stick up: ; (shield energy to lasers)
right a-stick down: ' (laser energy to shields)
right a-stick left: - (decrease throttle)
right a-stick right: + (increase throttle)
DWI_1.png


Only one thing left...

C) Gamepad is DirectInput or Xinput, game is Windows only

Well, now shit gets tricky... You will need two things, this:

vJoy

vJoy is a device driver that bridges the gap between any device that is not a joystick and an application that requires a joystick
So, it's basically a framework for virtual joystick.

And also this:

Universal Joystick Remapper

- Uses the free open source app vJoy to create a virtual joystick
- Configure UJR to tell it which physical joystick axis/button controls which axis/button of the virtual joystick - each axis and button of the virtual stick can be mapped to a different physical joystick
So, it's a virtual joystick.

How does it work? Well, when using real joystick / gamepad, stuff works like this:

Code:
hardware (pad) -> API (DirectInput / XInput) -> software (game)

And when using the above programs, it changes to something like this:

Code:
hardware (pad) -> API (DirectInput / XInput) -> wrapper (vJoy + UJR) -> software (game)

Or something. :roll:

Anyway:

1) Install vJoy. You will end up with second joystick:

SbLKknC.png


2) Run "Configure vJoy" app. Enable required axes, buttons and hats:

hXeirvQ.png


Consult your real gamepad properties to learn what should be enabled:

5t2mdUi.png


Virtual pad's properties should look p. much the same as your real one's:

i6olaZM.png


PROTIP

Experiment with different axes / hats in case of trouble (application doesn't recognize it). I had to use Continuous hat to make it work.

2) Extract UJR somewhere convenient. It has to be running in the background to work. Run it. Configure all axes (+ deadzone, sensitivity, etc.):

QBwtLvQ.png


Buttons:

qRrHNTj.png


And hats:

h9dt0TK.png


You're pretty much done now. Just remember that now you have TWO gamepads, so you have to make sure that the game uses the proper one (virtual):

LoDS2iG.png


And not the physical one:

XQh3AoN.png


If the game doesn't have input device selection, you can fuck around with the default device in Win:

RgAOsFO.png


That allmost all. Except using normal / abnormal DOSBox.

:cry:

For example, I wanted to use Daum's DOSBox for X-wing. Daum's build has additional options like quicksaves, MT-32 support and more. But it doesn't have the "deadzone" patch.

:decline:

So...

D) Using vJoy with Daum's DOSBox

1) Prepare vJoy and UJR, make sure everything is configured (see above).

2) Modify dosbox.conf from:

Code:
joysticktype=auto

to:

Code:
joysticktype=4axis_2

With this option, DOSBox will recognize 2 gamepads, and use the second one.

3) Launch the Mapper. vJoy should now replace your physical joystick / gamepad automagically (as long as UJR works in the background):

OPgs3VG.png


:greatjob:

If you still get the real gamepad as input device, you're doing sth wrong:

houUIaa.png


:killit:

Old binds (made with real gamepad) should work fine, as long as you mapped virtual buttons to corresponding real buttons (real button 1 = virtual button 1). If not, modify the bindings.

And that's p. much it:

4) Run the game:



:incline:

Thanks for (not) reading.
 
Last edited:

abija

Prophet
Joined
May 21, 2011
Messages
2,891
TLDR: buy a logitech gamepad instead if you want to play both directinput and xinput.
 

Astral Rag

Arcane
Joined
Feb 1, 2012
Messages
7,771
Logitech gamepads are ok but the PS2 controller has a much better d-pad so it's better suited for those who are into emulation, modern platformers etc.

Depending on the game/ emulator I use either a Dual Shock 2 or a GameCube controller.
 
Last edited:

Mustawd

Guest
I went mad trying to get my game pad to work on Wing Commander for dosBox. I'm not about to,go back to that abyss. Thanks for posting this formfuture reference for when I go,insane and try again.
 

Siveon

Bot
Joined
Jul 13, 2013
Messages
4,509
Shadorwun: Hong Kong
Talk about a surprise gift. I was just wondering how I would use my PS2 controller with other things besides emulators.

Thanks, man.
 

Gerrard

Arcane
Joined
Nov 5, 2007
Messages
11,925
tl;dr
If a game requires a joystick/gamepad to play, but only supports the xbox one then it's most likely a piece of shit not worth your time.
 

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,086
PS2 pad gets outclassed by 360 for 3D, and Sega Saturn for 2D. The PS3 one is even worse as the weight is all wrong. Not a really great choice.
 

spekkio

Arcane
Joined
Sep 16, 2009
Messages
8,278
abija said:
buy a logitech gamepad instead if you want to play both directinput and xinput.
Thanks for letting us know which gamepad you use. Too bad that this thread is about something else - using advanced joy/pad options irrelevant of the manufacturer.

Farage said:
Or buy games that have controller support. Y'know?
Thanks for being an illiterate. Everything I wrote was about games that have controller support.

Gerrard said:
If a game requires a joystick/gamepad to play, but only supports the xbox one then it's most likely a piece of shit not worth your time.
Thanks for being an edgelord. Many recent games dropped DirectInput support entirely, AFAIK such shitty games as Dark Souls or Mark Of The Ninja are good examples. Others support both APIs, but you can't configure buttons / axes freely (RE HD Remake).

BlackAdderBG said:
If a game requires a gamepad then it's a piece of shit not worth your time.
Thanks for letting us know that you only play strategies, adventure games and FPSes. That sure makes you an elite.

pakoito said:
PS2 pad gets outclassed by 360 for 3D, and Sega Saturn for 2D. The PS3 one is even worse as the weight is all wrong. Not a really great choice.
Thanks for letting us know which gamepad you use. Too bad that this thread is about something else - using advanced joy/pad options irrelevant of the manufacturer.

tl;dr

From 10 comments, only 2 were actually on topic. Gotta love the Codex. Maybe most of you should just stick to Fallout 4. Fucking retards. :lol:
 
Self-Ejected

Drog Black Tooth

Self-Ejected
Joined
Feb 20, 2008
Messages
2,636
The PS3 controller is where it's at. You can use it wired or wireless and pretty much with any device, be it your shitty laptop or a new and shiny Android phone, or even an Android smart TV. You can even use a Gameklip or another clamp (I'm currently using this one by DOBE) to convert your Android phone into a portable console.

Fuck man, I don't even have a PS3, but the gamepad is amazing.
 

PeachPlumage

Cipher
Joined
May 28, 2015
Messages
522
I will keep this thread in mind if I get the urge to break out my wii classic controller. Thank you, spekkio. :salute:
 

Gerrard

Arcane
Joined
Nov 5, 2007
Messages
11,925
Gerrard said:
If a game requires a joystick/gamepad to play, but only supports the xbox one then it's most likely a piece of shit not worth your time.
Thanks for being an edgelord. Many recent games dropped DirectInput support entirely, AFAIK such shitty games as Dark Souls or Mark Of The Ninja are good examples. Others support both APIs, but you can't configure buttons / axes freely (RE HD Remake).
MotN is perfectly playable with keyboard and mouse.
As for DS my original post stands true.:hero:
 

spekkio

Arcane
Joined
Sep 16, 2009
Messages
8,278
Fighting games? Platformers? Flight / Space sims?

Go back to your mom's basement, cunt.
 

BlackAdderBG

Arcane
Patron
Joined
Apr 24, 2012
Messages
3,045
Location
Little Vienna
Codex 2013 Codex 2014 PC RPG Website of the Year, 2015 Codex 2016 - The Age of Grimoire Grab the Codex by the pussy Codex USB, 2014 Pillars of Eternity 2: Deadfire Pathfinder: Kingmaker
Fighting games? Platformers? Flight / Space sims?

Go back to your mom's basement, cunt.

Fighting games are designed for arcade and good larper sims are mostly for sticks and m+k.Soooo platformers ,yeah masterpiece of game design.So much wasted time,remind me of that fallout 1 on gamebryo /bg2 on NWN engine decline endeavors,but I bet thread like that will get many likes on reddit.Why don't YOU stick to Fallout 4

1811904_0.jpg
 

abija

Prophet
Joined
May 21, 2011
Messages
2,891
Keyboards shit on any gamepad as far as platformers go. Gamepads aren't optimal for anything, but they cover all the spectrum at a minimum price and offer couch comfort.
 

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,086
Keyboards shit on any gamepad as far as platformers go. Gamepads aren't optimal for anything, but they cover all the spectrum at a minimum price and offer couch comfort.
Playing the devil¡s advocate here. If the platformer uses 0/1 movement it does, but if the character's speed depends on a 0-255 position of an analog stick then the pad is better.
 

spekkio

Arcane
Joined
Sep 16, 2009
Messages
8,278
Fighting games are designed for arcade.
WAT? You somehow hibernated through last ~15 years? There's a lot of console-only and even pc-only fighting games. Plus, arcade machines introduced joysticks / gamepads, so your point is even more moot. :lol:

sims are mostly for sticks and m+k
WAT? Mouse controls in a simulator? For what? Accessing menus? :roll: Still, it's pointless to even launch such game without a joystick or at least a gamepad (analog stick).

Keyboards shit on any gamepad as far as platformers go.
Why? What's so superior about a keyboard when it comes to platformers (without taking analogue controls into consideration - see pakoito's post above). Do elaborate. Except "KB = elite" or "I don't own a gamepad", of course.

And a separate thing: what about 3D platformers like Crash, Spyro, Mario, Jak, Ratchet, Sly and many more, which require analog controls? Keyboard is enough as well? What about 3D action-platforming-brawler games like Soul Reaver, 3D Castlevanias, Derpsiders, etc.?
Or maybe you hibernated through last ~15 years and somehow skipped Mario 64 and games that came after it?

Retards, fucking retards everywhere. :lol:
 
Last edited:

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom