Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Full XBox 360 Controller DLL with Voice support

Author
Message
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 31st Jul 2009 07:43 Edited at: 5th Oct 2013 05:25
Full XBox 360 Controller Library
Version 1.3
For Dark Basic Professional
And Dark GDK!


LICENSE


----------------------------

Download the latest XBox360 Controller Libraries at The TGC Forum Repository today!

Download for Dark Basic Pro

Download for Dark GDK

----------------------------
Games used in:

Ghost Planetoid From Outer Space By: jfroco

----------------------------

[This product is no longer supported]

NEW For September 5, 2010:

Version 1.3 is up for both Dark Basic Pro and Dark GDK at ExoDev.Com's download section! This wraps it up and should be the final version. Hopefully, it's bug free. There's no more functionality I can wrap up from the XInput.dll. This release features XInput's Keystroke functionality. It was meant for the Chatpad, but chatpads don't work on the PC because Microsoft haven't made any drivers for them as of this date. But it works for the gamepad and can use it if you want to simulate the XBox360's on-screen keyboard thing. And it's there just in case if someday Microsoft does support the chatpad on the PC. Also feel free to join up at ExoDev.Com as I have section for the XBox360 Controller Library aaaallllll to itself. Enjoy.

NEW For August 30, 2010:

CHATPADS: Unfortunately as of this date, Microsoft has yet to make drivers for chatpads to work for the PC. Found the info at the XNA site:
http://forums.xna.com/forums/t/5003.aspx

Notice to Wireless Controller Users: You may have a wireless controller that can work by itself with the PC, but unable to get connected accessories to work correctly through the wireless controller. After gathering a lot of info about different complaints on the web through google about wireless 360 controllers, most likely I will not be able to do anything about it with my library. The library simply takes info directly from the XInput.dll and gives it to you. There is no special separate XInput functionality and/or parameters for me to use/differentiate between wireless connections and wired connections. That's the XInput DLL's job because all we want is the data/info it gives us. Wired + Accessories works 100%, but wireless + Accessories don't? There's no special XInput option for me to enable for that. It doesn't work like that.

Some problems found from the web about wireless controllers:

old firmware on older generation controllers will not work for the PC period.
people try to use the charger adapter usb cable to connect the wireless controller directly to the PC like a wired controller. People say they got it to work that way, but I would be scared about frying something like that. I don't recommend that at all.
Apparently there are two flavors of the 360 gamepad. It will say on the it's packaged box, made for PC ( or Windows ) or made for XBox360. I never seen anything like that and wouldn't have any clue how you can tell which one you have.
There's also talk about problems with the wireless controller wanting to much power through the usb receiver that the controller itself may or may not work. If that's true, I can understand why connected accessories don't work. Needs more juice! If your headset is not working with your wireless gamepad, this is probably the reason.
This wireless 360 receiver for the PC thing seems to not be in production anymore. Major stores around here don't carry it and these stores are even out of stock to order them online. Wonder why?

Just in case, this is the direct instructions on how to connect a wireless controller with the PC receiver:
X12-35608-01_NA_EN_FR_ES.pdf

This is where I'm getting all these wireless issues from at google:
wireless 360 gamepad PC

Here's the Post about these findings if you want to discuss it more

-------------------------------------------------------------------

NEW For August 29, 2010:
(Edit:Feb 6th, 2013 - No longer Hosted at exodev.com)

NEW For August 24, 2010:
Edit: Beta 1.3 no longer available

NEW For July 15,2010:
Minor update on the DBPro version: String Name for XB360_CHECK_HEADSET_CONNECTIONS in Dll was not correctly written.

NEW For May 15, 2010:
Updated both DBPro and DarkGDK dlls so that the DPAD will return correct results. Docs updated.

------------

[ Network Question ]
Will network programming guru's out there be able to take the current sound data and send it over the network to another user and be able to hear the voice sound data good enough? Like with XBox Live? For me, the sound data sounds good enough when played into my XBox 360 headset. If you try, please let me know how it goes. Thanks

* Note: This is not just for the XBox360 gamepad! It's for all xbox360 controllers like the guitar. Try it out.

* Note: The "Guide" Button on the gamepad for example is for Microsoft use only. I am not able to supply a function for it's use as there is no XInput functionality for me to code it.

Version 1.3 FUNCTIONS for DBPro:


Version 1.3 FUNCTIONS for Dark GDK:



* Here's a thread link to an executable of the DarkGDK example program. Have a quick try at it to see how your xbox 360 controller works with it. Any feedback on it would be greatly apprieciated, thanks:
http://forum.thegamecreators.com/?m=forum_view&t=156031&b=22

* Attached is a boring picture of what the example program looks like. It just shows the values of the xbox360 controllers functionality.

Attachments

Login to view attachments
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 31st Jul 2009 10:28 Edited at: 31st Jul 2009 10:54
Brilliant! Am downloading now. I've been thinking of getting a 360 controller for windows for a while, this has just finnaly talked me into doing it

EDIT: Would it be possible to add a command for detecting when the Guide button is pressed? Obviously on the PC, that's not needed normally, but there could be a use for it in games.

Your signature has been erased by a mod because it's larger than 600x120
Rampage
16
Years of Service
User Offline
Joined: 4th Feb 2008
Location: New Zealand
Posted: 31st Jul 2009 13:42
Brilliant man. First time I've actually programmed for my Xbox controller
!


Eidos!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 31st Jul 2009 22:00
Thanks guys.

Unfortunitely, The DirectX XInput library does not provide any way to access the "Guide" button. It's probably specific only for the XBox 360 console itself. In fact, I do remmember reading somewhere in the SDK documentation that it's not supported on the PC.

Use Dark GDK with the latest DirectX SDK!
C2Q2.66ghz, 8gb RAM, Geforce 9800 GX2, Vista 64-bit
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 1st Aug 2009 00:47
ah, Oh well - It's not too important

Your signature has been erased by a mod because it's larger than 600x120
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 1st Aug 2009 01:29
Arg. Just noticed I have a document error:
XB360 DPAD (Integer 0-3),Returns:Boolean
Should read:
XB360 DPAD (Integer 0-3),Returns:Integer

It actaully returns an integer value 0-4:
0 = nothing
1 = UP
2 = DOWN
3 = LEFT
4 = RIGHT

which is correctly used in the provided example code.

Ya gotta luv doing docs!

Use Dark GDK with the latest DirectX SDK!
C2Q2.66ghz, 8gb RAM, Geforce 9800 GX2, Vista 64-bit
Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 1st Aug 2009 01:33
Great work Todd. Seems simpler then Ravens one.



Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 1st Aug 2009 01:55
Thanks Deathead.

Also, I forgot to mention about the XB360 GET BATTERY LEVEL function. If somebody has a wireless controller and a wireless headset with that usb wifi hook-up accessory thing for the PC, can you test that for me with the provided example?? Unfortunitely I cant test that as I dont have that accessory. I might have to fix the return values. Thanks. I wish I could buy all that stuff.

Use Dark GDK with the latest DirectX SDK!
C2Q2.66ghz, 8gb RAM, Geforce 9800 GX2, Vista 64-bit
Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 1st Aug 2009 02:27
If you were to have sold this, you probably would have gotten enough money to buy all that stuff!


Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 1st Aug 2009 02:38
lol. I just couldn't justify selling it. Plus, it gives me a chance to share something free with the cool community here.

Use Dark GDK with the latest DirectX SDK!
C2Q2.66ghz, 8gb RAM, Geforce 9800 GX2, Vista 64-bit
Randomness 128
17
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 1st Aug 2009 05:32
Quote: "It actaully returns an integer value 0-4:
0 = nothing
1 = UP
2 = DOWN
3 = LEFT
4 = RIGHT"

Can it not recognize diagonals?
qshoper
16
Years of Service
User Offline
Joined: 20th May 2007
Location:
Posted: 1st Aug 2009 08:17
hey is it possible to use this for FPS CREATOR? I am working a project and was thinking of importing a controller. It would totally save me a lot of time if it was possible to use this.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 1st Aug 2009 21:13 Edited at: 16th May 2010 06:34
Randomness 128, Unfortunitely not. The data taken directly from the XInput library's XInputGetState function only gives direct up,down,left or right directions.

qshoper, Yes ofcoarse. It's released under the zlib license( which the zlib license is explained in the provided html documentation). So basically it's free to use for whatever purpose, commercial or non-commericial.

EDIT: This library adopted the creative commons license ( LICENSE ) instead of the zlib library as it is more fitting. This library is not open source. It is still free to use for commercial or non-commericial use with credit.

EDIT: DPAD now returns correct results... diagonally works. Screwed up on how I was returning the results.

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 1st Aug 2009 21:16
Actually, FPS Creator has no support for DLLs like this one, so it can't be used with FPSC.

Your signature has been erased by a mod because it's larger than 600x120
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 1st Aug 2009 21:41
Ah, I was thinking people who made those mods with the released FPSC source code could call third party dlls like mine?

Use Dark GDK with the latest DirectX SDK!
C2Q2.66ghz, 8gb RAM, Geforce 9800 GX2, Vista 64-bit
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 1st Aug 2009 22:06
hm.. they probably can, but i thought he was talking about just using it in an FPSC game, not a mod or anything.

Your signature has been erased by a mod because it's larger than 600x120
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 2nd Aug 2009 09:12
Since I'm going to be doing some Dark GDK work also, I'm going to create this library for C++ applications also. Whenever I get into C#, I'll try to figure how to do it for that too.

Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 3rd Aug 2009 13:47
Quote: "Unfortunitely, The DirectX XInput library does not provide any way to access the "Guide" button. It's probably specific only for the XBox 360 console itself. In fact, I do remmember reading somewhere in the SDK documentation that it's not supported on the PC."


Sure it is... ever play any Games 4 Windows Live games? That button DOES bring up the guide. Its not considered a regular joystick button however, no idea how to access it though, but I'm positive theres a way...

btw Voice support owns.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 3rd Aug 2009 22:41 Edited at: 3rd Aug 2009 22:44
Quote: "btw Voice support owns. "


Thanks! I just hope it's good enough for the network coders to use.

Quote: "... ever play any Games 4 Windows Live games? That button DOES bring up the guide. "




Interesting. But, as far as XInput goes( or at least the version they give us in the latest SDK ), it will not allow programmers to use it.

ie: I just read a thread over at the xna forums saying exactly what you said about it. It is used for bringing up the guide for Games 4 Windows Live. So basically, Microsoft is being stingy with it and using it for themselfs.

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 12th Aug 2009 11:47
NEW: Dark GDK support available! Look at first post to download

If you have a wireless controller that works with your PC and/or any other xbox360 controller like a guitar, I would love to hear how this library fairs for you. Thanks! All that stuff should work!

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 26th Aug 2009 20:40
I also have an executable attached to this thread:
http://forum.thegamecreators.com/?m=forum_view&t=156031&b=22
if you don't want to compile it yet and just want to see how your xbox controller works with it, you can quickly try that. Any feedback on how it works for you would be greatly apprieciated! Thanks

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 3rd Sep 2009 14:21
great, my Xbox 36 controller for Windows has just arrived so i can finally test this! With the "Integer 0-3" bit next to the commands, does that mean it can support up to four 360 controllers?

Your signature has been erased by a mod because it's larger than 600x120
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 3rd Sep 2009 16:42
Yes, that would be the valid controller ID numbers. XInput allows up to four controllers.

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 4th Oct 2009 04:01 Edited at: 4th Oct 2009 04:01
I know patience is a virtue, but before this thread gets auto locked from no active posting...

I wanted to ask if anybody had a chance to actaully "test" this library out yet?

Did it work for you?

Any problems?

Is this library even worth while having around?

Any questions about it?

If there are no posts from now to being auto-locked, after that I'll announce it in the program announcment forum and mark it as being able to work good for everybody.

Thanks...

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 4th Oct 2009 16:24
It's working great for me I started an RTS demo using it and I havn't had any problems so far. Thanks!

Your signature has been erased by a mod because it's larger than 600x120
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 5th Oct 2009 08:31
Awsome! Thanks blobby. I'll keep an eye out to see if you put it in w.i.p. I'm definitely interested to try it out.

ReiKumar
15
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 18th Oct 2009 07:49 Edited at: 18th Oct 2009 07:57
Hey, I'm having a little trouble with the library.

It seems the when I'm pointing in the south direction and I try to move, the screen goes upside down.

Below is all my code. Turn around and look at the stairs and move around.





Any ideas?
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Oct 2009 17:50 Edited at: 18th Oct 2009 19:15
Hi ReiKumar, is it possible for you to zip up the media you used with this program to download? Or is it stock media that's hidden somewhere in the Dark GDK directories? Thanks.

I'm anxious to look at it. Unless somebody else beats me to the punch, I'll try to see what's going on once I get back from running errands.

edit: ok, found the media... trying to find out what universe.dbo needs for it's textures...

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Oct 2009 20:08
Ok, intriguing. I see what you are experiencing. Your code looks correct at first glance. I see how the world is flipping upside down and even the straffing gets messed up. From the "game level" example code, looks like the dbControlCameraUsingArrowKeys function handles this well( ie: without straffing ). Currently, I'm wondering if dbMoveCamera and the RotateCamera functions can't play well together.

Still looking...

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Oct 2009 21:32
Ok, instead of busting my brain out, I searched the forum and saw a code snippet that Jason P Sage had for rotating the camera.

With that and without the straffing, it worked just liked that "game level" example code movement with the dbControlCameraUsingArrowKeys function, but still had a problem with the dbTurnCameraLeft function when straffing. It would somehow flip the map around and even would move the camera in a different direction based on what direction you would be moving forward from.

So instead of using the dbTurnCameraLeft function for straffing, I used the RotateCamera functions for the job. So the "fly cam" movement with the strafe movement seems to work now...



ReiKumar
15
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 19th Oct 2009 11:20
Thanks for the reply, that worked perfectly.

I do have another piece of code I was hoping you'd look at.

This has to do with rotation capping. For example when the user looks up, I only want him to be able to look directly up and not have the camera flip over to look behind him.

The code I'm using limits him to 90 degrees (straight up) and -90 degrees (straight down), however this ends up not working because if you hold the direction stick down in that direction is ends up flipping after a few seconds.

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 20th Oct 2009 04:21 Edited at: 20th Oct 2009 04:26
Hi ReiKumar,

dbText is your friend here. Using dbText to output values will help you debug situations like this and help you understand whats going on under the hood.

Make sure you have a char array, txt, pre-defined before the loop starts:
char txt[256];

And before the sync, write dbText output for both fCameraAngleX and fCameraAngleY:


Hopefully, you will see that rotating around the x and y axis of the camera result in values between 0-360.

For me, my x axis, angle x, starts at 0. Rotating around the x axis via moving the camera facing downward, my x axis values starts to increment. Yet, if I'm facing forward and my angle x is at 0, and I start moving the camera facing upward, my x axis value immediately goes to value 359 and decrements downward.

This 0-360 wrapped values are caused by the DarkGDK function "dbWrapValue". Looking at your code above, I assume you are thinking that the angle values actually go into the negatives. It won't.

So, looking straight forward we roughly are at around 0 or 359 degress since dbWrapValue wraps the variable holding the value at this point. If we look straight up, we should have an angle of 270. If we look straight down, we should have an angle of 90. So, basically if we look straight back, we would be at 180 degrees, ofcoarse everthing is upside down at this point. We don't want that.

Use those dbText outputs and make sure this is what you get with your program. If so, I would make an if statement using two OR'd conditions... something like:


This is base on the assumption that you are getting the current camera angles before calculating the angles. This is how I have it as shown in the code I gave in the above post:


Then after that I would do that if statement. If you are doing it the way I'm coding it and you are NOT getting the current angles before the calculation of the rotation axis, then the fCameraAngleX and fCameraAngleY will keep adding or subtracting from the last value it calculated which will mess things up.

Try that.

ReiKumar
15
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 20th Oct 2009 04:33 Edited at: 20th Oct 2009 04:45
Awesome thanks, that worked.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 16th May 2010 22:14
This thread has been un-locked to allow an update.

I drink tea, and in my spare time I write software.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 17th May 2010 00:03 Edited at: 17th May 2010 00:03
Thanks Lee.

The Library is now updated to version 1.2

The only thing new is now the DPAD returns results correctly. As the documentation explains:

XB360 DPAD (Integer 0-3),Returns: DWORD
Check if the DPAD( ie: Directional Pad ) is being pressed or not.
[FIRST PARAMETER]
Controller ID
[RETURNS]
Integer

* 0 = DPAD NOT being pressed
* 0x00000001 = DPAD UP is being pressed
* 0x00000002 = DPAD DOWN is being pressed
* 0x00000004 = DPAD LEFT is being pressed
* 0x00000008 = DPAD RIGHT is being pressed

[EXAMPLE]

* if (XB360 DPAD(i) && 0x00000001) then DPAD_UP=1
* if (XB360 DPAD(i) && 0x00000002) then DPAD_DWORD=1
* if (XB360 DPAD(i) && 0x00000004) then DPAD_LEFT=1
* if (XB360 DPAD(i) && 0x00000008) then DPAD_RIGHT=1

--------------

The hexadecimal results are directly from the XINPUT dll. I wasn't paying attention to what I was doing with the dll function before and only return boolean values instead of the values my c++ structure was getting filled with.

So now DPAD can do diagonal direction stuff now.

Thanks to Dr Tank for pushing me to see the error of my ways.

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Zipir
14
Years of Service
User Offline
Joined: 11th Aug 2009
Location: Turkey
Posted: 17th May 2010 02:47
tnx soo much
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 17th May 2010 03:43
Just wanted to say, if any of you are wanting to add xbox 360 controller functionality, Todd's .dll is the way to go. You can get the two big features that the stock Microsoft driver doesn't have:
The ability to split the trigger axis,and the ability to have the rumble feature.
And, you can even use the built in DBpro commands as well, so you could mix n match, whatever works.
Talk about flexibility!
Once you start playing around with one of these controllers, and Todd's dll, you'll wonder why you waited so long.
So, go for it. Get a controller, get Todd's .dll, and PLAY!

Thanks Todd for a great plugin.
Dr Tank
14
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 17th May 2010 21:16 Edited at: 17th May 2010 21:19
Thanks for updating this. Being able to fully use the 360 controller is really great! It's the nearest thing the PC has to a "standard" controller, (not counting keyboard and mouse of course). I actually bought a wired controller for this, after an hour or so trying to get my PC to communicate with the wireless one via the plug and charge kit.

This means I can emulate the controls of my favourite Xbox games, or equivalently PS, since the controllers are similar. It means I can have rumble, and analog triggers. It also means i'm a step closer to having the skills, experience or whatever to develop for XBLA if I ever get around to that.

I recommend everybody gets a wireless reciever for their existing 360 pad, or wired 360 pad (only £17 on amazon). You'll need it to be awesome at Super Badass Spaceship X when I finish it. In ten years` time or something. Hurry.

Thanks again Todd this DLL is totally sweet. It's also well documented with working help files and keywords. If you have a 360 pad you'd be crazy not to download this.
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 18th May 2010 05:00 Edited at: 18th May 2010 05:01
Just a quick heads up on something. I went out and bought a MadCatz wired controller. It was the 4716 model. It has an icon on the packaging that shows it is "designed for Windows XP".
Well, it didn't work. It was briefly recognized, then, was disabled. NothingI did would work, even tried XBCD driver.
No driver at MadCatz, either.
So, I took it back, thinking it was defective,and got another one.
Same thing. So, I do not recommend the MadCatz controller, unless someone here knows something I don't.
I also bought the Microsoft headset, I am going to play around with that tonight. Hopefully, that will work (I'm sure it will).
I was really wanting to try two controllers, but that is going to have to wait because I am tired of driving back and forth.
I'll pick up a used Microsoft one at Gamestop or something tomorrow.
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 18th May 2010 05:17
sorry for the double post, but I got the MadCatz controller to work.
What I did was, I unplugged the controller, uninstalled the driver, then followed the directions I found here:

http://www.madcatz.com/faq/default.asp?Action=Q&ID=89

After I installed it, I rebooted my pc, and then I plugged in the controller.
And I just tested it with the test app, and it works, I have all functions! YEA! I just wish now I didn't take the first one back, because it was the last white one, this one is black. Oh well, at least I can tell the two apart real fast.

I plugged in the Microsoft one, and it to is recognized, so I am going to modify the test app to work with multiple controllers.

I'm also going to order the rechargeable wireless one from Walmart, they have them for 32.00. when I get that I'll let you know how it works.

Sorry for the false alarm, hope this helps.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th May 2010 05:53
Thanks for the nice words and support guys!

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 18th May 2010 08:00 Edited at: 18th May 2010 08:14
@Todd,
NP, just trying to get the word out.
Just curious, have you tried a guitar controller yet?

Also, I have some more info. With the new driver I downloaded, it adds functionality for that lighted up button. When you press it in a DBPro app, a little help/update thingee from Microsoft shows up. Also, the lights tell you what controller it is. Top left light is lit for controller 1, top right for controller 2, not sure where 3 and 4 are, but guessing bottom right then bottom left. Also, when you push that button, the correct light is lit on the help thingee, so it indicates which control launched it.

Anyway, I redid the test app to support up to 4 controllers. And, since my text display is so slow, you can toggle it on and off to see the framerate without the text. Makes a huge difference. There is some fps hit when running two controllers. You'll have to unplug them to find out for yourslf.

here is the code:



I noticed Lee himself unlocked this thread. hmmmmm........

edit:
added the .exe if you would rather just run the app instead of compile it.

edit again:
actually, I have no loss in framerate with text display off with one or two controllers.

sorry, one more edit:
Hey Todd, is it possible for you to get the name of the controller somehow?
Using the checklist is kind of a pain.

Attachments

Login to view attachments
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th May 2010 09:39
I've been wanting to make a game for my PS3 controller. I could get it to work fine in DBP using the default joystick commands (I'm using a driver that allows windows to recognize my DualShock2 controller as a normal joystick) but I'm wanting to write my game in C++ using DGDK..... and go figure, the commands I was using in DBP were not ported into DarkGDK!!!

Now that I'm looking at this, I'm tempted to run out and grab a wired XBox360 controller just to play around with this plugin. In all honesty, I would much rather use my PS3 controller over an XBox controller (My game is played with only the analog sticks), but if nothing else I would at least have support for a wider range of controllers.


Good job on the plugin! I look forward to playing around with it.


The one and only,


Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th May 2010 11:23 Edited at: 18th May 2010 11:27
Quote: "Just curious, have you tried a guitar controller yet? "


Unfortunately not as I don't have one. But, all the functionality is there for it. The only and last thing that I have not yet added support for is the keyboard. You can plug in a keyboard into the xbox and type on it when at that text screen where you enter your name for a game for example. Don't know why anybody would need it, but I will add keyboard support someday.

the command "XB360 CONTROLLER TYPE" will let you know if you plug in a guitar or any other type of controller.

Also, I only have one wired gamepad to test with :/ I do have a wireless gamepad but don't have the wireless thingy for the pc so it can detect the wireless gamepad



Quote: "Also, I have some more info. With the new driver I downloaded, it adds functionality for that lighted up button. When you press it in a DBPro app, a little help/update thingee from Microsoft shows up."


The XInput.dll itselt doesn't give you a function for that "Guide" button with the lights around it. Microsoft uses it for their own purposes. You see that little help/update window because you have "games for windows" installed on your computer.

Quote: "I noticed Lee himself unlocked this thread. hmmmmm........"

No conspiracies there! I promise!


Quote: " is it possible for you to get the name of the controller somehow?"


Not with the XInput dll. I know for myself I wont need that. It's either a xbox controller is connected or not. If it is, I would get what type of a controller is connected with "XB360 CONTROLLER TYPE" and display what ever info about it. If it's not, just print info to show the user that a xbox controller is not connected and not usable.

Quote: "actually, I have no loss in framerate with text display off with one or two controllers."


That's good to hear. Just to note, it does take more processing power for retrieving an additional controller's data. So with 1 or 2 controllers you may not notice any performance loss. But with 3 or 4, you might need to make sure that your final program/game is optimized enough to handle that. Just Info to keep in the back of your mind about.


Quote: "Good job on the plugin! I look forward to playing around with it."


Thanks Plystire!

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th May 2010 03:03
Well, my friend has a wired guitar for the 360. If I find some time within the next week (and I don't space out on it) I may be able to get that tested for you.


The one and only,


Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st May 2010 05:00 Edited at: 21st May 2010 05:03
I bought two more controllers. A Rockband guitar, they have them at Newegg for 12.99, free shipping!, and a new Microsoft Wireless for Windows controller. I had to get the wireless controller to use the Rockband guitar, since that was wireless.
Here are some things I have discovered.
I can only get 3 controllers to work. And it is not Todd's dll, its the computer. And the wireless has to be the first controller connected. If I try to connect the fourth controller, or connect the wireless after two wired controllers are already connected, the wireless fails to work.
I think wireless has to go first because it supports 4 controllers, so it needs to be the first one assigned. And I think I can only get three controllers to work because there is not enough power in the usb to supply all 4.
So, I think the best setup would be the wireless controller, since it is only one connection, and just buy additional wireless devices.

As for the guitar, the rockband one has 10 fret buttons, five up top and five down low.
They map out like this:




Now, for the good news. As I suspected, there is NO FPS drop polling 3 controllers. And I suspect 4 will also be as fast.
There is a reason Microsoft uses this setup. And, I bet that these controllers become very common in PC gaming.

For kicks, I am going to write a test app to see how well three controllers do with the native commands, speedwise.

Next is one of those Drumpad thingees!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 22nd May 2010 05:00
Thanks for testing this out with more controllers Visigoth! Very exciting to hear.

The 4 controller issue sounds weird to me. It's meant to use up to four controllers no matter what. I'm not saying your wrong and mabie that is just the way it is. I'll look over my code again and make sure I didn't code something silly again.

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 22nd May 2010 06:59
Todd,
It is not your dll, like I said.
Its Windows. I can't get 2 wired controllers and the wireless receiver to all work at the same time, as verified in Control Panel/game controllers.
Best I can do is 2 wireless and 1 wired. I'm sure 4 wireless or 3 wireless and 1 wired, will work.
I'm going to try and borrow another wireless controller.
The Viking
15
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 12th Jun 2010 23:19
Hey, just curious, but it seems to run slow, approximately 60 FPS, just running the demo, am I the only one who it is running this slow for?

www.myspace.com/norseblod
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 13th Jun 2010 23:29 Edited at: 13th Jun 2010 23:30
Hi The Viking, just tested my example1 program again and I just can't see any reason why my dll itself would slow it down as it's functions pretty much directly calls the Microsoft's XInput.dll functions.

While the example1 program is running, how high does your fps get if you disconnect your xbox controller from your pc?

On my computer ( specs at the end of my sig ) my fps rate goes around 260 with one controller. Without the controller connected, the example1 program, at 800x600 in windowed mode, goes up to around 900 fps. So that does tell me that XInput.dll does some processing to keep on eye on.

When you run example1, what resolution mode does it go into and does it go into fullscreen or windowed mode? How fast is it for you in fullscreen mode and windowed mode?

The processing comes from polling for data from any connected controllers every frame as the example1 does. I don't know what type of computer you have, if you have a lower end computer that may be a reason for getting 60fps. If so, you could try polling for data from the controllers at every 10 to 20ms for example.

I'll try to think of any other reasons and post them here if I can. I'm sure you have the latest DBPro version, latest DirectX, latest drivers for your computer components... etc.. right?

If anybody else is getting "slow fps" from the example1 program, can you please let me know about that and let me know what computer specs, dbpro and directx versions you have. Also let me know what resolution mode it runs in and if it's in fullscreen or windowed mode. Thanks...

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit

Login to post a reply

Server time is: 2024-03-29 08:14:27
Your offset time is: 2024-03-29 08:14:27