Clone wiki

Potato / Kinect

If you have a Kinect, you're in luck! You can play this game with Kinect!

There's a marvelous tool called FAAST. What it can do is translate body movement into key strokes. So, I've made a configuration file for it. You'll use your body as if it was a joystick. When you lean forward, the ship accelerates. You lean backwards, you'll break. If you lean left and right (you guessed it) you'll turn the ship left and right.

How to install

Download and install FAAST from http://projects.ict.usc.edu/mxr/faast/

Follow the site instructions. It is not necessary to install the OpenNI libraries.

Copy and paste this configuration file into a text editor (notepad should suffice) and save it as a XML file ("potato.xml" for instance).

<sensor>
	<tracker>Microsoft</tracker>
	<mirrormode>true</mirrormode>
	<smoothing>true</smoothing>
	<smoothingfactor>0.5</smoothingfactor>
	<correction>0.5</correction>
	<prediction>0.5</prediction>
	<jitter>0.05</jitter>
	<deviation>0.04</deviation>
</sensor>
<server>
	<transformations>Global coordinates</transformations>
	<automaticassignment>true</automaticassignment>
</server>
<gestures>
	<gesture name="Left" timeout="0">
		<input type="0">
			<descriptor>lean</descriptor>
			<descriptor>left</descriptor>
			<descriptor>at least</descriptor>
			<descriptor>5</descriptor>
			<descriptor>degrees</descriptor>
		</input>
		<output type="0">
			<descriptor>hold</descriptor>
			<descriptor>left_arrow</descriptor>
			<descriptor>until complete</descriptor>
			<descriptor>0</descriptor>
		</output>
	</gesture>
	<gesture name="Right" timeout="0">
		<input type="0">
			<descriptor>lean</descriptor>
			<descriptor>right</descriptor>
			<descriptor>at least</descriptor>
			<descriptor>5</descriptor>
			<descriptor>degrees</descriptor>
		</input>
		<output type="0">
			<descriptor>hold</descriptor>
			<descriptor>right_arrow</descriptor>
			<descriptor>until complete</descriptor>
			<descriptor>0</descriptor>
		</output>
	</gesture>
	<gesture name="Accelerate" timeout="0">
		<input type="0">
			<descriptor>lean</descriptor>
			<descriptor>forward</descriptor>
			<descriptor>at least</descriptor>
			<descriptor>5</descriptor>
			<descriptor>degrees</descriptor>
		</input>
		<output type="0">
			<descriptor>hold</descriptor>
			<descriptor>up_arrow</descriptor>
			<descriptor>until complete</descriptor>
			<descriptor>0</descriptor>
		</output>
	</gesture>
	<gesture name="Break" timeout="0">
		<input type="0">
			<descriptor>lean</descriptor>
			<descriptor>backward</descriptor>
			<descriptor>at least</descriptor>
			<descriptor>5</descriptor>
			<descriptor>degrees</descriptor>
		</input>
		<output type="0">
			<descriptor>hold</descriptor>
			<descriptor>down_arrow</descriptor>
			<descriptor>until complete</descriptor>
			<descriptor>0</descriptor>
		</output>
	</gesture>
</gestures>

Load this file on FAAST, with the Load button. Run the game (by opening potato.exe). Press the Start Emulation on the FAAST window. Finally give focus to the game window, and have fun doing leaning exercises!

Gameplay Notes

If you find the turning speed and ship acceleration to be way too fast, feel free to tune it down to make it feel better. Here's a sample data/ships/player_kinect.json file that makes gameplay with Kinect feel better.

{
	"name": "Ship",
	"author": "David Serrano",
	"physics": {
		"gravity": 0.05,
		"friction": 0.01,
		"maxspeed": 2.0,
		"minspeed": -1.0,
		"climbangle": 70.0,
		"speeddecayhit": -1.5,
		"turndecay": 0.5,
		"driftfactor": 1.75
	},
	"controls": {
		"maxturning": 3.0,
		"turningstep": 1.0,
		"accelstep": 0.05,
		"brakestep": 0.05
	},
	"model": "ship2.obj"
}

Just remember to change the relevant config.json entry.

Updated