Littlest Ninja


CPE 476 – Spring 2010
Paul Phu(Leonardo)
Sunny To(Michelangelo)
Nathan Black(Master Splinter)
Mike Murray(Raphael)
Allan Park(Donatello)


Story

In Littlest Ninja, you play as a plushie toy ninja trying to regain his honor. Your owner has discarded you to collect dust under the bed in favor of a newer toy. Your mission is to traverse the bedroom, collecting the cubes along the way, and defeat the new toy and regain your pride.


How To Play

Our game is playable with an Xbox 360 wired controller. Here are the controls:
Left Thumbstick – movement
Right Thumbstick – camera
A – jump
Y – toggle between climbing and projectile mode
B – toggle between rope and arrow projectiles when in projectile mode
LT - hold to go into over-the-shoulder-view for better aimming


Note: Not all features are available on keyboard, but you can still run it and use the free view camera to explore the room. Use the ‘C’ key to toggle between third, first, and free camera views. In free view, use the arrow keys and mouse to fly around the room.

Technologies and Resources


Shadow maps! Alright, we lied. We don’t actually have shadow maps implemented into our game. However, we got really close and if you want to try it for yourself, check out these resources:
Paul's Project Shadow Mapping(Unrelated to Paul Phu)
Wiki page of Shadow Mapping


But we do have light maps! Light maps worked really well in our game because our whole environment (geometry and light sources) is static. The light map textures were generated using Blender. In Blender, we set up our models into a scene, unwrapped each model onto a texture, and backed shadows and light onto the texture. Here’s a video we used as a reference to do just that:
Baking shadows in blender


In our game, the ninja is represented using a bounding sphere volume. To be able to detect collision with the triangles in our models, we implemented a sphere triangle overlap test. To optimize it, we bounded each model into a bounding box. If the ninja’s sphere isn’t inside the box, we don’t bother checking against the triangles inside it. The overlap test isn’t complicated at all, and is explained very well visually in this link:
Triangle – Sphere Overlap Test By Ryan Dudley


Our artist had some models in our scene that are nicely textured, like the nerf gun. He used a tool called RoadKill that allows you to unwrap an obj file, rearrange the vertices on a UV map, and then output it with the new mappings. It takes some getting used to, but it’s definitely worth checking out:
Roadkill UV Tool


Also, our artist made some animations for the ninja. While our scene models were composed of obj files, the ninja and boss were composed of MD5 models. MD5 is a proprietary, but open model format that was used in Doom 3. It supports both model geometry and does animations. Unlike obj, an MD5 mesh has a “skeleton” that consists of several bones and joints. Each bone is anchored to vertices, so whenever a bone gets translated or rotated, the vertices anchored to it moves with it. The MD5 animation file consists of keyframes that describe the location and orientation of the bones. Animations get linearly interpolated in between keyframes, which makes for a smooth looking animation. Here is a resource that provides a script to convert a Maya project file into an MD5 mesh and animation file:
Maya to MD5 script (no longer supported)


We found that this script wasn’t perfect, so use it at your own caution. Alternatively, you can use Doom 3 (which was $20 on Steam when we took this class) and do work some voodoo to output an MD5 mesh/animation from your Maya file. Check out this resource if you want to go that route:
Maya to MD5 using Doom 3


Of course, you don’t need to use Maya. There are plenty of resources out there that used Blender to make MD5 models and animations.