Saturday, December 10, 2011

Demo Uploaded!

Please check out our demo video!
Also:
We changed the name of our game to "Steer n Slide".


Monday, November 28, 2011

Level Editor

To provide users with more experiences, we designed a level editor using which we can design a tunnel with fixed length and well aligned obstacles. It could also import, export and modify maps. The maps are located in Level Mode and could be selected by the users.

Score System Implemented

We have embedded a score system to the game which will record and update high scores. The layout is designed as below as a digital monitor. Letters and numbers will be displayed one by one dynamically.

Monday, October 31, 2011

Alpha Version Progress Report

Progress Report
Up to now, we have finished all of the requirements in Alpha Version:
Procedural generation of tunnel
Distribution and generation of obstacles and accelerators
Collision between character and obstacles
Scoring system
Sound effects

We have also implemented some of those in Beta Version:
Webcam based movement control
Dizzy and motion blur effects
Menu GUI

In the next few weeks, we will be working on:
Other Beta Version requirements, including dual game mode, diverse bonus/ obstacles and custom shaders, etc.
We will also optimize the existing mechanism and graphic effects according to the feedback.

Game Demo:

Motion Controller Detail

Idea:
Threat the frame of player(s) as a texture and analyze the average direction of the contour edges of the player(s).

Assumptions:
1. Players can be distinguished from background because they are moving. (Even if they looks still, people have subtle movement other than the background.)
2. People can be seen as sticks. (They are tall, long, and most of the edges are vertical if they stand still.)

Extract Moving Things:
That is a simple trick, because the background image never moves (Assumption 1), we can simply use the difference between a frame and its previous frame.


Smooth and Get Gradient Map:
We can use a gradient convolution kernel {-1, 1} to get the result. We can see that the horizontal lines are obvious after convoluted with a Y direction gradient, and the vertical lines are obvious after X direction gradient.


Get the Interesting Points:
We can see from the gradient kernel, even if the background is subtracted, there is still a lot of noise comes from the background, that is due to contrast change from frame-to-frame brightness change.  So we need to set a threshold that means, if the edge is more obvious than something, I should pay attention to it. A simple way to measure how the edge is obvious is add the magnitude of the x-and-y-direction gradient up. (If Gx*Gx + Gy*Gy > threshold, the point in counted as a interesting point.)


Calculate the Point Directions:
Here is an example of how to calculate the local direction of edges:
The upper left matrix is for a simple edge, the upper right one is the smoothed edge with a Gaussian kernel of size 3, while the lower left is the convolution result with a x-direction gradient kernel and the lower right is the the convolution result with a y-direction gradient kernel.
As we known that if the edge is vertical, the x direction convolution response will be high and vice versa, we can get the direction of the edge by calculate the tangent value of x and y direction convolution results.
Say, we want to know direction of the point (3, 3), we can simply use atan2(-16, -16) = 45 degree.

Calculate the Average Direction of the Whole Frame
Knowing the method above, we can simply accumulate all the direction values and calculate the average of them to get the direction of the whole frame.


HUD in Game

Idea:
We want to Create Really Simple but cool HUD in game to show the current score and speed level of the player. Because our game is pretty like the racing game, the idea of build a speedometer like HUD comes to our mind first.

Rotate the Pointer:
We started to add our HUD from a Unity GUI Texture, but the problem is, it is not allowed to rotate any non-3D GUI Textures in Unity, while we definitely don't want to use mesh textures because that is not cool...
So one way to rotate the GUI Texture is like that:

        posPointer = new Vector2(transform.localPosition.x - sizePointer.x * 0.5f, transform.localPosition.y);
        rectPointer = new Rect(posPointer.x - sizePointer.x * 0.5f, posPointer.y - sizePointer.y * 0.5f, sizePointer.x, sizePointer.y);
        pivotPointer = new Vector2(rectPointer.xMin + rectPointer.width * 0.5f, rectPointer.yMin + rectPointer.height * 0.5f);
        GUIUtility.RotateAroundPivot(angle, pivotPointer);
        GUI.DrawTexture(rectPointer, pointer);
        GUI.matrix = matrixBackup;
        GUI.DrawTexture(rectSpeedometer, speedometer);

It Rotates a Texture2D like the OpenGL way, and the result is pleasing.

Result:
Here is a screenshot of our HUD: