Does the A.I cheat when performing charge attacks?

Allegation:

When I was a kid, I swore that the Capcom artificial intelligence opponent cheated on the charge attacks, both vertical and horizontal.

Evidence:

My evidence for the horizontal charging was that the computer character would walk forward (or stand while not walking backward, while I was not attacking, and thus not be blocking, ergo not be charging back), then throw the charged attack in far less that the 2 seconds that would have required a human player to be holding back. The vertical charging discrepancy was not conclusively proven in my mind, but I think such cheating would be equally likely as the horizontal charging.

Possibilities:

I think the possibilities in terms of increasing complexity (and thus perhaps decreasing likelihood, based on Occam's Razor.)

  • The computer had a simple timer that prevented throwing the attack more than 2 seconds apart.
  • The computer has a directional key model, was carrying out the attacks with perfect charge timing, and I am simply wrong (but I doubt it!)
  • The computer had a disconnected directional key model allowing it to simultaneously press forward and back.
  • The computer would initially follow the rules (for easy difficulty levels) and begin to break them to increase the difficulty level.

Question:

Does the computer AI player cheat? What is the truth, and has this ever been proven?


Here's an example video where the A.I. player doesn't appear to charge at all. I recorded it using ZSNES and the World Warrior version of Street Fighter II, on standard difficulty.

In the video I control Ken and repeatedly trigger the A.I. Guile's flash kick by performing dragon punches at medium/close range.

The best example of this "cheating" is at about 00:20 when Guile performs a flash kick apparently without ducking at all.

Another video (not by me) of the faithful-looking Sega Saturn port of SF2CE shows Guile performing a sonic boom apparently from a standstill.

My hypothesis as to why this is possible:

The joystick manoeuvres are required solely to communicate the player's intention to the computer so that it can execute the move intended by the player. Let us assume that there is a state machine of some kind which watches the joystick inputs and converts them to a "move number" - perhaps an integer in the range 0-255, where each number represents a different move that can be performed by your character.

When implementing the computer-controlled opponent then, the programmers have two basic options:

  1. Have the opponent player routine (presumably, there would be one for each possible opponent, so 12 in this case) generate the same button presses and joystick movements used by the player, and have the game engine interpret them in the same way. This is perhaps a more modular way to go about writing the game, and would be more elegant and simpler in some respects, but it may be complicated to generate the fake joystick events as there is a temporal aspect to them.

  2. Or one could simply avoid the joystick event part altogether. The computer doesn't need to communicate its intended move by sending fake joystick events to itself - instead, it can directly indicate exactly what move it wants to perform, by setting the opponent's move number to the number corresponding to the desired move.

Based on the video I've posted which can easily be verified in the SNES, PC Engine and arcade versions of Street Fighter II, I would suggest that the second option above was used by the game programmers, and therefore that yes - the computer can "cheat", in the sense that it can instantly execute a move that requires a "charging" action when a human player executes it with the joystick.

However, the computer does sometimes appear to exhibit charging behaviour - especially when playing E. Honda, Chun Li and Blanka. I'm not sure if it's just simulating this play mechanic out of some kind of programmed fairness, or if there is another explanation. A disassembly and analysis of the arcade game code in MAME is possible using the debugger or other tools and would give us definitive answers, but would take some time.


There are a number of things at play here. I have done frame-by-frame analysis of the video, and have learned quite a bit about the mechanics of Street Fighter 2. But I also have some knowledge about the core mechanics of games like this as an active follower of the speedrunning and the Tool-assisted speedrun (TAS) communities. The timings for this type of thing are based on frames of input. Since I'm not a superhuman, I used an emulator and frame-advance to time exactly how many frames it takes for the player to make a charge attack work. A NTSC SNES runs at 60.0988 frames per second, which can cause some weird things to happen in recording. For the purposes of this, I will round that framerate to an even 60 frames.

Guile's Sonic Boom is performed by holding back for a specified number of frames, then pressing forward + punch. Using an emulator, I counted the number of frames of back input required, and came up with 60, exactly. This includes a down+back input. One real-time second. So where does the 2 second figure come from, you ask? Well, turns out the timer doesn't count in real-time; it's about twice as fast, ticking down every 31 frames (give or take).

The AI in this video, as you referenced, on the other hand, is able to pull off a Sonic Boom after approximately 45 frames.

So strictly speaking, can the AI perform charge attacks faster than the player (even the player with the fastest reflexes possible, the TASBot)? It appears so. But does that constitute "cheating"? Well, that's really a philosophical argument if you ask me, but, when one defines cheating as strictly "the ability to perform inputs faster than the player can even if the player gets it frame-perfect", it looks like it.


Yes. It does cheat.

No video analysis necessary. I have reverse engineered the AI engine. Any behavior that looks like charging or "button mashing" when the CPU executes a move is purely for show.

I can provide code snippets to back this up.

Here's exactly why charging isn't even possible:

The AI executes moves directly. The CPU is not sending directional and button input into the game engine like some posters seem to think it is.

The reason you see the illusion of "charging" is because Capcom included this on purpose to telegraph the way moves are done. For example, when performing E. Honda's hundred hand slap, the AI executes commands, in sequence, for two punches, then the call to execute the special move directly. The same goes for all moves where you see the character moving backwards to "charge." As another example, if you look at the code that performs Guile's flash kick in the middle of some of his rarer combos (yes, sequences have probabilities,) it is just called directly. There isn't even the possibility of the AI "charging down" because the AI is not "pressing" any buttons at all. It simply makes a call to execute the flash kick move.