A Beginner’s Guide to Joysticks and Fightsticks

I’ve been playing a lot of fighting games and Street Fighter IV recently, and while I’m looking to up my game through practice, I still want to have the right tools for the job – and this means having a good fightstick. I currently have a Mad Catz Tournament Edition (TE) for the Xbox 360 which uses a Sanwa joystick and buttons – and frankly it’s excellent.

However, I’ve been trying to take my new-found fightin’ chops back to some older games like the Street Fighter Alpha series, SNK Vs. Capcom etc, and for that I have an X-Arcade (XA) dual-stick with a PS1/PS2/DC/Gamecube/Wii adapter. While the X-Arcade stick is okay for fighting games, it’s absolutely nowhere near as good as the TE, and quite frankly I perform pretty poorly with it – missing simple shory’s, ‘doukens and supers all over the place.

A MadKatz Tournament Edition fightstick

An X-Arcade Dual Stick joystick

I know I can do these moves consistently on the TE, but I live in a world of fail on the XA i.e. if I flub an ultra on the TE I’m disappointed, but I’m barely able to even make an ultra on the XA. So what’s going on?

Continue reading A Beginner’s Guide to Joysticks and Fightsticks

The Leap motion input device looks incredible

The Leap is a new 3D input motion controller in a similar vein to the Kinect, but with apparently about 200x the resolution – how amazing is that?

To quote the Leap people:

Leap represents an entirely new way to interact with your computers. It’s more accurate than a mouse, as reliable as a keyboard and more sensitive than a touchscreen. For the first time, you can control a computer in three dimensions with your natural hand and finger movements.

I’ve applied for a free dev-kit, so fingers-crossed! Worst case though, the sensor’s only meant to be around the $70 mark when they come out.

Would so love to work with this tech for my Ph.D research… looks like it solves a lot of problems right off the bat. Awesome!

How-To: Get valid integer input in C++ (a stupidly long solution to a stupidly simple problem)

Update: See the comments for a far, far more elegent and robust solution courtesy of the mighty shetboy!


One of the assessments I’ve got my diploma class doing at the moment is to fix all the bugs in some deliberately shonky C++ code. The code just asks for a name (string) and an age in years (int), and it then multiplies the age in years by 365 to give a rough indication of how many days you’ve been alive. So for example if I enter Al and 34 it comes back with:

Hi, Al! You’ve been alive for roughly 12410 days!

The problems come thick and fast though if you want to verify that the age in years entered is really an integer value. You CAN do so like this:

But you then end up with output like this where each character fails individually:

Obviously that’s no good, so I researched a bit and came up with a solution but –DAMN– it doesn’t feel like the right one… Check out all this clumsiness:

That works perfectly well as far as I’m concerned (remember – I’m not trying to validate the int to be within a given range or anything – I just want a valid int!) but something is surely wrong here… this should be a one-liner, or maybe three or four lines at the absolute most, not 140 lines or so…

Anyone got any suggestions on how to do this the right way? (In C++ not C, so no atoi or C-strings, and no boost library please! Just “standard” C++!).

Simple OpenGL Keyboard and Mouse FPS Controls

Note: This was written in January 2011 – I just never posted it, but I’d already uploaded the video to YouTube and someone asked for the code, so here it is, in all its fixed-pipeline glory ;)

Update – September 2013: I took these camera controls and wrapped them up into a Camera class in a later post which you can find here: http://r3dux.org/2012/12/a-c-camera-class-for-simple-opengl-fps-controls/. When I did this I wasn’t used to GLM (the OpenGL Mathematics library) so I just rolled my own Vec3 class – you can happily substitute glm::vec3’s if you’d like, and in fact I’d recommend it. Cheers!


I’m working on my OpenGL skills (or lack thereof) at the moment, and wanted to implement some 3D movement controls kinda of like a FPS with clipping off, so I read some chapters of the hallowed OpenGL SuperBible and did some googling, where I came across Swiftless‘ camera tutorials (Part 1, Part 2, Part 3) which gave me a really good start (Thank you, Swiftless!) on how to manipulate the ModelView matrix so we can move around a 3D scene, only it wasn’t quite perfect…

Strange things would happen like you’d look vertically downwards (i.e. directly down the negative Y axis), then you’d push forward – and yeah, you’d move “down”, but you’d also move “forward” at the same time (oh, and I’m putting things like “down” and “forward” in quotes because these concepts are all relative to your viewing orientation – not because I’m trying to be “sarcastic” or anything =P)

Anyways, I had a play with it and sorted it out after spending some time looking at the graphs for trigonometric functions and doing a little bit of off-setting and range-limiting as required. Check it out:

It actually looks quite a lot better running live than in the video due to mis-matched frame-capture rates and the like, but you get the idea =D

Full source code is available after the jump.

Cheers!

Continue reading Simple OpenGL Keyboard and Mouse FPS Controls

PS3 Motion Input

http://www.youtube.com/watch?v=w0puP8nrIU8

I’m really in two minds about this and Natal… but then when the Wii was first announced and you could see the Wiimotes for the first time it just screamed fad!, but once you do a little bowling or tennis is all sort of made sense… It was so new it just seemed wrong, but with time became commonplace.

On one hand, it might be cool to have true motion tracking, and I’m sure there could be some good uses for it – throwing grenades/punches, light sabres, manipulating object on screen – that sort of thing. But on the other hand, it really does look like some freakish plastic ice-cream or over-sized roll-on deodorant, and I’m not sure I want to play Fight Night Round 5 flailing my arms and dripping with sweat…

So the Sony device has buttons while the Natal is button free – and I can definitely see positives and negatives for both systems – but as to which will be the best, and which if any, I’ll really want to use, I genuinely have no idea until I can give them both a shot. And that assumes that the price is right… What do you reckon?