   How to implement Combos in fighting games (like Marvel vs Capcom type games)
  So yah that is pretty much my question. How would I go about implementing combo systems in Marvel vs Capcom type of games? You know where they have insane air combos and such. Just hit me up with some ideas or if you know how past fighting games handled this let me know. Thanks for any input. 
For each character, keep a buffer of the last N buttons pressed, as well as the timestamp of WHEN they were pressed.At this point, it is simple a matter of writing some code thatcan look at this buffer and determine if it represents a combo... IE, is the sequence of buttons right? Did they happen fast enough? If so, this is a combo...Now, trickier is branching combos... For instance, perhaps a sequence like the above first triggers a "DOING COMBO" state... After this, incoming input determines, if happening quick enough, what combo to go into...Tony ;  ok cool, how would you keep a list of acceptable combos and combinations? Would a database be the most efficient way?  ;  For a simple 1st-time game, manually set up the combos within the program as booleans in an array, and get them working. Once you have the concept down and functional, you can branch out to disk-stored text/dat files, and eventually evolve to MySQL  matrix³[ email | web | apple gl | linux gl | opengl | freeglut | glui | lua ]#ifndef _SCO_H#define _SCO_H#define EVERYTHING#endif    [edited by - MatrixCubed on February 16, 2004 2:56:41 PM];  hm.. shouldnt a tree work fine? with every button press you check a list of possible presses and see if your below a time limit. if so, go to the next node, else return to the root. so at any point you could have as many "paths" as you like. if you allow nodes further down to link to nodes further up you have to be careful not to create annoying endless combos.ie:struct action { button btn; float secs;}struct node { list > child;} ;  Chances are your character''s moves are stored as a series of keyframes, right?Say you have Stand, PunchStart, PunchDamage, PunchEnd, KickStart, KickDamange, KickEnd, GuardStart, GuardDefend, GuardEnd.Now, suppose one sets up a table showing how each frame changes according to which key is pressed, or if no key is pressed:Frame\Key   *None* Punch  Kick   GuardStand  Stand  PunchStart  KickStart   GuardStartPunchStart  PunchDamage - - - PunchDamage PunchEnd    - - - PunchEnd    Stand  - - - KickStart   KickDamage  - - - KickDamange KickEnd- - - KickEndStand  - - - GuardStart  GuardDefend - - - GuardDefend GuardEnd    - - - GuardEnd    Stand  - - -   Note that there are no frame changes for the keys in many of the frames. What this indicates is that the *None* frame is used, and the key input is ignored.This table is sufficient for a primitive fighting game.There are actually a few things you can with ''combos'', not all of which are necessarily what you''d consider combos. One example is:Frame\Key   *None* Punch  Kick   GuardPunchStart  PunchDamage - - PunchCancelKickStart   KickDamage  - - KickCancel PunchCancel Stand  - - GuardStartKickCancel  Stand  - - GuardStart  In this example, one can cancel an attack move and start to guard after a delay.Proper combos can be implemented similarly:Frame\Key   *None* Punch  Kick   GuardPunchStart  PunchDamage - PKStartPunchCancelPKStartPKDamageP   - - PKCancelPKDamageP   PKDamageK   - - - PKDamageK   PKEnd  - - - ...  Here, pressing Punch,Kick causes a PunchKick attack, which is a punch followed immediately by a kick.Frame\Key   *None* Punch  Kick   GuardPunchStart  PunchDamage - PKStartPunchCancelPKStartPKDamageP   - SpinDamageP PKCancelSpinDamageP SpinDamageK - - - SpinDamageK SpinEnd- - - ...  Here, Punch,Kick,Kick causes a punch followed by a spinning kick.Note that because we ignore the key input when the state table contains a "-", there may be some leeway in entering combos, as in the following example:Frame\Key   *None* Punch  Kick   GuardKickStart   KickDamage  - - KickCancelKickDamage  KickEnd- KickDamage2 -KickDamage2 KickEnd2    - - -KickEndStand  - KickDamage3 -KickDamage3 KickEnd2    - - -KickEnd2    Stand  - - -  Here, pressing Kick,Kick causes a double kick via KickDamage and KickDamage2. Because the kick button is ignored during kick start, you can press it any time between the beginning of KickStart and the end of KickDamage, and still trigger the combo.Note KickDamage3. This can only be triggered by pressing Kick during KickEnd. This combo is harder not only because you have less time to press it in, but also because if you press it too soon, you trigger the other combo, which will probably be less powerful.So an advanced player, with better timing, can access powerful combos, but the novice still has the sense of acheivement of finding less powerful combos.Of course, this table is very simplistic. In reality, you''ll probably want to deal with e.g. multiple keys at the same time, directional keys, fighting stances.At some point, it may be that the state transitions become too complex to be tables, and you''ll need to write them as programs. 