Jump to content
  • Advertisement

MrPlosion1243

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

142 Neutral

About MrPlosion1243

  • Rank
    Newbie
  1. MrPlosion1243

    Multiple Controllers with DirectInput

    Okay I've figured it out!! It's funny that I'm answering my own thread and I probably look like an idiot but oh well. I just simply used the InstanceGuid instead of the ProductGuid. This is because the ProductGuid is set by the manufacturer so both controllers had the same guid and I guess it didn't know which one to use so it just used the first one out of the two.
  2. MrPlosion1243

    Multiple Controllers with DirectInput

    The game is actually running in XNA and no I can't use it's Input libraries because it only works with the XBox 360 controller and not some PlayStation adapter.
  3. MrPlosion1243

    Multiple Controllers with DirectInput

    No but I suppose I'll have to use it if it can support game pads.
  4. MrPlosion1243

    Multiple Controllers with DirectInput

    Yeah, I realize that indexes start at 0. I just had it set at 1 to kinda show off that even at 1 it still gets the first port instead of the expected 2nd port. So yes setting the index to 0 will get the first port but so will setting it to 1 which is the whole point of this thread. Another thing worth noting that I forgot to say is that when I go into the Control Panel>>Hardware and Sound>>Game Controllers (on vista) I receive the same kinda thing. A list with two controllers like so and I can access both controllers perfectly with each port working fine. So I don't think it has to do with the adapter. I just don't know.
  5. So I was going through my old stuff and found two PlayStation controllers. I thought It would be cool to use them in the game I'm developing as a self thing, I know other people don't have old PlayStation controllers but I do. So I bought a PlayStation to USB adapter and plugged it all in. I'm using SlimDX's wrapper for DirectInput but only one port seems to work out of two that you can see from the image. It's really strange because DirectInput.GetDevices() returns a list of the available game pad devices and in that list is two devices which is exactly what I would expect. When I index the first device in the list sure enough I get the first port. However when I index the second device in the list I get the first port again. I don't know if this is a manufacturing problem or if it's with SlimDX. I do know it's not a problem with the controllers as they both work fine when plugged into the PlayStation. So how come I always get the first port regardless of which object I pick from the DirectInput.GetDevices() list? I am completely stumped on why this would be happening and was hoping I could get some feed back on this issue. Code: int index = 1; //for some reason it always gets the first port. DirectInput directInput = new DirectInput(); Guid controller = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AllDevices)[index].ProductGuid; gamePad = new Joystick(directInput, controller); gamePad.SetCooperativeLevel(gameRef.Window.Handle, CooperativeLevel.Nonexclusive | CooperativeLevel.Background); gamePad.Properties.AxisMode = DeviceAxisMode.Absolute; gamePad.Properties.SetRange(-5000, 5000); gamePad.Acquire(); EDIT: The game runs in XNA and here's the download to it if you're interested of course you'll need the same adapter though. http://www.fileswap.com/dl/AaP3FWolEk/
  6. MrPlosion1243

    How to Structure a Tile Based Game?

    Ok thank you so much! I understand now.
  7. MrPlosion1243

    How to Structure a Tile Based Game?

    Thank you I will consider what you've said. I think I was just over thinking the whole thing and this seems a lot simpler than what I was doing. Quick question though for really complex tiles like water or lava should they be their own class/struct maybe called "Liquid" or whatever?
  8. I would consider myself a beginner programmer so I need help on how I should structure my tile based game. The game is a 2D Minecraft or Terraria type clone I'm developing for learning purposes. I'm more concerned about how I'm going to make each tile. Should I have base class called "Tile" then have tiles like dirt, stone, wood derive from it? Then I could have a 2D array of "Tile" to be the world. A problem I see with that is there would be a lot of instances of the same type, I'm talking thousands because the worlds are going to be huge. Or should I just have one class called "World" and inside that have a 2D byte array where each byte represents a different tile. A problem with this however is I'll need to loop through each byte every time I wan't to do something like say check if the tile is collidable or not. Could I receive some help on this? Thanks.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!