Site hosted by Angelfire.com: Build your free website today!

State Diagrams

 

First off, i'll introduce the state diagram for a Character.

So there is a few different states here:

Intro - what a character is doing when it is first "put" into a game
Still - when a character is doing nothing else, then it is still
Cancellers - these are actions that can cancel other actions
Non-cancellers - these are actions that cannot cancel other actions
Inflictions - these are actions that have been inflicted upon the character

 

Next taking a closer look at the Inflictions State, and its substates..

There can be various Infliction states, such as Hit, Thrown, Frozen, Burned, and they all slot in here.

 

Next looking at Non-cancellers..

As with Inflictions, there can be one or more Non-cancellers slotted in here.. most actions will end up in here.  Walking, jumping, blocking, punching, kicking...

 

Following are Cancellers...

Cancellers are actions that if activated will cancel and replace the current action.  Such as a powerful attack.

 

 

Action Timelines

 Take "Punch" for instance..

We can divide the action up into the wind-up, the hit and the recoil.

So first there is wind-up (w), and that is followed by the hit(h).. and then there is the recoil of the punch (v).

-------- W --------

w is the time an opponent has to prepare for the hit.

A high w means there is time to plan a defence strategy.
A low w means there is little or no time to plan a defence.

In other words, w is a measure of the speed of an action.

Actions that would be described as "fast" would tend to have a low w, and actions that are "slow" would have a high w.

-------- V --------

v is the recoil time of an action.  It is like the commitment.

A highly commited action would have a high v.

-------- D --------

d is the damage caused by the hit.

d can be calculated as:
    d = ((v + w) / 2) + g  where g is some extra damage associated with the attack

-------- C --------

c is the cancel-point.  In other words, it is the point at which the action can be cancelled by a Canceller action.

-------- H & I --------

h and i are the points in time where the action really happens.

h is for attacks, while i is for more general things which may not necessarily be attacks.
As a result i does not have damage(d) associated with it.

-------- End Points --------

Every action has an end point.  That is when the action ceases.

In the case of a fixed end-point, then that is precisely where the action finishes unless it has been cancelled.

A variable end-point means the action can cease after recoil time (v) or continue until the character is ready to stop.

Reaction-Window X

x is the time you have to execute a defence.
If the opponent launches an attack while you are in a state of recoil, then x is equal to the end of your recoil (v) subtracted from the end of their wind-up (w).

If x is smaller or equal to zero then there is no recourse, and the character will get hit.

Spending x

There are a few ways of using x.

1) Dodge - walk/jump out of the way... avoid the collision / intersection

2)Block - enter a state whereby the hit (h) will cause minimal or no damage...

Strategy 1 is inherently balanced gameplay-wise.
If the wind-up time of the block in strategy 2 is larger than x, then it will certainly fail.

 

 

 

Action Milestones

As well as action timelines, there are different phases that an action goes through which are like milestones.

Upon reaching a milestone the events will occur.  These events are things like moving the character, changes to the current animation of the character etc.

Some special milestones include "All" which occurs at every step of the action and "End" which occurs at the end of the action.

The rest of the milestones are numbers.  As an action takes place, a counter is incremented representing the current phase/milestone of the action.

Frames and Animations

A frame consists of a bitmap which has a specific width and height, relative to all the objects in the game.

An animation is a sequence of frames, each of which is shown for length (L).

 

Character Attributes

A character has various attributes including:

- hp(hit points)
- energy
- direction
- x, y coordinates
- current frame
- current action
- current phase / milestone

These things tend to be modified at different milestones during an action.

Here is a work-in-progress discussion about an example Boxer character.

Boxer Example


Articles-Home
Home