Skip to controls
LEIAStreet Fighter RL

Street Fighter II: Special Champion Edition

Rainbow DQN Agent

© CAPCOM
↑ Demo

· controlling Ryu

Rainbow DQN Agent

street_fighter

Participants · LEIAFelipe Pacheco Zamorano · Diego Perea León · Santiago Saldaña Subías

Reinforcement learning model with and distributed training in Street Fighter II′: Special Champion Edition.

A learns to control Ryu against the twelve opponents, across eight Sega Genesis difficulty levels. The project explores how to represent a fight, learn attack sequences and sustain a strategy against increasingly difficult opponents.

Project date
Model used
· ·

What the policy observes

The extractor reads variables from the and them: both fighters’ health, relative position, distance to the wall, projectiles, velocities, facing direction and move codes. The screen lets a viewer follow the fight; the network’s inputs are those numerical variables.

Each state yields 23 extracted values. The identifiers of both characters are converted into vectors of 16 categories: each state becomes 53 values, and four are stacked, for a total of 212. That recent history helps distinguish a step, a jump and an advancing projectile. The selected difficulty is not added as a policy input.

FIGURE 1 / FROM THE EMULATOR TO THE NETWORK
  1. RAMInternal state of the fight
  2. 23 valuesNormalized variables
  3. 53 / stateOne-hot identities
  4. 212 values4 recent states
23 − 2 identifiers + 32 indicators = 53 values per state. By stacking four states, the network receives information about how the fight changes over time.

What it can do

The network chooses among 72 actions. The first 63 combine nine directions—including neutral—with seven attack options: no button, three punch strengths and three kick strengths. A is held for four .

The other nine are : light/heavy Hadouken, light/heavy Shoryuken, light/medium Tatsumaki, forward/backward jumps and a blocking sequence. The sequences were defined by hand; the policy learns when to select them. They execute two or three primitives and are mirrored when the opponent switches sides.

FIGURE 2 / ONE ACTION, THREE PRIMITIVES
Opponent on the
↓Down · 4 frames
↘Down + forward · 4 frames
→ + HPForward + heavy punch · 4 frames
The network learns when to throw the Hadouken. The button sequence is defined in advance and oriented toward the opponent.

How it computes an action

The network contains 1,077,131 . An transforms the input through two layers of 256 units with . The architecture then separates the value of the state from the advantage of each action.

Instead of assigning a single number to each action, the branches produce 51 of the . Combining them yields 72 . Their mean is the ; during evaluation the agent chooses the largest.

FIGURE 3 / DISTRIBUTIONAL DUELING NETWORK
212Observation
256 → 256Shared trunk · ReLU
V(s, i)51 state values
A(s, a, i)72 × 51 advantages
Purple blocks: parameters adjusted during training.
θ(s, a, i) = V(s, i) + A(s, a, i) − meana A(s, a, i)
Q(s, a) = mean of the 51 θ(s, a, i) · action = Q(s, a)
s is the state, a an action and i one of the 51 quantiles. Subtracting the mean advantage makes the two branches separable. The mean summarizes the expected return of each action; the distribution retains information that a single value does not show.
FIGURE 4 / THREE ACTIONS FOR ONE REAL INPUTPredicted return quantiles for Heavy Hadouken, Neutral and Heavy Shoryuken for a frozen observation from checkpoint 3291.
Heavy HadoukenQ 59.13NeutralQ 56.04Heavy ShoryukenQ 49.26
Model predictions for a real fight state against Sagat at level 1. Heavy Hadouken has the highest Q among the 72 actions. These curves estimate future rewards, not win probabilities.

What it learns and why it is called Rainbow

The project combines improvements from with . It uses quantile regression for the distributional component, and exploration instead of . That choice avoids fixing a in advance for the return scale of this game.

The online network selects the next action; a target network estimates its value to build the learning target.
Shares the representation of the fight and separates how favorable the state is from the advantage of each decision.
Reuses experiences and samples those with large prediction errors more often, correcting for the sampling bias.
Combines several rewards before estimating what remains to be received. Here three steps are combined with a .
Fits the return distribution of each action. The 51 points are learned estimates, not a distribution of random button presses.
Is updated less often than the online network, so that the targets do not change at the same rate as the policy.

Training modifies the . The RAM extractor, the character encoding, the primitives and the macro sequences remain defined by the environment. Once trained, the agent uses those weights to make decisions during the fight.

The reward signal

The reward combines damage dealt/received, round outcome, a time cost and positional . Winning yields a positive reward; losing or drawing adds a penalty. The agent also receives signals during the round. The positional component uses the discounted change of a distance potential.

How training was distributed

separates collecting experience from training. Each runs emulators, explores with its own ε and sends . A central maintains the replay, samples and updates the network on a . It then publishes new weights to the actors.

FIGURE 5 / EXPERIENCE AND WEIGHTS
  1. ActorsEmulators · different ε
  2. Central replayPrioritized transitions
  3. LearnerBatches and on GPU
  4. WeightsNew snapshots to the actors
Experience flows to the learner; updated weights return to the actors. In this way, different fights contribute to the learning of a single policy.

The broadened the distribution of difficulties: first the low levels and then all eight, with more experience at the high levels and a mix that retained the low ones. The agent keeps encountering easy opponents while it learns to face the most demanding ones.

Replay makes it possible to learn from earlier experiences: each update takes a batch of transitions, compares the predictions with the observed rewards and adjusts the network weights.

A year of development

  1. September–October 2025

    The first agents learned by looking at the screen

    The team began experimenting with gym-retro and . Frames were converted to grayscale, downscaled to 84 × 84 pixels and stacked in groups of four. A learned to choose button combinations; damage and victory rewards were explored, along with settings.

  2. March–April 2026

    From pixels to fight variables

    The team built an environment on BizHawk that connects the game to training in Python. The agent switched to observing health, positions, velocities and projectiles through the game memory. This representation made explicit the information needed for learning; curriculum training introduced opponents and difficulty levels gradually.

  3. May–June 2026

    More ways to train and compare

    The action spaces, the automatic curriculum and the tools for inspecting decisions were expanded. Agent-versus-agent tests and a league structure were also added to explore training against learned opponents. PPO was the basis of development in this stage.

  4. August 2026

    Comparing evolution strategies and distributional learning

    policies and a Rainbow DQN variant with quantile regression were studied. Evaluation began to vary the starts and to inject noise into the actions, in order to distinguish a strategy that repeats a sequence from one that responds to changes in the fight. The reward signal was also revised so that winning and losing produced correct incentives.

  5. August 2026

    Distributed training and full matches

    made it possible to gather experience from several emulators. Macro actions were added and training was extended to all eight CPU levels. Evaluation moved from an opening round to best-of-three matches, where the agent has to sustain its performance across the transitions between rounds.

The stages explore different representations and methods. The first image-based agents and the league tests are part of the history; the benchmarks that follow correspond to the policies evaluated on memory variables against the CPU.

Results

The difficulty, the length of the test and the variation of the start change what is being measured. That is why winning the first and winning a produce different percentages.

Rainbow DQN · model 3291 · what each result means
TestWinsResultWhat it measures
Full matches · level 8323 / 36089.7%Winning two rounds before the opponent. 30 matches against each CPU opponent.
First round · level 890 / 9693.8%Winning only the opening round at the maximum difficulty.
First round · levels 1–8758 / 76898.7%Average with the same number of at each difficulty.
First round · levels 1–496 / 96 per level100% observedNo losses in those benchmarks; it does not mean winning every possible match.

These tests use the twelve opponents, a of up to 30 steps and no noise added to the actions. The average over eight levels includes easier CPU opponents: it is not equivalent to the result at the maximum difficulty.

Model comparison · level 1

Two policies, three evolutionary variants and two Ape-X stages were compared on the same twelve initial states. Three conditions were applied: , random start offset and .

FIGURE 6 / MODELS WITH A VARIED STARTComparison of rounds with start offset: PPO 39.7M 67/72, PPO 31M 58/72, scalar ES 46/72, one-hot ES 54/72, perturbed ES 57/72, Ape-X 90k 66/72, Ape-X 511 96/96.
Wins over opening rounds. The bars show for the episodes of each benchmark; they do not measure variation across independent training runs.
Opening rounds won · percentage and count
Model
90.6%87 / 9693.1%67 / 7295.8%69 / 72
74.0%71 / 9680.6%58 / 7281.9%59 / 72
83.3% †20 / 2463.9%46 / 7276.4%55 / 72
75.0% †18 / 2475.0%54 / 7265.3%47 / 72
83.3% †20 / 2479.2%57 / 7256.9%41 / 72
100.0% †24 / 2491.7%66 / 7295.8%69 / 72
100.0% †24 / 24100.0%96 / 96100.0%96 / 96

How to read the 100%

† With the of DQN and OpenES and a fixed start, repetitions can produce exactly the same fight. That 100% describes the benchmark’s sequences; repeating them does not add independent matches. The offset and the noise change the conditions to test how much the agent depends on that sequence.

A 100% with offset means there were no losses in the observed sample. It is still a limited set of states and perturbations, with starts that can repeat. The intervals also do not capture every source of uncertainty. In this comparison PPO selects actions ; DQN and OpenES choose their highest-scoring action. The training budgets differ.

Difficulty · model 3291

First round · 12 opponents × 8 episodes at each level
levelWinsPercentage
196 / 96100.0%
296 / 96100.0%
396 / 96100.0%
496 / 96100.0%
595 / 9699.0%
695 / 9699.0%
794 / 9697.9%
890 / 9693.8%
Progression of Rainbow DQN by difficulty

Three of the same agent, evaluated with offset on the same benchmarks. The panels compare models 511, 1212 and 3291 at levels 1–6, and models 1212 and 3291 at levels 7–8.

Percentage of rounds won: models 511, 1212 and 3291 at levels 1 to 6, and models 1212 and 3291 at levels 7 and 8.

3291 identifies a snapshot of the weights during training; it is not a generation number. Each cell summarizes 96 first-round episodes.

Full matches · maximum difficulty

Winning a match requires two round wins. The result of 323/360 is 89.7%, with a of 86.2–92.5%. Most losses are concentrated against Balrog, Guile and E. Honda: 35 of the 37 losses.

FIGURE 7 / FULL MATCHES BY OPPONENT · LEVEL 8Matches won at level 8: Balrog 16/30, Guile 19/30, E. Honda 20/30, M. Bison 28/30 and the remaining eight opponents 30/30 each.
30 matches per opponent, best of three, with an initial offset and no added noise. A 30/30 means that opponent did not win in this sample, not that the agent is invincible.
Counts and intervals by opponent
OpponentWinsPercentage
Balrog16 / 3053.3%36.1–69.8%
Blanka30 / 30100.0%88.6–100.0%
Chun-Li30 / 30100.0%88.6–100.0%
Dhalsim30 / 30100.0%88.6–100.0%
E. Honda20 / 3066.7%48.8–80.8%
Guile19 / 3063.3%45.5–78.1%
Ken30 / 30100.0%88.6–100.0%
M. Bison28 / 3093.3%78.7–98.2%
Ryu30 / 30100.0%88.6–100.0%
Sagat30 / 30100.0%88.6–100.0%
Vega30 / 30100.0%88.6–100.0%
Zangief30 / 30100.0%88.6–100.0%

Scope

The results correspond to Ryu against the CPU of Street Fighter II′: Special Champion Edition, using memory variables and predefined macros. They do not establish performance against humans, nor with other characters, editions or initial states outside the evaluated benchmark.