· controlling Ryu
Rainbow DQN Agent
street_fighterParticipants · 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.
- RAMInternal state of the fight
- 23 valuesNormalized variables
- 53 / stateOne-hot identities
- 212 values4 recent states
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.
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.
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.
- ActorsEmulators · different ε
- Central replayPrioritized transitions
- LearnerBatches and on GPU
- WeightsNew snapshots to the actors
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
- 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.
- 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.
- 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.
- 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.
- 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.
| Test | Wins | Result | What it measures |
|---|---|---|---|
| Full matches · level 8 | 323 / 360 | 89.7% | Winning two rounds before the opponent. 30 matches against each CPU opponent. |
| First round · level 8 | 90 / 96 | 93.8% | Winning only the opening round at the maximum difficulty. |
| First round · levels 1–8 | 758 / 768 | 98.7% | Average with the same number of at each difficulty. |
| First round · levels 1–4 | 96 / 96 per level | 100% observed | No 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 .
| Model | |||
|---|---|---|---|
| 90.6%87 / 96 | 93.1%67 / 72 | 95.8%69 / 72 | |
| 74.0%71 / 96 | 80.6%58 / 72 | 81.9%59 / 72 | |
| 83.3% †20 / 24 | 63.9%46 / 72 | 76.4%55 / 72 | |
| 75.0% †18 / 24 | 75.0%54 / 72 | 65.3%47 / 72 | |
| 83.3% †20 / 24 | 79.2%57 / 72 | 56.9%41 / 72 | |
| 100.0% †24 / 24 | 91.7%66 / 72 | 95.8%69 / 72 | |
| 100.0% †24 / 24 | 100.0%96 / 96 | 100.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
| level | Wins | Percentage |
|---|---|---|
| 1 | 96 / 96 | 100.0% |
| 2 | 96 / 96 | 100.0% |
| 3 | 96 / 96 | 100.0% |
| 4 | 96 / 96 | 100.0% |
| 5 | 95 / 96 | 99.0% |
| 6 | 95 / 96 | 99.0% |
| 7 | 94 / 96 | 97.9% |
| 8 | 90 / 96 | 93.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.
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.
Counts and intervals by opponent
| Opponent | Wins | Percentage | |
|---|---|---|---|
| Balrog | 16 / 30 | 53.3% | 36.1–69.8% |
| Blanka | 30 / 30 | 100.0% | 88.6–100.0% |
| Chun-Li | 30 / 30 | 100.0% | 88.6–100.0% |
| Dhalsim | 30 / 30 | 100.0% | 88.6–100.0% |
| E. Honda | 20 / 30 | 66.7% | 48.8–80.8% |
| Guile | 19 / 30 | 63.3% | 45.5–78.1% |
| Ken | 30 / 30 | 100.0% | 88.6–100.0% |
| M. Bison | 28 / 30 | 93.3% | 78.7–98.2% |
| Ryu | 30 / 30 | 100.0% | 88.6–100.0% |
| Sagat | 30 / 30 | 100.0% | 88.6–100.0% |
| Vega | 30 / 30 | 100.0% | 88.6–100.0% |
| Zangief | 30 / 30 | 100.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.
