Platformer Demo

Here it is! There's no goal and the terrain is a randomly generated height map, but it's a start. The control scheme is meant to work best with a two stick game controller, but it's not necessary.

System Requirements: Java 5.0 or higher
(click here to get the laest JRE)

Controls:
Arrow keys or left analog stick on controller to move
Space bar or #1 controller button to jump
Mouse or right analog stick to control the camera (mouse wheel zooms in and out)

>>Play Demo

>>Download Source



    This game demo started when I wanted to teach myself 3D modeling. Since I like supporting open source projects, I decided to go with Blender. It has most of the features of a professional modeling program like Maya or 3D Studio Max, but none of the cost. After messing around with Blender for a bit, I found a very cool video tutorial on modeling a low poly characters located over here. That plus this cool character sheet I found from Mega Man Zero, and I was good to go.

It took me a while, but I was pretty happy with the outcome. Since I'm not very good at coloring, I used the same character sheet to make a texture:

Now that I had my character, I wanted to be able to do something with him. I looked into a few different game engines like Torque and Irrlicht, but eventually settled on JMonkeyEngine. It had the advantages of being open source, and written in java so I wouldn't have to compile it different ways for different systems. I was a bit skeptical at first that Java could be fast enough for a game engine, but I was really impressed with the tech demos they had on their site. Plus, it's not like I was trying to make the next Gears of War.

I went through the tutorials on the JMonkeyEngine site (which were very useful), and then the tutorials on the corresponding jme physics. Setting up a test world and importing my character turned out to be really easy. Getting him to behave in a manner I wanted, however, turned out to be a lot of work. The problem was I wanted only semi-realistic physics. I didn't want my character to fall over if he took a bad step. I could have just made my own simple physics engine that only took gravity into account, but the solution I eventually got working will be easier to expand upon.

The way I finally got my character to behave correctly was to represent him as a hovering capsule in the physics geometry. On every pass of the main game loop, I first let the physics engine do what it wants. Then I zero out any tilt it gave to the player to keep him upright, and shoot a ray downwards from his center to see how far away from the ground he is. If he's too close, I prop him back up. This gave me the added advantage of knowing that if I'm holding the player off the ground, that means he's in a position he can jump from. The reason I didn't put him directly on the ground is because I didn't want to have to deal with friction. In the end I had a jumping, walking Megaman that could be controlled with a joystick.

The next step is to get some sort of combat system in there and maybe put in some sort of real environment rather than a randomly generated height map. I also want to tighten up the controls and the animations. Eg when you're only pushing the joystick a little, the on-screen charcter should be taking smaller steps. I'd like to eventually turn this into a Legend of Zelda/Secret of Mana type action RPG, but for now I'm happy to build it one step at a time.