click to activate and use the arrow keys to control the character
September 21, 2008
flash platformer physics
I've been experimenting with platformer physics using the Flash version of Box2D in order to familiarize myself with ActionScript. I gave the character the ability to hang on edges and climb ropes by using joints in ways they were never meant to be used.
click to activate and use the arrow keys to control the character
click to activate and use the arrow keys to control the character
September 01, 2008
yet more physics animation
Here is a better example of a physics-based walk:

It's still a bit crude but it's approaching something that could be used in the game. The animation system controls the rotation of the box that the feet are attached to, the feet being IK handles that control the animation of the legs. The walking animations are played when the appropriate keys are pressed.
In other news, I'm starting to see the true enormity of this project, and scaling my plans down accordingly by stripping them of unnecessary features. Fortunately, I hadn't posted about those features so there is nobody to disappoint except myself. I think this may strengthen the game though, by removing distractions that could obscure its core.

It's still a bit crude but it's approaching something that could be used in the game. The animation system controls the rotation of the box that the feet are attached to, the feet being IK handles that control the animation of the legs. The walking animations are played when the appropriate keys are pressed.
In other news, I'm starting to see the true enormity of this project, and scaling my plans down accordingly by stripping them of unnecessary features. Fortunately, I hadn't posted about those features so there is nobody to disappoint except myself. I think this may strengthen the game though, by removing distractions that could obscure its core.
August 24, 2008
jumper 3

I don't normally have the patience for these types of games, but Jumper 3 was fun enough to keep me playing until the end. In it you control Ogmo through over 50 stages, switching between five separate forms with different abilities. For an additional challenge you can try to collect the coins and medals. I really liked the simple graphics and the music, as well as the general atmosphere created by the story and setting.
I personally would have enjoyed this game more if the controls were a little easier. The way Ogmo accelerates when moving horizontally makes it hard to predict his movement, and each of Ogmo's forms have different physics properties which make it even more difficult to learn. But overall it's a very polished experience.
August 17, 2008
more physics animation
I decided to try integrating physics right into the character editor. I'm not completely sure yet if it's going to work the way I expect it to, but the plan is to have both the skeletal animation and the physical movement of the character controlled through the animation system.
For example, consider a character that is made up of joints and quads and attached to a box which is connected by a revolute joint to a circle (as in the screenshots). The walking animation would animate the joints to make it look like the character is walking and it would also animate the motor of the revolute joint to rotate the circle so that the character moves along the ground.


I'm still working out the complexities but I think this system has a lot of potential for awesomeness. It is basically a way of doing data-driven character movement, which gives character creators a lot of freedom without having to write any code.
For example, consider a character that is made up of joints and quads and attached to a box which is connected by a revolute joint to a circle (as in the screenshots). The walking animation would animate the joints to make it look like the character is walking and it would also animate the motor of the revolute joint to rotate the circle so that the character moves along the ground.


I'm still working out the complexities but I think this system has a lot of potential for awesomeness. It is basically a way of doing data-driven character movement, which gives character creators a lot of freedom without having to write any code.
July 28, 2008
more concept art
I'm thinking about going with a more abstract style than the textured/painted look I was originally planning. The graphics would be much easier to make - I could possibly even do all the artwork for an entire game by myself.


The sprites look to be a little too detailed for the environment. Flat colours might be more suitable there instead of the shading.


The sprites look to be a little too detailed for the environment. Flat colours might be more suitable there instead of the shading.
July 25, 2008
physics based animation
I was experimenting with physics based animation with Box2DX:
I don't think it would work well for my project, but the results are entertaining. The movement of the bodies is controlled by joints (revolute and prismatic), with motors enabled. The speed of a motor is modified to target a certain angle/translation based on keyboard input.
I don't think it would work well for my project, but the results are entertaining. The movement of the bodies is controlled by joints (revolute and prismatic), with motors enabled. The speed of a motor is modified to target a certain angle/translation based on keyboard input.
July 13, 2008
PSA

I haven't been posting lately because I haven't been able to come up with anything worth posting. I took a break from coding for a couple of weeks, and then (re)started working on the game editor/map editor for my project. It's going well, but it is still in its early stages. Posting will resume as soon as I have something interesting to show.
June 21, 2008
animation system

I don't feel like making a new screenshot so here are some tulips instead.
This is a general overview of the way my character editor works.
To recap from my last post about aiming, all of the objects in the editor are nodes in a hierarchy. They are derived from a base class that I call TransformNode. The specialized nodes that I have so far are the Joint, IKHandle, and Quad. Joints are nodes that form a skeleton and can be affected by IK, IKHandles are nodes that control an IK chain (of joints), and Quads are the textured quads that make up the visible part of an entity.
All nodes contain a collection of attributes that are used in animation. The base node has translation and rotation attributes, and specialized nodes can add other attributes to the collection. The Quad, for example, has additional attributes for width, height, and texture coordinates. (This means that texture/sprite animation can be used in combination with skeletal animation.) New attributes are animateable as soon as they are added to the node and exposed to the interface (via a public property with get/set accessors so that they show up in the property grid).
Attributes are animated by setting keyframes in the animation curve that is associated with that attribute. A curve contains a set of keyframes and a reference to the node it affects, along with the attribute index. Keyframes contain data for control points on the animation curve and their tangents. The positions of the points on the curve are the frame of the animation (x) and the value of the attribute at that frame (y). Bezier interpolation is used to interpolate the values between keyframes. An animation is simply a set of curves.
Aim animations have an additional bit of data called an AimVector. It has minimum and maximum rotation values and is attached to a node in the hierarchy. Aim animations are like regular animations except that there are only two keyframes. When aiming, the angle of the vector between the aim vector node position and the target position is compared to the minimum and maximum angles to get an interpolation value. This value is used to do a linear interpolation between the two frames of the aim animation.
When exporting animations, the curve data is interpolated and values are saved for every frame in the animation (so that interpolation does not need to be performed in game).
This editor has evolved a lot over the time I've been working on it. I'm finally satisfied with this particular implementation, although a lot of the functionality was copied from Maya.
June 14, 2008
animated gif creation
In my previous post, I included an animated gif showing my editor in action. I thought a gif was appropriate in this situation because it was a short animation, uploading it to YouTube caused serious distortions, Photobucket doesn't allow me to host swf files, and because the limited colours make it suitable for gif compression. I used several free tools to make this gif, and thought I'd describe the process in case others find it useful.
First I used CamStudio to record the demonstration. It's a really simple app that outputs avi files and has the option of converting them to swf files.
After that I used RAD Video Tools to convert the avi file into a series of gif files. I set "Adjust (adds/removes frames) to" to 15, so the output would be 15 frames per second of video.
Then I used GIMP to turn the gif files into a single gif animation using the instructions I found here. Like the post says, I opened the first file and imported the rest as layers using File -> Open As Layers. I saved the file as an animation that loops forever with a 60 ms delay between frames. I also set "frame disposal where unspecified" to one frame per layer, and checked "use delay entered above for all frames" and "use disposal entered above for all frames".
The result was a 523 KB file with 266 frames at 272x248 pixels, 17 seconds at about 15 fps.
First I used CamStudio to record the demonstration. It's a really simple app that outputs avi files and has the option of converting them to swf files.
After that I used RAD Video Tools to convert the avi file into a series of gif files. I set "Adjust (adds/removes frames) to" to 15, so the output would be 15 frames per second of video.
Then I used GIMP to turn the gif files into a single gif animation using the instructions I found here. Like the post says, I opened the first file and imported the rest as layers using File -> Open As Layers. I saved the file as an animation that loops forever with a 60 ms delay between frames. I also set "frame disposal where unspecified" to one frame per layer, and checked "use delay entered above for all frames" and "use disposal entered above for all frames".
The result was a 523 KB file with 266 frames at 272x248 pixels, 17 seconds at about 15 fps.
June 11, 2008
more aiming
I came up with a better way to do weapon aiming. In order to implement it I had to rewrite some parts of the editor to make it work more like Maya. All of the objects in the editor (Joints, IKHandles, and Quads) are now derived from the same base class, called a TransformNode, which has translation and rotation values. They are all contained in the same hierarchy, with a single root node. Here is an example of how this system can be used for aiming:

In this example, the aim animation rotates the node that the IK handles are grouped to. The shooting/recoil animation moves the IK handles.
It seems so obvious now that this is the correct way to do it; I'm not sure why I didn't think to do it this way earlier. This system uses the IK handles directly, so the hands are always placed correctly. It's also more flexible and consistent than what I had in my previous post.

In this example, the aim animation rotates the node that the IK handles are grouped to. The shooting/recoil animation moves the IK handles.
It seems so obvious now that this is the correct way to do it; I'm not sure why I didn't think to do it this way earlier. This system uses the IK handles directly, so the hands are always placed correctly. It's also more flexible and consistent than what I had in my previous post.