• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Indie Game Development Discussion Thread | Of Being Professionally Poor

Status
Not open for further replies.

cbox

Member
Sorry GIF Warning!

Slowed down some 60fps footage to see the cool animations. We finally nailed the particles I think :)

Hekg4.gif


And the Purge enemy

7RoSVW.gif


And the reaction to your ship. We decided for him not to do any damage, but to push you out of the way.

ENKu.gif
 

Paz

Member
Once I started making games I ran out of time to play them ;p

Too true, too true :(

We added a 6th character to Cactus over the last major early access update, we're super proud of how she changes the game and wanted to make a new trailer to showcase that :D

aubergine_oxygen.gif

http://youtu.be/yLETZbpAWqA

And we're part of our first ever steam sale.... Interesting experience actually, despite having zero promotion (not on any featured areas of Steam or mentioned by any sites) sales jumped up a bit, 25% off and people trawling through games has meant a lot more eyes on it maybe? Really need to finish this game heh.
 

pixelpai

Neo Member
Sorry GIF Warning!

Slowed down some 60fps footage to see the cool animations. We finally nailed the particles I think :)

Hekg4.gif


And the Purge enemy

7RoSVW.gif


And the reaction to your ship. We decided for him not to do any damage, but to push you out of the way.

ENKu.gif

Man, this looks really great. I love those particle effects. Is each individual particle physics-based or are you using "normal" emitters?

As for my game: I updated the editor to support levels of different sizes. Although the size is arbitrary as long as its a power of four, I had to limit the supported sizes to 8x8, 12x12, 16x16, 20x20 due to the available screen space.

Here is a new screenshot. For those following this game, there might not be much new, but it shows a 8x8 level in full action:

psy_28112013_2.png


Please follow: Pixelplant Studios
 

rottame

Member
I have lost the ability to tell if my game is fun. What's "fun"? I don't get it.

This. I just have no clue if the game I'm making is fun. I just saw it/played it too much.

Having said that, I think it's important to play games if you are a game developer. I think it helps you staying current and keeping the passion alive. You know when you read some interview to a musician and they say "I don't listen to new music, really"? That is usually the sign that guy doesn't have much to say anymore.
 

missile

Member
As crazy as you are, missile, you might as well write a virtual keyboard driver and/or a filter driver for added fun. :p I wrote a filter driver to take gamepad input in certain cases and generate keypresses from the virtual keyboard, for example.

But doing that sort of thing always makes me scared that I'm going to get VAC banned or something because the same technology could almost certainly be used to cheat/keylog/do all kinds of stuff.
That's cool, indeed. Especially when you combine scancodes together and send
them to your own or another program simulating multiple keys in sequence.


Yes.

See the MSDN info here

Using the (deprecated) Direct Input calls is your best option. Obtain a Keyboard device, use SetDataFormat to prepare it for data retrieval, then call its
GetDeviceState method. This fills in the instantaneous state of all keys on the keyboard, indexed by scan codes, not virtual key codes. The number of simultaneous keys detected is dependent on your keyboard hardware.

Note that using this function makes many antivirus programs flip out, since this is the easiest way to implement a keylogger.
Never used Direct{Input, 3D, Sound, ...} before. Glad those times have passed
on me without a scratch. Yet I've implemented what you said, i.e.

Code:
DirectInput8Create(hInst, 
                   DIRECTINPUT_VERSION, 
                   IID_IDirectInput8,
                   (void **) &pDI, 
                   0);
                   
pDI->CreateDevice(GUID_SysKeyboard, &pKB, 0);
pKB->SetDataFormat(&c_dfDIKeyboard);
pKB->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);

void KB_Poll(void)
{
  pKB->GetDeviceState(256, (void **) &KB_state);
    
  // for example
  if((KB_state[DIK_PAUSE] & 0x80) != 0)
    printf("0x%x\n", KB_state[DIK_PAUSE]);
}

Which works, but doesn't solve the problem! Seems like DirectInput is just
another mapper who maps the hardware to a virtual state by-passing the WinAPI,
i.e. it reads the hardware and decodes the information 'as needed'. But not
like I need it. Getting the state of all keys is fine, but it won't tell me
the scancode of the key pressed. The scancode here is already set by
Microsoft, i.e. DIK_{...}, a set of 256 bytes with each key given just a
scancode of one byte. However, keys do not generate just only one scancode
byte, it can be a sequence of bytes. And these bytes are what I want to have.
For example; pressing the key [PAUSE] the byte sequence (e1, 1d, 45) is
generated (assuming the keyboard controller outputs scancodes in mode/set 1,
which is usually the default setting). Yet in Windows you would get just the
byte (45) plus a structure telling you that the key was pressed "(E1)". But
the byte (1d) is missing. Many keys have multiple byte sequences, esp. special
functions keys, and the keyboard is also able to generated special byte
sequences for hotkeys or dead-keys. The problem with the standard Windows API
is that all this stuff is mixed up in some ways. So differentiating all the
keys (including special function keys or keys unique to a given keyboard),
their states, etc. becomes rather difficult and next to impossible for some
situations. Anyhow, I learned something from your hint nevertheless!


I'm going to disagree with Mikado. Noone should be using DirectInput in 2013. It's been deprecated for about a decade.

Raw Input is the best way to go.

Every Windows API for getting keyboard input is broken in it's own special unique way however, so expect some frustration.
Uhhhhh ... I love Raw Input! :D

Have implemented it and it works, i.e.

Code:
RAWINPUT KB_ri;
KB_ri.usUsagePage = 1;
KB_ri.usUsage = 6;
KB_ri.dwFlags = 0; // RIDEV_NOLEGACY (disables WM_KEY{DOWN,UP} messages)
KB_ri.hwndTarget = hWnd;
RegisterRawInputDevices(&KB_ri, 1, sizeof(KB_ri));  // just one device

... 

case WM_INPUT :

  GetRawInputData((HRAWINPUT) msg->lParam,
                  RID_INPUT,
                  &rawinp,
                  pcbSize,
                  sizeof(RAWINPUTHEADER));	

  if(rawinp.header.dwType == RIM_TYPEKEYBOARD)
  {
    // RI_KEY_BREAK 1 The key is up.
    // RI_KEY_E0    2 
    // RI_KEY_E1    4 
    // RI_KEY_MAKE  0 The key is down.

    printf("----------\n");
    printf("make: 0x%x\n", rawinp.data.keyboard.MakeCode);
    printf("flags: 0x%x\n", rawinp.data.keyboard.Flags);
    printf("vkey: 0x%x\n", rawinp.data.keyboard.VKey);
  }		
  
  return 0;
break;

...

That's it. So easy. And it generates the right sequence for the key [PAUSE]
(e1, 1d, 45), i.e.

----------
make: 0x1d
Flags: 0x4 // = e1 -> special key
vkey: 0x13
----------
make: 0x45 // + 45
flags: 0x0 // pressed => key [(e1, 1d, 45)] pressed
vkey: 0xff
----------
make: 0x1d // ...
Flags: 0x5 // = e1 + release
vkey: 0x13
----------
make: 0x45 // + 45
flags: 0x1 // key released => key [(e1, 1d, 45)] released
vkey: 0xff

This looks a bit cumbersome, since the sequence isn't delivered straight -
for a reason. What's cool about Raw Input is that you can read the data in
immediate or buffered mode. What you can see above is immediate mode were the
bytes are read one after another, so one has to go through the loop multiple
times to get all the bytes. So two iterations to get the three values in this
case. Only two? The first byte, i.e. (e1) is delivered implicitly. This is
because Microsoft has defined two special HID devices, i.e. the keyboard and
the mouse. If the data package comes from a keyboard, i.e. dwType ==
RIM_TYPEKEYBOARD, a special structure is filled with data, i.e. rawinp.data.
keyboard. This is to say that Raw Input fills data.keyboard explicitly with
the (e1) byte being implicitly cast into the flags, i.e. into data.keyboard.
Flags. This is possible because it is assumed that we know something about a
keyboard (and mouse). All other devices don't have a predefined pattern.

However, there is buffered mode. So instead of reading byte after byte while
going through the loop multiple times, one can use GetRawInputBuffer instead
of GetRawInputData to transmit whatever the HID device has to say (untouched,
hopefully) in one go. This should also work for the keyboard and mouse, which
should deliver the sequence of bytes straight.

As one can see, Raw Input makes it pretty easy to obtain the raw data. And it
is pretty easy to set up.

@Popstar: Cool hint, mate. Well, I plugged the DS3 controller into the
computer and it got recognize as an HID device. Cool. So instead of using any
lib to control the DS3 I'm hoping to be able to address the controller
directly, which would be way cool. Haven't gone any further at the moment, but
does someone already figured out the protocol to make sense of the bytes sent
by the controller, if this is even possible using Raw Input (it should be)?
 

FuuRe

Member
Any tips besides the coding part suggested in this thread that can help during development?

Even Excel is an acceptable answer, i'd like to know what things devs use to support themselves while coding/designing
 
Making some good progress and got a new model in :)

Bit of a zoom in on my new refinery model

1.gif


Reusing my battleship model but these act like a squad of smaller fighters. Also shows off some asteroids which will be no move zones

2.gif


Last but not least , showing off some of the ai (red team) and a bit of resource collection and movement

3.gif
 

Popstar

Member
@Popstar: Cool hint, mate. Well, I plugged the DS3 controller into the
computer and it got recognize as an HID device. Cool. So instead of using any
lib to control the DS3 I'm hoping to be able to address the controller
directly, which would be way cool. Haven't gone any further at the moment, but
does someone already figured out the protocol to make sense of the bytes sent
by the controller, if this is even possible using Raw Input (it should be)?

You can use Raw Input for gamepads too. As long as they're USB HID compliant.

Setting up is easy. You do it the same way as the keyboard
Code:
	// joystick (page 1, usage 4)
	rawdevice[n].usUsagePage	= 0x01;
	rawdevice[n].usUsage		= 0x04;
	rawdevice[n].hwndTarget		= hwnd;
	rawdevice[n].dwFlags		= RIDEV_DEVNOTIFY;	// DEVNOTIFY flag only works on Vista or better
	++n;
	// gamepad (page 1, usage 5)
	rawdevice[n].usUsagePage	= 0x01;
	rawdevice[n].usUsage		= 0x05;
	rawdevice[n].hwndTarget		= hwnd;
	rawdevice[n].dwFlags		= RIDEV_DEVNOTIFY;	// DEVNOTIFY flag only works on Vista or better
	++n;

	RegisterRawInputDevices( rawdevice, n, sizeof(RAWINPUTDEVICE) );

And then you parse the data from the WM_INPUT message

Code:
	else if( raw->header.dwType == RIM_TYPEHID  )
	{
		// Parse the Raw Input
		PHIDP_PREPARSED_DATA ppd;

		GetRawInputDeviceInfo( raw->header.hDevice, RIDI_PREPARSEDDATA, NULL, &dwSize );
		ppd = (PHIDP_PREPARSED_DATA)_malloca( dwSize );
		GetRawInputDeviceInfo( raw->header.hDevice, RIDI_PREPARSEDDATA, ppd, &dwSize );
		
		// Get the gamepad's capabilities
		HIDP_CAPS caps;
		HidP_GetCaps( ppd, &caps );

		// Button caps
		PHIDP_BUTTON_CAPS buttoncaps = (PHIDP_BUTTON_CAPS)_malloca( sizeof(HIDP_BUTTON_CAPS) * caps.NumberInputButtonCaps );

		USHORT buttonCapsLength;
		HidP_GetButtonCaps( HidP_Input, buttoncaps, &buttonCapsLength, ppd );
		//plInfof( "Number of buttons: %d\n", buttoncaps[0].Range.UsageMax - buttoncaps[0].Range.UsageMin + 1 );

The DS3 however isn't quite HID compliant. It requires a special message (HID report) to be sent to it before it will start to send data. OS X / Linux recognize the DS3 and initialize it properly, but Windows does not.
 

Popstar

Member
Any tips besides the coding part suggested in this thread that can help during development?

Even Excel is an acceptable answer, i'd like to know what things devs use to support themselves while coding/designing
Our designer loves excel. I think he might marry it. He's also started using evernote and seems to like it.

I started using Trello a couple weeks ago and really like it. A few other people have mentioned it in this thread also.
 
So I'm thinking I'd like to try making a really basic top-down shooter over my Christmas break in the upcoming weeks just for fun and to get back into programming a little bit, as well as have something to do with my free time. I was thinking that since Unity just released their 2D stuff that I could try that out, but I also just got Game Maker Standard edition so I'm wondering which engine you guys would use for a project like this? I'm assuming that either could work for this type of game but I'm not sure which would be better suited for a simple project like this.

Any recommendations? I'm open to working with other free engines too.
 

Blizzard

Banned
Making some good progress and got a new model in :)

Bit of a zoom in on my new refinery model

1.gif


Reusing my battleship model but these act like a squad of smaller fighters. Also shows off some asteroids which will be no move zones

2.gif


Last but not least , showing off some of the ai (red team) and a bit of resource collection and movement

3.gif
You may need to move those images to a publicly shared directory, because they are not showing up right now.
 

PhiLonius

Member
So I'm thinking I'd like to try making a really basic top-down shooter over my Christmas break in the upcoming weeks just for fun and to get back into programming a little bit, as well as have something to do with my free time. I was thinking that since Unity just released their 2D stuff that I could try that out, but I also just got Game Maker Standard edition so I'm wondering which engine you guys would use for a project like this? I'm assuming that either could work for this type of game but I'm not sure which would be better suited for a simple project like this.

Any recommendations? I'm open to working with other free engines too.

I'd say if you want to get something up and running quickly, roll with GM.
 

missile

Member
@ConvenientBox: FX sounds?


... The DS3 however isn't quite HID compliant. It requires a special message (HID report) to be sent to it before it will start to send data. OS X / Linux recognize the DS3 and initialize it properly, but Windows does not.
Have it working under Linux as well. Yet the Windows port needs a little more
work, I guess (like always).

Edit:
What's the 'best' programmable interface under Windows for using the DS3?

Edit2: Build one yourself, missile! xD The situation seem quite divers on
the market, yet I think how to do it; USB minidriver scanning the data from
the controller + building an UID compliant (gamepad) structure to register the
DS3 within Windows.
 

missile

Member
Any game developer here already holding a DS4 in his hands? If so, can you
check whether the controller is recognized as a HID compliant device while
putting it into a PC? Look at Device Manager (on Windows) / Input Devices
while plugging the controller in. Thx!
 
I'm working on the graphics side of my 2d isometric-ish rpg and currently looking at spell effects and visuals. I've been reading about particle systems and from a programming perspective the basics seem quite straight-forward.

I'm still a bit in the dark about the practical process of creating a particle effect though, that is defining the emitters and particle parameters that create something that actually looks like an explosion as opposed to say just an expanding circle of quadrangles. Are there any generic tools to help with this or is it usually just stuff specific to the engine you're using?

I'm particularly confused about how you create a "ray" like spell effect, as opposed to something like an explosion. For example something like a lightning bolt or this kind of thing:

 

Five

Banned
Any game developer here already holding a DS4 in his hands? If so, can you
check whether the controller is recognized as a HID compliant device while
putting it into a PC? Look at Device Manager (on Windows) / Input Devices
while plugging the controller in. Thx!
I won't be home for about five hours, so I can't double check, but I think the answer is yes. I've been able use my DS4 just by plugging it in and checking DirectInput. xInput does not work as of yet. But I can double check when I get home.
 

razu

Member
Any game developer here already holding a DS4 in his hands? If so, can you
check whether the controller is recognized as a HID compliant device while
putting it into a PC? Look at Device Manager (on Windows) / Input Devices
while plugging the controller in. Thx!

Yep, it appeared as HID-compliant game controller. And my keyboard stopped working!

I don't actually have a PS4, that's still to be delivered, but I have CoD, BF4, and a controller! :D

Still, I'm busy making my new game, and playing Zelda on 3DS. Don't need the distraction!! :D
 

razu

Member
I'm working on the graphics side of my 2d isometric-ish rpg and currently looking at spell effects and visuals. I've been reading about particle systems and from a programming perspective the basics seem quite straight-forward.

I'm still a bit in the dark about the practical process of creating a particle effect though, that is defining the emitters and particle parameters that create something that actually looks like an explosion as opposed to say just an expanding circle of quadrangles. Are there any generic tools to help with this or is it usually just stuff specific to the engine you're using?

I'm particularly confused about how you create a "ray" like spell effect, as opposed to something like an explosion. For example something like a lightning bolt or this kind of thing:

The ray part is a camera facing quad with scrolling UVs. The texture fades out towards the edges so you don't see the hard edge. The texture is probably really long and repeating, so it can be scrolled super fast to look like an energy beam. Then there are particles moving all over it to make it looks less obvious.

Good luck! :D


Edit: By 'repeating', I mean tileable, and the addressing set to wrap rather than clamp. Not that the texture repeats within itself, that would be mad!
 

missile

Member
I won't be home for about five hours, so I can't double check, but I think the answer is yes. I've been able use my DS4 just by plugging it in and checking DirectInput. xInput does not work as of yet. But I can double check when I get home.

Yep, it appeared as HID-compliant game controller. And my keyboard stopped working!

I don't actually have a PS4, that's still to be delivered, but I have CoD, BF4, and a controller! :D

Still, I'm busy making my new game, and playing Zelda on 3DS. Don't need the distraction!! :D


If you have run an DS3 on your system it may happen that the DS4 may
sneak under an existing driver as a non-HID compliant DS3 controller (being
perhaps compatible to a DS3) managed by some old installed DS3 driver leading
to a false positive. Just a thought. Anyhow. Within Input Devices there should
light up a new entry uniquely identifying the DS4 controller without any need
to install a new driver (for faking it to be compliant) or something, since a
compliant DS4 controller would sent the HID information itself with Windows'
HIDCLASS building a unique PDO for each Top Level Collection delivered by the
DS4s Report Descriptor.
 

razu

Member
If you have run an DS3 on your system it may happen that the DS4 may
sneak under an existing driver as a non-HID compliant DS3 controller (being
perhaps compatible to a DS3) managed by some old installed DS3 driver leading
to a false positive. Just a thought. Anyhow. Within Input Devices there should
light up a new entry uniquely identifying the DS4 controller without any need
to install a new driver (for faking it to be compliant) or something, since a
compliant DS4 controller would sent the HID information itself with Windows'
HIDCLASS building a unique PDO for each Top Level Collection delivered by the
DS4s Report Descriptor.

Uh... I plugged it in. It installed. I went to the controller properties panel and the buttons, sticks, d-pad and triggers all worked. Then I looked in the panel you said about and a new item with HID-compliant in its title appeared when I plugged it in.

The new clicky pad is detected as a button, so that should differentiate it from a DS3.
 
The ray part is a camera facing quad with scrolling UVs. The texture fades out towards the edges so you don't see the hard edge. The texture is probably really long and repeating, so it can be scrolled super fast to look like an energy beam. Then there are particles moving all over it to make it looks less obvious.

Good luck! :D


Edit: By 'repeating', I mean tileable, and the addressing set to wrap rather than clamp. Not that the texture repeats within itself, that would be mad!

Oh that's neat, I hadn't considered that. I'll give it a go some time thanks!
 

Five

Banned
@missile
I just checked in Device Manager, and it's registered as "HID-compliant game controller". In Control Panel, under "Setup USB Game Controllers" it's listed as "Wireless Game Controller" even though it's plugged in via USB. The button map is:
1:square
2:X
3:O
4:triangle
5:L1
6:R1
7:L2
8:R2
9:Share
10:Options
11:L3
12:R3
13:pS
14:Touchpad
PoVHat:D-Pad
XY-axis:L-stick
Z-axis/rotation:R-stick
X-rotation:L-trigger
Y-rotation:R-trigger
 

Jobbs

Banned
Toying around with death animations and gibs. Thanksgiving gibs.

This is just a test environment and stuff etc. Nevermind the environment.

zkill.gif


There's going to be blood and sparks and stuff too. Just looking at gibs right now.
 

Five

Banned
Toying around with death animations and gibs. Thanksgiving gibs.

This is just a test environment and stuff etc. Nevermind the environment.

[/img]http://www.ghostsonggame.com/miscd/zkill.gif[/img]

There's going to be blood and sparks and stuff too. Just looking at gibs right now.

Overall, this looks pretty darn good! The two things that stand out to me are the flying head and one of the hit effects. Maybe it's just the fps of the gif capture, but the head looks a little too floaty, and the way its sways on the ground after landing seems to contradict the perceived center of gravity. For the hit effect, I think it would be best to have part of it in front of the monster and part of it behind, so it looks like it's passing through. Right now it looks like it's grazing the side at best. Alternately, you could have the hit effect explode backward instead of forward.
 

Ashodin

Member
Toying around with death animations and gibs. Thanksgiving gibs.

This is just a test environment and stuff etc. Nevermind the environment.

zkill.gif


There's going to be blood and sparks and stuff too. Just looking at gibs right now.

Lol at his head rocking. Not sure if it should be rocking or just stationary. I feel like it should be rolling farther than it lands too.
 

Jobbs

Banned
the head is humorous, that's why it's in the gif. there's some unpredictabiltiy with the physics stuff and im still working on it. :D
 

GulAtiCa

Member
Man, I've been working on balancing my tower defense type game this past few days. Mainly working on the "Helper" bot type. (for lack of better word, it's a defense type that both temporarily freezes the enemy and slows them down). It's ridiculous how overpowered it is. Even reducing it's use and upping the cost to buy and upgrade it it's still overpowered. Just funny how much I need to knock it down to balance the game.
 
Toying around with death animations and gibs. Thanksgiving gibs.

This is just a test environment and stuff etc. Nevermind the environment.

zkill.gif


There's going to be blood and sparks and stuff too. Just looking at gibs right now.

Loving this stuff, glad I backed it. :D

If someone really applied themselves, do you think they'd be able to reach that level of quality in a year or two?
 

Jobbs

Banned
Loving this stuff, glad I backed it. :D

If someone really applied themselves, do you think they'd be able to reach that level of quality in a year or two?

Thank you. :)

It's really hard to say. I never felt like I had any natural ability or talent, I accomplish things through willpower. I have a result in mind and I keep hammering away until I see it.

If you have the inclination and drive, then yeah, I suppose so.
 

missile

Member
Uh... I plugged it in. It installed. I went to the controller properties panel and the buttons, sticks, d-pad and triggers all worked. Then I looked in the panel you said about and a new item with HID-compliant in its title appeared when I plugged it in.

The new clicky pad is detected as a button, so that should differentiate it from a DS3.

@missile
I just checked in Device Manager, and it's registered as "HID-compliant game controller". In Control Panel, under "Setup USB Game Controllers" it's listed as "Wireless Game Controller" even though it's plugged in via USB. The button map is:
1:square
2:X
3:O
4:triangle
5:L1
6:R1
7:L2
8:R2
9:Share
10:Options
11:L3
12:R3
13:pS
14:Touchpad
PoVHat:D-Pad
XY-axis:L-stick
Z-axis/rotation:R-stick
X-rotation:L-trigger
Y-rotation:R-trigger

Sounds good. Thx a lot!



Once I started making games I ran out of time to play them ;p
Same over here. I miss the time spending hours into a game mastering it to its
fullest. The days doing so are over for me for a long time to come. The last
two games I mastered to their fullest were Meta Gear Online and WipEout HD.
I've spent around 1100h into MGO and about 1300h into WipEout HD. True
dedication, esp. WipEout with its mature community behind is a such a unique
experience. That's where I belong to, that's where all my (programming) skills
will culminate one day.
 

Rimshot

Member
Now that Unity 4.3 is out, with the 2D support, are you all in this thread prefering it over other environments like construct and stencyl for prototyping and developing?
 

Five

Banned
I spent this weekend making a procedural system for plotting out maps in my game. It's not finished, and doesn't yet convert map data to level geometry, but it's a start! I've got it animated right now for entertainment and debugging reasons, but I'll probably not do that in the final game for time reasons.

mapProcedure.gif
 

pixlexic

Banned
You can use Raw Input for gamepads too. As long as they're USB HID compliant.

Setting up is easy. You do it the same way as the keyboard
Code:
	// joystick (page 1, usage 4)
	rawdevice[n].usUsagePage	= 0x01;
	rawdevice[n].usUsage		= 0x04;
	rawdevice[n].hwndTarget		= hwnd;
	rawdevice[n].dwFlags		= RIDEV_DEVNOTIFY;	// DEVNOTIFY flag only works on Vista or better
	++n;
	// gamepad (page 1, usage 5)
	rawdevice[n].usUsagePage	= 0x01;
	rawdevice[n].usUsage		= 0x05;
	rawdevice[n].hwndTarget		= hwnd;
	rawdevice[n].dwFlags		= RIDEV_DEVNOTIFY;	// DEVNOTIFY flag only works on Vista or better
	++n;

	RegisterRawInputDevices( rawdevice, n, sizeof(RAWINPUTDEVICE) );

And then you parse the data from the WM_INPUT message

Code:
	else if( raw->header.dwType == RIM_TYPEHID  )
	{
		// Parse the Raw Input
		PHIDP_PREPARSED_DATA ppd;

		GetRawInputDeviceInfo( raw->header.hDevice, RIDI_PREPARSEDDATA, NULL, &dwSize );
		ppd = (PHIDP_PREPARSED_DATA)_malloca( dwSize );
		GetRawInputDeviceInfo( raw->header.hDevice, RIDI_PREPARSEDDATA, ppd, &dwSize );
		
		// Get the gamepad's capabilities
		HIDP_CAPS caps;
		HidP_GetCaps( ppd, &caps );

		// Button caps
		PHIDP_BUTTON_CAPS buttoncaps = (PHIDP_BUTTON_CAPS)_malloca( sizeof(HIDP_BUTTON_CAPS) * caps.NumberInputButtonCaps );

		USHORT buttonCapsLength;
		HidP_GetButtonCaps( HidP_Input, buttoncaps, &buttonCapsLength, ppd );
		//plInfof( "Number of buttons: %d\n", buttoncaps[0].Range.UsageMax - buttoncaps[0].Range.UsageMin + 1 );

The DS3 however isn't quite HID compliant. It requires a special message (HID report) to be sent to it before it will start to send data. OS X / Linux recognize the DS3 and initialize it properly, but Windows does not.

i did this to map Dragon age to a 360 controller back in the day.
 
Status
Not open for further replies.
Top Bottom