Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

January 08, 2010

pulse+

This is a little game I made for school in second year. The menus were made in Flash but the rest is pure ActionScript. It could probably use a timer and the audio should be replaced, since it is not original.


August 28, 2009

bivouac urbain


game jamming inside the main tent. taken with my DSi


A few weeks ago I was in Quebec City for Bivouac Urbain, a game jam/game prototyping competition. I'm not too proud of my entry but the event was extremely awesome and resulted in some interesting games. My favourite entry of the ones I played was messhof's Jetpack Basketball, which I highly recommend if you have someone to play against. Also worth checking out is Stimergy, by Renaud Bédard (Polytron) and Heather Kelley (Kokoromi), a game about guiding ants using pheromone trails. Click the link for Renaud's post about it which includes a postmortem and a time-lapse video of the development of the game.

My simple and not very original entry was Spirit. The theme of the competition was "antithesis" which was pretty vague and prompted me to do some research. I found that a particular line from a poem by John Dryden came up repeatedly as an example of antithesis as a rhetorical device, so I based my game on it. I coded it within close to 24 hours, since I didn't get any work done the first night. It probably would have gone better for me if I'd been more prepared, with a framework in place and maybe some idea of what kind of game I wanted to make. Overall it was a good experience and I'm looking forward to my next game jam.

May 03, 2009

slots

I made a slot machine in actionscript for school, but it wasn't very good. This is a stripped down version. The fruits are rendered with actionscript's drawing commands; I drew them in Photoshop first with the curve tools, then transferred to code by counting grid spaces. It was tedious but I like the results.



April 25, 2009

tic tac toe

A not very smart tic tac toe game.



February 28, 2009

play with my heart

I made a little flash toy for school that makes use of bezier curves:




use the mouse to play with my heart

December 11, 2008

back from the dead

I've finished another semester of school. I will be posting some of my work soon, but for now here is an animation I discovered in my old files:



It was made in QBasic using arrays of colour values for the frames. It's my earliest character animation (unless you count ascii graphics). The file is dated February 2002.

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

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.

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.

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.

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 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.

May 25, 2008

box2dx

I've decided to use Box2DX, a C# port of Box2D, for physics.



It was easy to integrate into my program and start using it, and it should save me a lot of trouble. Writing my own code for rigid body dynamics would have taken me forever. It also opens up more potential for physics-based gameplay.

May 13, 2008

weapon aiming

I got my aiming animation stuff working, sort of. The editor now allows one animation to be added on top of another. This allows me to blend a shooting animation with an aim animation, like this crude example shows:



However it doesn't always give good results. My test animation looks alright when aiming upwards and straight ahead, but not so well when aiming downwards:



As you can see, the support hand doesn't stay where it's supposed to. This could be solved by changing the shooting animation or by using IK for the support hand. In the game, the aim animation would be controlled by the crosshair position.

May 05, 2008

update

According to the earliest timestamp I could find on my game-related files, I started working on it in May of 2006 - it's been two years. I've learned a lot, even though much of the work I've put into it hasn't produced tangible results.

All I have to show for now is a rough implementation of the graph editor:



Currently I'm working on having joints be controlled by the crosshair position, to make it possible for characters to aim their weapons in a convincing way.

February 10, 2008

bezier interpolation

I just got my Bezier interpolation working:



This thread was very helpful, and I stole the code for the cubic equation solver from here. The code to draw Bezier curves is from here.

Now I have to apply it to my animation curves.

December 25, 2007

lack of progress report


yay for Bezier curves

Despite having been out of school for two weeks, I have not managed to make much progress on my project. I did a lot of thinking about my animation system though, and I've decided that I will try to implement a simple version of Maya's graph editor.

My original plan to do frame by frame animation with linear interpolation between frames doesn't seem good enough after animating with Maya. I need the smoothness and slow in/slow out that gives the movement weight and makes it convincing. Also, the ability to set keyframes at any point in the animation, rather than regular intervals, will help with the timing.

Hopefully I'll have something interesting to show before I have to go back to school in two more weeks.

October 27, 2007

inverse kinematics

After discovering the Joint and IK Handle tools in Maya, I decided to implement IK in my animation editor:



It works much better for animation than the particles and constraints; it's like a cross between that system and the bone hierarchy in the old version. I used Cyclic Coordinate Descent for the IK solver.

October 17, 2007

more physics

Another simple physics test:



I made the wheels "turn" - when a particle is in contact with a line segment, and the left or right key is pressed, a force perpendicular to the line is applied to the particle. It's pretty fun to play with.

September 30, 2007

editor rewrite

The fourth version of my character/model/animation editor, in progress:



I got rid of the bone hierarchy and cleaned up the interface; it's easier and more fun to use now. I've been working with Maya for a few weeks at school so I ended up stealing some interface ideas and I have plans to incorporate more Maya-like features when I re-implement the animation stuff.