Xbox 360 Controller Full Support -1 reply

  • 1
  • 2

Please wait...

eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#1 6 years ago

Working on Xbox 360 controller support. Will deploy this to all major mods, as the code runs on a separate thread entirely and is pretty interchangeable. A screenshot: shot0028-2.jpg A small start, I know, but it's making progress at least.

Eventually I'll work on rumble support and things like that, but I actually have to go out and get a wired Xbox controller if I want to test this fully. This only works on Windows (because this is all DirectX)




minilogoguy18

kitty dances for rep!

50 XP

4th September 2004

0 Uploads

2,675 Posts

0 Threads

#2 6 years ago

I've been rocking a PSX->USB adapter with a PS2 controller for years and it works great copying the control scheme from the xbox version of JA but joystick sensitivity is a main issue. If you can get that working that would be the most beneficial part of it all since IMO mouse and keyboard isn't that great for saber fighting or at least I never could get good with it.

You should do PS3 support too since many people have PS3's as well (I don't have a 360).




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#3 6 years ago

I have direct access to the hardware input via DirectX (XInput), so sensitivity, etc. should be changeable. The biggest blockade right now is the actual engine itself. I own a PS3 controller myself (no xbox controller yet...buying one on Monday), but it's Sixaxis so I can't get rumble stuff working on it. Also, no good C library exists for PS3 controllers...there's a C++ one floating around but...it's written in pretty much pure C++ (no C to be found :( ). DirectX is natively installed with MSVC 2010 too I think (I didn't have to download any DirectX SDK, at any rate) Rumble stuff for XBOX should be fairly easy though...it's just a matter of passing a signal to the xbox controller thread (main thing I wanted to do was add rumble).




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#4 6 years ago

Should be ready here in a bit - I'm just fleshing out some of the ways that rumble is used and I'll be done. Here are some cvars:

Cvars - All Clientside xbox_power - Specifies whether XBOX 360 controller related input is active. NOTE: You need Windows and DirectX 9.0 or above in order for this to work. I tested it on Win7 x64 with DirectX 10

xbox_rumbleModifier - Reduces (or amplifies) rumble. Set this to 0 to disable rumble completely.

xbox_sensitivity - Reduces (or amplifies) controller sensitivity (for right stick only, since it is handled special in that it acts like a mouse)

xbox_invertXLook - Inverts the right stick's left/right movement xbox_invertYLook - Inverts the right stick's up/down movement

Commands - All Clientside xbox_rumble - Sends a rumble to controller #1. First arg is power (goes as high as 65535 afaik) and second arg is duration.

EDIT: Code available here: http://www.jacoders.org/forum/viewtopic.php?f=5&t=244

No base JA version yet. Be patient ;)




minilogoguy18

kitty dances for rep!

50 XP

4th September 2004

0 Uploads

2,675 Posts

0 Threads

#5 6 years ago

No possibility of left stick sensitivity? Adjustment isn't necessary but no way to make it so that you walk when the stick is only moved say 50% or less?




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#6 6 years ago
minilogoguy18;5623351No possibility of left stick sensitivity? Adjustment isn't necessary but no way to make it so that you walk when the stick is only moved say 50% or less?

This is being worked on as we speak. Made a cute little menu (as part of Controls):

Spoiler: Show
XBOX.png



Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#7 6 years ago

Impressive stuff, I approve.




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#8 6 years ago

Done. Left stick now makes you walk if you only move it about 50% between threshold and dead zone. With that, I think I'm done with this and ready for a baseJA binary. Any more requests?




Guest

I didn't make it!

0 XP

 
#9 6 years ago

I don't use controller, but this looks good. Nice work, I'm sure plenty of people will find this useful.




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#10 6 years ago

Finished.

Download it here: http://gunslingersacademy.com/develop/public/xbox360.pk3

This is for Multiplayer only. Instructions for use:

- Place PK3 into folder (preferrably Makermod or Lugormod or base, but only use base if you don't plan on using mods) - Go ingame - Hit ESC, go to controls > mouse/joystick controls and turn JOYSTICK CONTROLS to ON - Join the game (or hit ESC to exit the menu, basically) - Go into your console (shift + tilde) and type "/xbox_power 1" without the quotes. If your controller is not connected properly, it will show on your screen "Please reconnect your XBOX 360 controller" - Bind your controls to whatever you want on the controls screen, but DO NOT BIND ANYTHING TO THE LEFT/RIGHT STICKS! They already have controls bound to them in the code. - Play!

You can adjust your controller with these (in your console):

xbox_rumbleModifier - Reduces (or amplifies) rumble. Set this to 0 to disable rumble completely. xbox_sensitivity - Reduces (or amplifies) controller sensitivity (for right stick only, since it is handled special in that it acts like a mouse) xbox_invertXLook - Inverts the right stick's left/right movement xbox_invertYLook - Inverts the right stick's up/down movement




  • 1
  • 2