don't click here

Street Fighter II CPU AI

Discussion in 'Technical Discussion' started by Dr. Ivo, Sep 14, 2011.

  1. Dr. Ivo

    Dr. Ivo

    Professional Reverse Engineer Tech Member
    I've reverse engineered the AI (and difficulty) system. A few interesting things to note: in 2P battles, the losing player is given an "advantage" in the second round; many things are randomized, including damage; the difficulty of the game increases steadily during rounds; the red hadouken is nothing but a palette swap and is triggered randomly; Vega's claw drop is random (after a point); damage is heavily metered towards the "end" of a match to make it last as long as possible with low "health bars." There is quite a bit of effort put into giving losing players an advantage to make matches seem as "close" as possible. I have the exact statistics for all of the randomness, if anyone is interested.

    Is anyone else interested this information?

    I ought to mention that all AI behavior is completely editable without bothering with assembly. For reference, I have the AI state machine for Guile completely decoded.
     
  2. Steven M

    Steven M

    Member
    394
    0
    0
    Working on a puzzle/fighting game and somewhat struggling with the AI aspects, so I'd appreciate this information.
     
  3. ICEknight

    ICEknight

    Researcher Researcher
    That stuff is pretty interesting, I've always wondered about what really triggered Vega's claw and turns out it was pure luck. Thanks for sharing!
     
  4. Glitch

    Glitch

    Tech Member
    175
    12
    18
    I'd really like to take a look at that. Do you have any documentation that you'd be willing to upload somewhere?
     
  5. Dr. Ivo

    Dr. Ivo

    Professional Reverse Engineer Tech Member

    I have plenty of notes plus the commented code, but I'd need to spend some time making it into something that would make sense to someone who hasn't already spent hours with the engine.

    I also have all of the player states documented along with the order of tests and the control flow. If anyone is thinking about making a fighting game, it might prove useful to take a peek at the architecture of the game that brought the genre to life.

    Also documented is the entire format for the animations/attacks and parameters. It is rather interesting. For example, each frame of animation has 12 non-animation related parameters. Each frame in an attack frame sequence has an extra 10 parameters. Much of the player state is encoded directly in the animations themselves.
     
  6. Cooljerk

    Cooljerk

    NotEqual Tech, Inc - VR & Game Dev Oldbie
    4,505
    201
    43
    I'd love to read this.
     
  7. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    I would also love to read this. And I will submit that folks over at TasVideos working on SF2 TASes might also find this supremely useful.
     
  8. Tiberious

    Tiberious

    Yeah, I'm furry. Got a problem? Oldbie
    777
    15
    18
    I'm assuming this is for World Warrior?

    I know there's a partially-completed hack to enable the bosses for player selection, but it never got completed, and there's... problems.

    For one, the game assumes they're normal characters, and have throws (only Vega and Bison do in WW, and NONE of the bosses have boss-vs-boss throw reaction schemes), and assigns special motions based on the character they're 'copying'.

    Maybe your insights would lead to the first real WW boss hack...

    Edit: Ooh! Another possible idea... maybe hack WW bosses into Hyper SF2? Assuming you can disassemble CPS2 as well as CPS1, of course.
     
  9. LOst

    LOst

    Tech Member
    4,891
    8
    18
    I am interested in the randomizer. It is such a big part in a game's mechanics. I wouldn't be surprised if I have seen that randomizer before as I have worked with a derived Capcom game in the past.


    Good stuff!
     
  10. Cooljerk

    Cooljerk

    NotEqual Tech, Inc - VR & Game Dev Oldbie
    4,505
    201
    43
    Any chance of a follow up on this thread?
     
  11. null1024

    null1024

    Member
    161
    0
    16
    Oh wow, this info explains loads.
    I always did wonder why I'd always get my opponent's lifebar down to nearly zero, where you couldn't see it anymore but they weren't KO'd yet. It was fairly consistent, like every 1 in 5 or so matches, which always seemed a bit odd.
     
  12. Are you going to share this on SRK? I'm sure they would be very interested in the information.