Tilt

Tilt is a physics-based ODE game created by Yue Peng Toh using nest code from Jim McCann.

Goal

With the physics engine to play with, I wanted to create a simple yet fun-to-play game that is fully based on physics. The aim of the game is simple indeed: to guide the ball along the maze board while avoiding (grey) traps which will teleport you back to the starting point. However, this must be done using only gravity; one needs to tilt the board in all directions to allow gravity to move the ball in the direction towards the end goal (red spot). This idea is somehow inspired by 2 things: recalling how fun it was to balance and move marbles around on a hard-covered book when I was a kid, and secondly, a chinese movie: The New Police story by Jackie Chan. The female actress was strapped to a bomb which had a board with a few ball bearings and some holes. The female actress had to keep as still as possible to prevent the balls from rolling into the holes and triggering the bomb.

Method

Since the board and its blocks are joined together, I initially tried to do a composition of these bodies so that I can treat them as one body. Then I could simply apply a little torque to rotate them either clockwise or anti-clockwise about the x and z-axis (forward, backward, leftward, right-ward) each time the correct directional keys are pressed. The ball will then move about due to the direction of changing gravity when the board is tilted in various directions. ODE can then handle collision with the maze walls and generate the appropriate simulation.

However I realize that this physical scenario can be simplifed with little knowledge of erm, physics. Even though gravity acts on all objects, in our case, our blocks and board are fixed always. We can consider them as a fixed massive plane or ground that only changes orientation. This change in gradient however, directly affects the motion of our ball. The ball rolls because the initially flat ground is now a slope, so there is a new component of weight(mg sin theta) acting perpendicular to the normal force from the surface of the ground (initially Normal = mg). So, instead of rotating the board, and also everything on it, we can simply view the ground as fixed and change/rotate the gravity vector based on the current orientation of the plane. In summary, we really need to do 2 main things: calculate the rotation matrix based on each little rotation we made to the board, then inverse-transform the gravity vector to reflect these changes. We inverse transform because, if we tilt the board forward, it is as though the gravity vector has rotated in the opposite direction if the board was fixed. THe 2nd thing is to transform the camera the same way to make it seem like we rotated the board forward, but this is identical to keeping the board at where it is, and rotating the camera backwards, in relative motion.

In summary, I kept my plane(blocks and board) still while changing the gravity vector based on the rotation to be made. Then i made similar transformations to the camera to make it look like I have tilted the board. Then of course, I still define each maze wall as an ODE geometry with huge masses so that collisions can be handled.

Novelty

Personally i feel that the novelty of the game lies in the way it is made (as described above): the interesting use of relative motion to achieve the gameplay I set out for. A second plus point of the game is actually how the maze is set up. I have tried to carefully design the level such that the careful player who plays slowly will win. Making a good maze is difficult and at each stage is progressive (with the parts nearer the end harder) in terms of difficulty. The final part is difficult if fine adjustments are not made. Also, I try to incorporate at each stage some decision making process for the player: should he go the longer and tedious way, or the shorted one with a trap to maneouver past? Lastly, I think the game is probably novel in the sense instead of the usual case of the NPC (in this case a ball) applying forces on the environment, allowing him to traverse the world, the environment in this case is the driving force behind the NPC's movement.

Results

In my opinion, this game has achieved the goal oI have set out to achieve: Simple, fun and physical. There are a lot of parameters I have to tweak: ball radius, mass, collision response, maximum tilt, friction and many more and each one affects the gameplay. I might not know whether I have achieved the best possible but the game is tweaked the best way possible without sacrificing gameplay. The leftward and rightward camera swing can probably be improved too. Deciding how (high or far) to place the camera is also important because I want the player to be able to see the far board when its tilted to the max. This can also be further optimized. Graphics can be improved as well (Shaders , shadows) but these could be added quickly. Advanced levels can also be produced (those with mini slopes, moving obstacles etc). Overall, I find it has achieved the desired goal, and has further potential to be expanded upon.