redshock

Hello, I was experimenting the SpaceWar application, but it seems to expect a xbox360 controller instead of a broad PC controller since... well, I'm running it on a PC. Do you know anything about that I should be able to use it. I have a team that wants to use XNA for the PC platform - we could hardly care about the xbox360 at the moment. Forcing our players to have a xbox360 controller when they already have a fully capable controller does not make any sense. Did XNA leave out DirectInput or something I'd hate to drop back into MDX just because of this necessity. If MS has no answer for this, may I suggest that DirectInput should be included in XNA when the program detects its running on a PC Average Joe may not want to play the game if he can't use his chosen controller. Would I just have to include MDX's DirectInput.dll, and how can I assume there will be future support if it's not being updated I need something to work with for a broad set of controllers. Thanks for the thoughts in advanced. I like XNA, but I hope we can work with it.


Re: XNA Game Studio Express SpaceWar with a PC controller?

The ZMan

XNA v1.0 has dropped some functionality due to being compatible with the 360. No DirectSound (XACT only), No DirectInput (XInput only which means 360 controllers only) and no fixed function pipeline (though you get BasicEffect to help with a lot of that).

Yes this is annoying to everyone who has a no XInput controller - you can vote for this feature here:

https://connect.microsoft.com/feedback/ViewFeedback.aspx FeedbackID=192779&SiteID=226 (note you must ALREADY be logged into connect before the link will work!)

This thread, http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=692685, has a post by someone who has written some code to enable other controllers which may work for you.






Re: XNA Game Studio Express SpaceWar with a PC controller?

redshock

Thanks for the thoughts. I'm glad people are already questioning the non-existance of this obvious need.

I don't know how I can work with something that left out something so important as this. I hope Microsoft fixes this quick because we have decisions on tools to make, and we're hoping by far to use XNA for our titles. Taking out DirectInput for PC versions of the game is a big no no... I'll try that code you provided, but I guess this is why I hate portability with other platforms. Too much necessary stuff get taken out. If they detected the game opened on a non-xbox360 machine, it should be fine to enable DirectInput without causing an exception. C++/DirectX is much uglier than XNA, but if it does the job...





Re: XNA Game Studio Express SpaceWar with a PC controller?

Nightmare_BE

No direct input

try this

using Microsoft.Xna.Framework.Input;

KeyboardState state = Keyboard.GetState();
if (state.IsKeyDown(Keys.Space))
   System.Diagnostics.
Debug.WriteLine("Space has been pressed");

 

this works for me, u can use this to replace the xbox controller buttons in the starter kit





Re: XNA Game Studio Express SpaceWar with a PC controller?

Jim Perry

That's not the issue. What he's saying is that support for regular PC gamepads isn't in XNA while it was in DirectInput.




Re: XNA Game Studio Express SpaceWar with a PC controller?

Nightmare_BE

What about the GamePad class din't test it so i don't know if it works, but its there for sure.



Re: XNA Game Studio Express SpaceWar with a PC controller?

Leaf.

While it might be nice to have the support directly provided by Xna, since gamepads other than the Xbox360 one are only available on Windows there's no reason not to use DirectInput. If Xna did have support for other input devices its possible that it would be in a seperate class as there are so many more configurations to support. Ok, so you have to have one extra assembly reference but its not much.

Cheers,
Leaf.





Re: XNA Game Studio Express SpaceWar with a PC controller?

Billr17

No, GamePad represents the 360 controller only. There is no library built into XNA for standard PC GamePads. But Leaf is correct, there is no reason you cannot use the MDX 1.1 assembly to add controller support on the PC. Its not really as big of a deal as some people are making it.




Re: XNA Game Studio Express SpaceWar with a PC controller?

jhered

isn't the whole point of xna to provide cross platform development in a single contained set of libraries And if so, how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers I personally don't care about having to add in directx functionality to get the job done, i'm only developing for pc... but is this cross platform or is it XBOX development... they really need to decide and then provide.





Re: XNA Game Studio Express SpaceWar with a PC controller?

Jon Watte

how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers

They do support their own controllers on PC. You can buy any Xbox 360 compatible wired controller, and plug it into a PC. Microsoft has decided that that's the future for controllers, and that users will have to get one of those, rather than keep around whatever controllers were there before. It's a $29 expense, which is about half of what you'll pay for a new game, so it's not a totally bizarre position to take. The benefit is that all controllers in the XInput world adhere to the same ergonomics, layout, and capabilities, so games can become more consistent.






Re: XNA Game Studio Express SpaceWar with a PC controller?

mpipe again

jhered wrote:

isn't the whole point of xna to provide cross platform development in a single contained set of libraries And if so, how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers I personally don't care about having to add in directx functionality to get the job done, i'm only developing for pc... but is this cross platform or is it XBOX development... they really need to decide and then provide.



Honestly, I don't know anyone who uses PC game controllers. Everyone just uses the keyboard and mouse.





Re: XNA Game Studio Express SpaceWar with a PC controller?

MarijnStevens

But somebody...

Like they have a lot to do I would like to say to add this to an TODO list, and first try to fix important problems ( sound / sharing ).




Re: XNA Game Studio Express SpaceWar with a PC controller?

ryan.rogers

The fact that the GamePad class does not abstract any game pad is a Good Thing (TM) IMO. The last thing I want to see is diluted support of the 360 pad (on either platform) in order to provide generic gamepad support for the PC only. I would *much* rather see the same exact code on the PC and 360 provide the same gameplay feel using the 360 controller on both platforms. This is the approach the api designers have taken and it's smart IMO.

If you need support for a gamepad on the PC other than the 360 gamepad, then use the Managed DX libs, or write to DirectInput yourself (it's really not that hard). This is exactly what I plan to do, but right now it's not very high on the totem pole as I have a 360 PC controller I'm very happy with. ;-)

I like the approach MS is taking with this framework. This is a great example of where the community can really help each other out. Somebody somewhere will eventually publish a high level gamepad class which encapsulates the 360 gamepad and uses that when detected, and when not it will use DirectInput or MDX on the PC. You can argue that MS should have done this to begin with, and maybe they will in vN. But since this is NOT rocket science to do, and IS implementable by the community, I would much rather see them working on other features like access to networking on the 360. ;-)

- Ryan





Re: XNA Game Studio Express SpaceWar with a PC controller?

Angelpulse

Jon Watte wrote:
how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers


They do support their own controllers on PC. You can buy any Xbox 360 compatible wired controller, and plug it into a PC. Microsoft has decided that that's the future for controllers, and that users will have to get one of those, rather than keep around whatever controllers were there before. It's a $29 expense, which is about half of what you'll pay for a new game, so it's not a totally bizarre position to take. The benefit is that all controllers in the XInput world adhere to the same ergonomics, layout, and capabilities, so games can become more consistent.

I understand the logic behind this and in the long run this will be a good thing, all PC users having Xbox 360 controllers would make life easier for everyone.

The problem is that this trend hasn't been set yet. How many commercial PC games have been released with support only for Xbox 360 gamepads

XNA by itself will not set this trend and therefor at present this just puts those using XNA to develop at a disadvantage.