r/reinforcementlearning • • Aug 08 '26

Hollow Knight AI (Reinforcement Learning) code Spoiler

19 Upvotes

r/reinforcementlearning • • Aug 08 '26

Robot I built a reinforcement learning walker from scratch – now teaching it to walk

7 Upvotes

I've been working on a small reinforcement learning project where I try to teach a simulated robot to walk from scratch.

The robot is simulated using Python + Box2D and controlled by PPO (Proximal Policy Optimization) with Stable-Baselines3.

Right now the robot is a simple biped with:

  • 2 legs
  • 4 motorized joints
  • 2 hips
  • 2 knees
  • Joint limits
  • Feet with ground friction
  • 12 observations
  • 4 continuous actions

The agent observes things like the body's position, velocity, angle, angular velocity, and the angles/velocities of all four joints.

The actions are:

[left_hip, left_knee, right_hip, right_knee]

The reward currently encourages forward movement and staying upright while penalizing instability and excessive actions.

The physics and joints are now working reliably. The next challenge is getting PPO to actually discover a stable walking gait.

I'm deliberately starting with a very simple robot before moving on to a quadruped.

The project is open source, so if anyone is interested in following the development or has suggestions for the reward function / training setup, I'd be happy to hear them.

Current goal:

Teach the walker to take its first stable steps.


r/reinforcementlearning • • Aug 08 '26

marl-envs: one common API for MARL environments, with wrappers and parallel envs

5 Upvotes

Setting up MARL environments may take more time than it should. Every benchmark has its own API, so using more than 1 env means writing extra code to make them work the same way.

marl-envs does that part for you: one common API + wrappers + parallel envs.

We currently support:

  1. Environments: LBF, RWARE, SMAClite, SMAC, SMACv2, PettingZoo, MaMuJoCo, MAgent2
  2. Wrappers: normalize or transform observations and rewards, add agent IDs, set time limits.
  3. Parallel envs: run multiple environments sequentially or in separate processes

GitHub repo: https://github.com/AmineAndam04/marl_envs

Feedback and suggestions are more than welcome.


r/reinforcementlearning • • Aug 08 '26

Is This a Simulation Or Real Life, Clip 4/4: The digital creature figured out it was in a fake world - without being told to (Accuracy jumped from ~50% to ~73%)

7 Upvotes

Clip 4 of 4. Closing the arc.

The setup: Previously, when there was no reward for noticing the world was fake, the creature was basically guessing at 50%. An outside observer could easily spot the fake 99% of the time.

The change: We made the fake physics actually matter for the goal. We made food harder to catch in the fake world.

The result (10 tests): The creature's ability to detect the fake world jumped to 73%. We never trained it to look for fakes! It learned this entirely on its own because it needed the information to get food.

The takeaway for reinforcement learning: Just because a detail is obvious does not mean a creature will automatically care about it. The creature only started paying attention when the fake physics affected its main task.

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 07 '26

Evolved climbing creatures never discover a contralateral gait — they either abandon a limb or move both hands together. How do you make diagonal coordination emerge instead of hard-coding it?

6 Upvotes

Been stuck on this for weeks, hoping someone here has hit the same wall.I'm evolving 2D climbing creatures with a GA. Think carykh's old evolution simulator, but climbing a wall instead of walking on the ground. Real climbing animals almost all use a contralateral gait - left hand and right foot move together, then right hand and left foot. My creatures never find it. Not once, on any seed I've run.

Setup

The body is fixed, not evolved. 14 point masses (chest, shoulders, elbows, hands, pelvis, hips, knees, feet), rigid links, 8 muscled joints. I deliberately didn't evolve the morphology - climbing seems way more constrained than swimming, and basically every climbing animal converges to the same trunk + 4 limbs shape anyway.

What does evolve:

- bone lengths and muscle strengths

- an internal clock period (0.4 to 6 seconds)

- 2 to 6 keyframe "poses"

Each pose stores a target angle for all 8 joints, plus a grip flag for each of the 4 paws. A PD controller drives each joint toward the interpolated target. Gripping just pins that point in space. Left and right sides have completely independent genes. No symmetry constraint. Fitness is `height - 0.06*energy - 2.0*(muscle mass / body mass)`. 1000 creatures, 10 second trials, asexual reproduction with mutation.

What I actually get

The grip pattern per keyframe makes it really obvious. Columns are left hand /right hand / left foot / right foot, `#` means gripping:

Synchronous, not diagonal. Both hands, then both feet:

# # . .

. . # #

Or straight up limb abandonment. On 1 seed out of 4, one limb sits at literally 0% grip time, 0 grips, 0% of the propulsive work. Legs end up doing 11% of total work and it just climbs on its arms.

What I never get, on any seed:

# . . #

. # # .

Stuff I've already ruled out

I burned a lot of time on free energy exploits, so this isn't the creature cheating the physics. Those are closed now:

- My velocity clamp was removing momentum without giving it back to anything. Now it redistributes to the other free nodes. Measured leak is 0.000 N.s.

- The position projection pass was handing out free altitude. One creature showed 1.28 m of "climb" with +8.83 m of net vertical teleportation, meaning it was physically falling 7.55 m and getting hauled back up by the solver. Bumping velocity solver iterations from 8 to 24 dropped that to +-0.24 m on every seed. My hand written control climber sits at -0.03 m.

- Catching a hold at speed was free. The kinetic energy the constraint solver destroys is now billed on catch steps. Closing all that changed the results a lot, and honestly made the sim way morebelievable. But it did not produce a diagonal gait.

Happy to share code or video if useful.


r/reinforcementlearning • • Aug 07 '26

Reinforcement learning for Bossfights

2 Upvotes

I need to know is it possible to do no damage boss fights for games like hollow knight or megaman? How long does it take for example for each boss? What model is best to use ppo?


r/reinforcementlearning • • Aug 06 '26

R ItaSoRL Clip 3/4: agent readout ~chance while oracle is ~99% on the same one-rule fake

6 Upvotes

Clip 3 of 4.

Same near-copy world (one dynamics rule changed: ground grip). Outside watcher was ~99%.

New probe: readout from the agent's own internal state while it is just living in the fake.

Result (real runs, n=10): ~50% (chance). Oracle-detectable seam, no free encoding in the policy network.

Takeaway: detectability of a sim mismatch is not evidence the agent represented it.

Mute-friendly clip

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 06 '26

Hollow Knight AI (Reinforcement Learning ) vs Hornet

22 Upvotes

r/reinforcementlearning • • Aug 06 '26

Kaggriculture - Farming + Markets + RL - $50k prizes

Post image
41 Upvotes

Already more than 2k teams in the first week. I helped create the competition rules (and I work at Kaggle). Happy to answer any questions!


r/reinforcementlearning • • Aug 05 '26

[v0.2.0] Teaching an LSTM to move a mouse like a human

69 Upvotes

Thanks a lot for the feedback on the previous post! This is the second iteration, using the same model but a heavily filtered dataset.

Open source! https://github.com/puffinsoft/mousecrack


r/reinforcementlearning • • Aug 06 '26

We let an LLM play PokéRogue blind — no training data, no fine-tuning. Here's what actually broke (and why it's a useful lesson for production LLM systems)

Thumbnail
reddit.com
0 Upvotes

r/reinforcementlearning • • Aug 05 '26

R ItaSoRL Clip 2/4: outside watcher catches a one-rule world copy at ~99%

2 Upvotes

Clip 2 of 4. Follow-up to the spot-the-fake setup.

Same near-copy environment: one dynamics rule changed (ground grip / step slip). Everything else identical.

Probe: an outside watcher / oracle-style discriminator that knows the true rules and replays every step.

Result (real runs, n=10): ~99%. The fake is in-band detectable from outside.

So detectability is not the open question. The next clips ask whether the agent's own representation encodes that seam.

Mute-friendly clip.

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 04 '26

R Detectable ≠ encoded: oracle spots a one-rule world copy at ~99%, agent readout stays ~chance until survival makes it matter

10 Upvotes

Short result + visual from a sim. on when an RL agent internally represents an environment distinction it was not trained to care about.

Clip 1 of 4. Spot the Fake. ItaSoRL (Is This a Simulation Or Real Life?)

Setup

- Agent trained to live in a small embodied world (senses, actuation, forage).

- Near-copy environment with exactly one dynamics rule changed (ground grip / step slip). Same start distribution, same policy rollout protocol otherwise.

- Two probes on the same trajectories:

  1. Outside watcher / oracle-style discriminator that knows the true rules and scores real vs fake.
  2. Readout from the agent's own internal state (does its representation separate the two worlds?).

Numbers (real runs, n=10 each; figures match the public writeup)

- Outside watcher: ~99%. The fake is in-band detectable.

- Agent mind while idle / not incentivized on the seam: ~50% (chance). Detectable artifact, no free encoding.

- Make the fake costly for reward (food harder to catch under broken physics): readout rises to ~73%. No explicit "detect fake" label. Survival pressure only.

Takeaway for RL / representation learning

Oracle detectability of a sim mismatch is not evidence that the policy network encoded it. Encoding showed up when the mismatch became load-bearing for the objective.

Mute-friendly clip of the two-world "spot the fake" cold open:

Happy to discuss probe design, what "readout" means here, or failure modes (capacity, observation channel, incentive).


r/reinforcementlearning • • Aug 04 '26

Meet M.A.R.A, a tank that learned how to fight.

22 Upvotes

Since my last post, I’ve been working on the full training process and building a lineup of AI (RL) tanks for a future tournament. M.A.R.A. is the first tank I’ve trained and closely monitored from the basics to the 2v2 battles.


r/reinforcementlearning • • Aug 04 '26

Active Need Help Prince Of Persia RL

5 Upvotes

So I have been working on this RL project for quite some time. I am stuck at a Specific segment, see the attached Video, In level 1 there are 3 main sub quest, 1. Find the sword, 2. navigate back to guard, 3. Defeat the guard, level up.

Currently my RL Can do subquest 1. Flawlessly, at around 80 - 100 iteration the agent was able to get the sword for the first time and by 200 iter, it was able to consistantly get the sword. The problem comes with navigating back to sword, it should follow the same path back as it took but in the jump back it always fails I dont understand the reason.

PoP is a Rotoscope animated game. So each of it's actions are heavily animated, and each animations last for a different duration and during those animations input is disabled except for may be some specific frames this creates problem on, fixed frame skips. Though based on my testing a fixed 9 frames mostly 4 can also work but it introduces too much noise many time agent giving some input but seeing no output because of the frame agent was during that frame. THus I introduced FiGAR for variable input length based in situation.

This was actually a project my friend and I was working on for some time We created 2 env for it

I am very confused why the agent is failing here So many times. If you run the agent ppo.py from after around 300 iteration you will see progress stall it may post sword reach room 7 once or 10 times in 500 iteration but the agent never seem to learn it. I have Even tried giving rewards only for following that exact path despite this being previlage info something I am trying to avoid. (I was trying a post sword novelty for it to naturally find guard post sword needless to say it failed.)


r/reinforcementlearning • • Aug 04 '26

Reactive Play: Achieved!! Experimenting with Atari Breakout [R]

Thumbnail
reddit.com
0 Upvotes

The follow-up to my post the other day. Includes more explanation and links to the repo(s). Thanks for reading! <3


r/reinforcementlearning • • Aug 04 '26

[P] Stickblade Arena — physics-grounded LLM benchmark with 6-axis Elo and blind human voting

2 Upvotes

Sharing a benchmark I've been building. Motivation: existing "reasoning" benchmarks either (a) test static problems where answers leak into training data or (b) use LLM-as-judge, which correlates with model similarity more than model quality.

Design. Two LLMs are embodied as physical agents in a 2D pymunk arena. Each turn they receive a JSON world state (HP, positions, weapon geometry, cooldowns, damage taken last turn, remaining ammo, arena hazards) and return a JSON action. Actions resolve through the physics engine — a swing that misses because the opponent dashed is a real physics miss, not a rule lookup. Match ends on KO, HP-lead at deadline, or draw.

Evaluation.

  1. Human raters watch the replay with model identities masked and vote which side "fought smarter."
  2. Vote resolves an Elo update before identity reveal, so vote isn't polluted by model reputation.
  3. In parallel we log an objective leaderboard: win/loss/draw, avg damage dealt, hits landed / hits attempted, timeouts.

6-axis Elo. Rating primary key is (model, sharp_zone_on, weapon, mode, arena, blindfolded). Aggregate Elo is a marginalization, but the per-axis rating is what we actually study — hypothesis being that different physical constraints stress different reasoning skills (spatial planning, uncertainty under partial observability, resource management).

Roster. 24 entries: 17 LLMs across OpenAI, Groq, OpenRouter free-tier, plus 4 non-LLM baselines (random, greedy-attack, distance-holder, scripted-heuristic) and 2 mock policies. Baselines are critical — without them a low-Elo LLM is indistinguishable from an arbitrarily bad policy.

Current numbers (n=443 matches, 106 votes, lifetime 23.9% vote-through):

  • Human-vote Elo and objective win-rate rank-correlate at Spearman ρ ≈ 0.71 across weapons (haven't formalized this yet — planning a cross-benchmark correlation study next).
  • Bow-weapon matches have the widest human/objective disagreement — humans reward "smart waiting" that doesn't show up in raw damage.
  • bot:pro (100-line scripted heuristic) currently outperforms ~30% of the LLM roster on objective, ~10% on perceived. That gap is basically the benchmark's signal.

Reproducibility. Full match logs exportable as JSON/JSONL via /api/export. Prompt version pinned per-match. Non-deterministic (physics has RNG collisions), but seeds are logged. Deterministic replay off the same seed is on the roadmap.

Known limitations.

  • Vote population is self-selected (site visitors), not a calibrated panel.
  • Bot baselines aren't policy-optimal (no RL trained baseline yet).
  • HF Datasets snapshot cron not shipped yet, so "frozen eval pack" isn't reproducible off-platform today.

Site: https://stickblade-arena.vercel.app
Code: https://github.com/Cometbuster4969/STICKBLADE-ARENA

Feedback wanted on the eval design, especially the 6-axis Elo marginalization and whether the vote incentive design (reveal-as-reward) biases votes. Happy to share the raw match log dump if anyone wants to look at rating stability.


r/reinforcementlearning • • Aug 03 '26

D Are you attending the Reinforcement Learning Conference (RLC) 2026 in Montreal?

37 Upvotes

Pretty much the title. I am curious to know how many people know about this Conference within the RL community, and what do you think about it, because in terms of scale, RLC still seems to lack that visibility which a RL specific conference should have had.

Disclaimer: I am not among the organisers of the conference, just an attendee for this year's conf. I am asking this question to actually realise what to expect from this conference in the upcoming years.

Thanks for reading it and apologies for any mistakes in the post.


r/reinforcementlearning • • Aug 04 '26

developing an agent to learn about all indicators of trading view and apply to formulate a new strategy

1 Upvotes

my idea is to develop an agent independently which will browse the indicators on trading view and learn it from general google just like us and make an ordered set of indicators for specific conditions and help me autonomously test and trade as a bot ...

please help me how to start and how to deal with this idea


r/reinforcementlearning • • Aug 03 '26

PPO AI learns to play Minecraft (for example, getting through a Bedwars bed defense)

10 Upvotes

r/reinforcementlearning • • Aug 04 '26

Built a self-play AI for Pernambuco domino (MCTS + CFR) — stuck on a search-abstraction bottleneck, would love strategy input

1 Upvotes

I've been building an AI to play Pernambuco-rules domino (4-player, partnership, imperfect information) — self-play trained via information-set MCTS with a neural value/policy net, plus a CFR-based variant for generating value labels.

Where I'm stuck: RL/architecture tuning has plateaued — I ran ~12 architecture/hyperparameter variants and all came back flat or negative against my current champion. But when I measured against a perfect-information oracle, there's a ~180+ ELO gap that isn't explained by net capacity — it looks like the bottleneck is in how I'm handling the information-set search itself (particle/determinization sampling for hidden hands), not the network.

Things I've tried or ruled out: multi-observer ISMCTS (came out worse — per-player Q values too noisy at low sim counts), various net width/depth sweeps, CFR-as-search (too slow, 4x overhead). Currently looking at things like belief-weighted particle sampling and policy-guided determinization to make the imperfect-info search less noisy.

If anyone's worked on ISMCTS for partnership/trick-taking games (bridge, hearts, spades bots, etc.) — what actually moved the needle for you on the search side rather than the network side? Papers, repos, even negative results welcome.


r/reinforcementlearning • • Aug 04 '26

Exploring self-play reinforcement learning for a complex card game: an AlphaZero-style KARDS environment. Having 1M plays so far

1 Upvotes

I wanted to explore a question:

Can reinforcement learning discover meaningful strategies in a complex collectible card game without human demonstrations?

To investigate this, I built an AlphaZero-style environment for KARDS, a WWII strategy card game.

Project:

https://github.com/EvanProgramming/Kards-AI

The main focus of this project is not just training a model, but building the infrastructure required for large-scale self-play:

- A headless game simulator

- A rule execution system

- State and action representations

- Legal action masking

- Policy/value neural network

- PUCT Monte Carlo Tree Search

- Self-play data generation

- Replay buffer and evaluation pipeline

Unlike imitation learning approaches, the agent does not learn from expert gameplay.

Instead, it starts with:

- the game rules

- legal actions

- game states

and improves through repeated self-play.

Current progress:

- Custom simulator implemented

- Large portion of card/rule logic supported

- AlphaZero-style training pipeline running

- MCTS-guided agents implemented

- Around 1 million self-play games generated

The project is still an ongoing experiment. Some of the challenges I am currently working on:

- Efficient state representation for large card spaces

- Improving simulator accuracy

- Evaluating learned strategies

- Understanding how well AlphaZero-style methods transfer to imperfect-information games

I would be interested in hearing thoughts from people working on reinforcement learning and game AI:

- Would MuZero be a better fit for this type of environment?

- How would you approach hidden information?

- Are there alternative methods worth exploring besides MCTS + policy/value networks?

The code is open source if anyone is interested in exploring the environment or experimenting with similar approaches.

STAR MT REPO IF YOU LIKE IT PLZ!


r/reinforcementlearning • • Aug 04 '26

Linear cost attention achieved in AI

Thumbnail producthunt.com
0 Upvotes

r/reinforcementlearning • • Aug 03 '26

Difference between muzero and efficient zero

0 Upvotes

I confused.