Re: [stella] Beat 'em up 05

Subject: Re: [stella] Beat 'em up 05
From: "Andrew Davie" <adavie@xxxxxxxxxxxxxxxxx>
Date: Sun, 2 Aug 1998 23:05:04 +1000
>OK, what do you think would be a good control scheme for a
>fighting game and how would you implement it? :-)

Vector the operation of the joystick through a jump table.
change the operational jump table based on
    a) the current state of the player
    b) the current state of the opponent.

Consider, for example, a 32 word jump table (of course you could pack this
and do a search rather than a straight lookup - but its principle not
implementation i'm showing)...

Assume up=1, down=2 left=4 right=8 and button=16

    dw noaction            ; 0
    dw armsupindefense        ; 1
    dw duck                            ; 2
    dw noaction                    ; 3
    dw turnaround                 ; 4
    dw walkarmsup        ; 5
    dw duckshuffle        ; 6 (down + left)
    dw noaction                ; 7
    dw walk            ; 8 right ...
    dw punch                    ; 16 (button)
    dw punchupwards        ; 17  (button + up)
    ... and so on, up to 31

Now, that's the normal table.
The first action of the code for, say, punchupwards, is to switch the table
that both the player and possibly the opponent look at.

The player's table for the punch state consists of, say, 16 entries "stop
punching" and 16 entries "continue the punch".  The "stop punching" code may
reverse the animation, and when it gets back to the start, set the vector
table for the player to "normal"
The "continue the punch" would let the punch animation keep running.  This
way, the player would need to hold down the button for the move to have
effect - you can bluff moves, for example, by letting the button go early -
the opponent might block slow moves, and you've meanwhile aborted the move
and started another designed to be more effective against the opponents'
block of your first move.

Collision detection ALSO changes the vector tables to which the players

The whole system is a state-based system, with vector tables giving the
actions to perform based upon inputs from the joystick and the current
state.  You never need lots of conditional code, as its all handled by the
vectoring through the appropriate tables.

The beauty is that you can automatically reconfigure the joystick actions
based upon the player's current state (and the opponent's).  For example, as
soon as the player enters a punch action, the opponent's state table can
reconfigure all "up" moves to "block high punch".  It makes for a much much
more responsive game, and means you don't have to remember lots of weird
joystick combinations.  It also allows you to multiplex a LOT of moves onto
just the up/down/left/right/button, because each joystick input can have
different effects (do different moves) based on the situation.

Its a long time ago, but I seem to remember having 46 moves multiplexed onto
the joystick on the NES version.  Hope that's all clear - it's the way I did
it in Exploding Fist.


Contact me on ICQ #3297382.  Visit my sites...
Museum of Soviet Calculators:
Slide Rule Trading Post:
Weird Computing Machines:

Archives (includes files) at
Unsub & more at

Current Thread