Maximum # USB Gamepads/Detecting If Plugged In

Blitz3D Forums/Blitz3D Programming/Maximum # USB Gamepads/Detecting If Plugged In

Matty(Posted 2005) [#1]
Hi,

With powered 'daisy chained' USB Hubs it is possible to have supposedly about 127 USB devices connected to a PC. Could Blitz3d handle this, does it have an upper limit to the number of USB Gamepads that can be connected at any one time?

Also, is there a way to detect when a USB Gamepad has been plugged in/removed from the PC in Blitz3d. EDIT: Just saw the 'JoyType' command in the manual.

Reason for asking is that I'm thinking of making a 'tavern fight/bar room brawl' mini game where people can just hook up a USB gamepad and join in at any time.


IPete2(Posted 2005) [#2]
Matty,

I don't know the answers to the questions you ask, but there are a couple of routines hanging around which handle joysticks, one of which (Pepsi wrote it for Force feedback - which would be really cool in a brawling game) had the joystick number subroutine built in = so you could check that out.

Sounds like a great idea (if you have a usb joypad to hand).

I think the biggest problem would be having 127 animated b3d models with collision detection myself.


Good luck with it.

IPete2.

PS I have Pepsi's dll somewhere if you wanna take a look at it and cant find it - e-mail me.


Oddball(Posted 2005) [#3]
How many joypads are you looking to have hooked up? I've had six working no problem in my game Squelch! just using the standard Blitz commands. Check it out for yourself. Doubt you'll get much more than six people round a pc anyway.


Matty(Posted 2005) [#4]
IPete2 - I found the dll for force feed back in the Toolbox, thanks for letting me know about that one. The game will most likely be 2d, using blitz3d though not blitzplus or blitzbasic, so there should be no problem with lots of players running around at once.

Oddball - you're right about only fitting 6 people around a pc easily but on a projector it could easily be more than that I'm sure.


IPete2(Posted 2005) [#5]
Matty,

no problems, I'm glad you found it. I use it quite a bit for anything which requires force feedback and joypads.

I use a Logitech Wingman cordless joypad - which is usb but I guess you couldn't have 128 pads on the same frequency! Lol!

I also use Logitech PS2/USB ForceFeedback steering wheel and pedals it works really well with the PC (with the correct drivers from the Logitech website) - thats ace for B3d stuff with the Pepsi DLL.

IPete2.


BlitzSupport(Posted 2005) [#6]
I think there may be a limit of joypads in Windows itself -- this command for obtaining joypad information says you can return details for joypads with IDs from 0 to 15:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_joygetdevcaps.asp

This Windows 95-era DirectInput article states that it only supports 16 joypads. May possibly have changed since then, but I can't find any other references to this:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnargame/html/msdn_sidewind.asp