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

A C++ Camera Class for Simple OpenGL FPS Controls

This is the third post of three, where we finally get to create a Camera class which encapsulates all the important properties of a camera suitable for FPS controls. I could, and indeed did, have this written to just use three floats for the camera position, three for the rotation, three for the movement speed etc – but it makes more sense to use a vector class to encapsulate those values into a single item and provide methods for easy manipulation, so that’s what I’ve done.

The end result of this is that although the Camera class now depends on the Vec3 class, the Camera class itself is now more concise and easier to use. If you don’t like the coupling you can easily break it and return to individual values, but I think I prefer it this way. Oh, and this class is designed to work with GLFW, although it could be very easily modified to remove that requirement and be used with SDL or something instead. In fact, we only ever use the glfwSetMousePos(x, y) method to reset the mouse position to the centre of the screen each frame!

Anyways, let’s look at the header first to see the properties and methods of the class:

Camera.h Header

Now for the implementation:

Camera.cpp Class

Rather than me explaining each individual piece of how to fit it together, here’s a worked example – it’s really quite easy to use:

Finally! Done! You can see a video of the first version of the FPS controls here – this code works identically, it’s just that the Camera is now in its own class, we’re using our own little Vec3 class to keep group and manipulate some values, and the whole thing works in a framerate independent manner thanks to the FpsManager class. Phew!

Cheers!