Project Belisarius: Teaching Toribash to Punch Itself Until It Gets Good
I started with a dumb question:
Can a Toribash bot learn ABD by fighting itself?
So far, the answer is:
Yes, but only after launching a small army of Toribash clients, building a training league, making a dashboard, and watching thousands of tiny martial artists fold themselves into questionable shapes.
Welcome to Project Belisarius.
Short Version
Belisarius is an offline/local Toribash AI project.
Current goal:
Train a bot for aikidobigdojo.tbm.
It trains by fighting:
- itself
- random behavior
- older versions of itself
- the current champion
- other strong saved versions
This is not an online bot.
No public room farming.
No matchmaking nonsense.
No terrorizing beginners while I sleep.
Just local Toribash science.
Current setup:
20 Toribash clients running in parallel.
Current best version:
Belisarius Primus.
How the training works, in simple words
The bot plays a match.
Then it plays another match.
Then another.
Then thousands more.
Every so often, the system saves a version of the bot.
Those saved versions fight each other.
A new version is not automatically better just because it is newer.
It has to prove itself against the current champion and other strong versions.
So instead of saying:
"This one is newest, therefore best."
The system says:
"Cool. Now beat the guy who has been throwing everyone else out of the dojo."
That is the important part.
The Belisarius Campaigns
I started naming the project phases because otherwise everything becomes:
"new run 4"
"fix 27"
"why is it fullscreen"
"please stop becoming furniture"
So here is the actual journey.
Campaign Zero: The Limp Uke Era
This was the "can this even work?" phase.
The first goal was simple:
Make Toribash talk to Python.
Toribash runs a Lua script. Python runs the brain outside the game. The Lua side reads the match state, sends it to Python, receives joint/grip actions back, applies them, and advances the fight.
Sounds easy until you remember this is Toribash, Lua, Windows, sockets, and a game client that was absolutely not designed around "please become an AI laboratory".
Main difficulty: getting a stable bridge between the game and the controller.
Improvement unlocked: Belisarius could finally move from outside the game.
Not intelligently.
But he moved.
At this point he was basically a remote-controlled training dummy with ambition.
Campaign I: Basement Dojo
Once the bridge worked, the next step was making a real training environment.
The bot needed complete matches, resets, observations, actions, rewards, wins, losses, ties, injuries, and match state.
This is where the project stopped being:
"Send random commands to Toribash."
And became:
"Build a place where learning can happen."
The hard part was deciding what the bot should even see.
Toribash is not a clean board game. It has body parts, velocities, rotations, grips, DQ, damage, momentum, and a lot of beautiful nonsense.
Main difficulty: turning a chaotic physics fight into useful information for a learning system.
Improvement unlocked: Belisarius could play full offline ABD matches, collect results, and learn from repeated attempts.
At this stage he was alive.
Not smart.
Alive.
Campaign II: The 20-Client Circus
One Toribash client is too slow for serious training.
So the next phase was parallelism.
Many Toribash clients running at once, each playing matches, all feeding experience back into the training system.
This became the "small army of little Belisarii" phase.
The clients also had to stay open across many matches. Restarting Toribash every fight would be painfully slow and unstable, so the system keeps clients alive and reuses them.
Main difficulty: making many Toribash clients behave at the same time without ports colliding, workers dying, windows going insane, or Windows deciding the entire project is a personal attack.
Improvement unlocked: training became fast enough to run overnight and actually produce useful generations.
This was the first time the project felt like a real self-play system instead of a cursed science fair demo.
Campaign III: The War Room
At some point, watching terminal logs becomes a form of psychological damage.
So I built the dashboard.
The War Room is the control center.
It shows training progress, running clients, evaluation results, model rankings, worker health, and recent stats.
It also lets me launch training, stop it, resume it, evaluate models, watch fights, and play against selected versions.
The dashboard also had to update live without constantly jumping around or blanking graphs like it was trying to dodge taxes.
Main difficulty: making the system controllable and readable while training is running in real time.
Improvement unlocked: I no longer need to babysit console windows and guess what is happening.
This is where Belisarius got a command room instead of a pile of scripts.
Campaign IV: King of the Tatami
This was one of the most important phases.
Early on, it was tempting to treat the newest model as the best model.
That is wrong.
In self-play, the newest model is often just the latest idiot.
Sometimes it is better.
Sometimes it learned a weird trick.
Sometimes it became amazing at beating weak opponents and terrible against strong ones.
So I added evaluations and champion sweeps.
Saved versions fight against random behavior, recent versions, strong older versions, and the current champion.
The winner is not decided by age.
It is decided by performance.
Main difficulty: separating real improvement from noisy training reward.
Improvement unlocked: Belisarius now has an internal league. A version has to prove itself before becoming champion.
This is where "latest" stopped meaning "best".
Campaign V: No More Random Bullshido
Beating random opponents looked good at first.
Then it became obvious that beating random does not mean the bot understands ABD.
It just means it can bully something with no plan.
So the training pressure changed.
Belisarius now spends more time fighting meaningful opponents:
- itself
- recent versions
- strong older versions
- the current champion
- finalists from previous sweeps
- only a small amount of random behavior
This makes training harder, but more useful.
Main difficulty: preventing the bot from becoming good at fake progress.
Improvement unlocked: the system now pushes Belisarius toward actual competitive strength instead of just farming easy wins.
This was the "stop congratulating the bot for beating furniture" phase.
Campaign VI: ABD Bootcamp
ABD is not just "do damage".
If the bot only chases damage, it can learn very stupid habits.
It might get a hit, fall over, DQ, or sacrifice position for a number that looks good but loses the match.
So the reward system became more ABD-focused.
Belisarius now gets shaped around:
- winning
- staying in the dojo
- not self-DQing immediately
- ring control
- edge pressure
- balance
- stability
- useful grips
- injury advantage
- avoiding bad positions
The goal is to reward control, not just chaos.
Main difficulty: teaching the bot what "good ABD pressure" means before the win happens.
Improvement unlocked: Belisarius started showing more stable movement, better survival, and more meaningful fight behavior.
Not always.
But more often than before.
Campaign VII: The Champion Pressure Era
Once the league existed, the next step was making the champion matter during training.
The current champion is not just a trophy.
It becomes part of the training pressure.
New models have to fight the strongest known version often enough that they cannot simply drift into weird habits and still look good.
This is where the project became stricter.
A new version can beat random, have decent reward, and still fail if it cannot handle the champion.
Main difficulty: making training harder without completely crushing exploration.
Improvement unlocked: better versions now have to survive real internal resistance.
The system is less impressed by cheap progress.
This is where Belisarius stopped getting participation trophies.
Campaign VIII: The Tripod Monk Incident
This one was very Toribash.
Belisarius discovered that if you tripod hard enough, you often do not immediately die.
This was good.
It meant he learned balance.
It was also bad.
Because he started using balance as an excuse to not fight.
The bot was becoming stable, but passive. It could survive, tie, and avoid disaster, but that is not the same as winning ABD.
So the reward system had to change again.
Now the bot gets punished more for boring low-damage ties and inactive stalling.
Balance is still useful.
Tripoding is still allowed.
But becoming furniture is not a strategy anymore.
Main difficulty: keeping the good part of tripod behavior without letting the bot turn into a table.
Improvement unlocked: fights became shorter, more active, and higher damage again.
This was the "stand up, yes, but now actually fight" phase.
Is the latest version learning?
Training stats answer this.
Is it better than weak/random opponents?
Evaluation answers this.
Is it actually stronger than the current best?
Champion sweeps answer this.
That last question is the one that matters most.
The current best version is called:
Belisarius Primus
New versions are still being produced, but they do not become champion unless they earn it.
Main difficulty: keeping long training runs stable while still judging progress honestly.
Improvement unlocked: the project can now run, evaluate, rank, and continue without blindly trusting the newest model.
Belisarius is still not a top human ABD player.
But he is no longer just flailing in the dark.
Now he flails with a ranking system.
Current status
Right now, the project can:
- launch multiple Toribash clients in parallel
- keep clients alive across many matches
- train overnight
- save model versions
- evaluate saved versions
- run champion sweeps
- rank models by actual performance
- watch bot-vs-bot matches
- let me play against selected saved versions
- monitor everything from a local dashboard
Current setup:
20 persistent Toribash clients
Current mod:
aikidobigdojo.tbm
Current proven best:
Belisarius Primus
That version became champion through repeated sweep evaluations, not just one lucky batch.
What the dashboard numbers mean
The dashboard tracks a lot of stats, but the simple version is:
Training reward
Shows whether the current training batch is getting more reward. Useful, but noisy.
Win rate
How often the bot wins in evaluation.
Injury delta
Whether the bot is dealing more damage than it receives.
Tie rate
Whether the bot is actually fighting or just surviving forever.
Evaluation score
A combined score from reward, win/loss rate, and injury advantage.
Champion sweep score
The serious one. This comes from internal tournaments between saved versions.
Best version
The version that proved itself best through evaluation/sweeps.
Latest version
The newest version. Sometimes good. Sometimes cursed. Never trusted blindly.
Technical explanation
Toribash runs a Lua bridge script.
Python runs the training/controller side.
The Lua script reads the game state, sends it to Python, receives joint/grip actions, applies them, and advances the match.
The bot observes things like:
- body positions
- velocities
- joint states
- grips
- injuries
- match frame data
- selected player
- dojo position
- ABD-specific pressure/ring information
The training system uses many persistent Toribash clients in parallel.
Each client keeps playing matches instead of restarting every fight.
Saved models become checkpoints.
Those checkpoints are evaluated against:
- random behavior
- recent checkpoints
- the current champion
- finalist/strong checkpoints
- sometimes older external champions
The system does not trust raw training reward alone, because reward can improve while real fighting strength does not.
In ABD especially, the bot cannot just maximize damage like a caveman.
It needs to understand:
- staying in
- pushing out
- lifting
- not falling first
- when to grip
- when not to grip
- how to recover
- how to pressure edges
- how to avoid donating its own body to the floor
That is why this is fun.
And painful.
Mostly fun.
Current limitations
This is still early.
Known limitations:
- the bot is not human-competitive yet
- learning is unstable
- some versions overfit weak opponents
- some learn one trick and forget three other things
- evaluations take time
- training reward can improve while champion strength does not
- ABD reward design is still being tuned
- watching it sometimes makes you question whether intelligence was a good idea
But the pipeline now works.
The system can train, evaluate, rank, and keep going.
What comes next
Planned next steps:
- better replay/video exports
- more human-vs-bot testing
- more stable champion league logic
- better ABD-specific reward shaping
- more style diversity
- possible specialist bots:
- edge pressure
- anti-grip
- defensive recovery
- aggressive opener pressure
- more reliable comparison against older champions
- eventually trying other mods after ABD becomes more mature
Final Note
Project Belisarius is offline/local only.
No online automation.
No public room botting.
No farming.
No matchmaking nonsense.
Just a local Toribash training project trying to answer a dumb but interesting question:
Can a bot learn Toribash by getting beaten up by itself enough times?
So far, the answer seems to be:
Yes, but first it must suffer.
I will post screenshots, videos, and replays as I get cleaner examples.
For now, Belisarius is awake, training, and still occasionally trying to solve ABD by becoming furniture.
Last edited by AlteredCode; Jun 9, 2026 at 02:23 AM.
Let it fight me. You'll have an aggressive bot eventually.
-----
Python is very fun to play with and is easier than any other script. It's a good thing you used it, so you didn't wrack the brain on Javascript. The other programs are annoying to code with all their needy symbols. Good stuff. I want to fight it when it becomes a god.
Last edited by D4NTE; Jun 8, 2026 at 08:13 PM.
Reason: <24 hour edit/bump
It really depends on what comes out of this first, right now i'm not even sure it will ever be competitive or how much time it will take to train this one.
If it gets better in a matter of days/weeks it may be doable and some of the ABD skills could even transfer between mods (like balance/not DQing maybe).
>If Uke = God
>Then (D4NTE kicks his rear end so hard he coughs up laces)
>Else (This is not happening)
lmaooooooooo
-----
How long does it take your uke to play 1000 games?
Last edited by D4NTE; Jun 8, 2026 at 08:17 PM.
Reason: <24 hour edit/bump
Let it fight me. You'll have an aggressive bot eventually.
-----
Python is very fun to play with and is easier than any other script. It's a good thing you used it, so you didn't wrack the brain on Javascript. The other programs are annoying to code with all their needy symbols. Good stuff. I want to fight it when it becomes a god.
You know that's actually an interesting approach and i spent time thinking if i should fight him or not or even train on previous ABD replays of good players.
The conclusion is we can't keep up.
Not in terms of skill, like now i'll shove his ass out of the ring any day any time.
The problem is we can't produce enaugh matches for him to learn something from it.
Right now he ran almost 2 million matches by itself. (in like 72 ish hours) Even if you let's say fight him 100/1000 even 10000 times it won't be enaugh for him to learn something. He plays like 150 steps (toribash turns) per second 😁👹
Of course your matches will be way higher quality but still not enaugh in terms of volume.
Could you explain the algorithm in detail? I've been interested in writing a Toribash AI, Toribash is not like most turn-based games and you can't use minimax/alpha-beta pruning.
I've thought about it and was thinking of training by doing self-play and a population-based Nash equilibrium bot.
Could you explain the algorithm in detail? I've been interested in writing a Toribash AI, Toribash is not like most turn-based games and you can't use minimax/alpha-beta pruning.
I've thought about it and was thinking of training by doing self-play and a population-based Nash equilibrium bot.
Hey Fran i remember you, market bot pioneer 😁👹
WARNING: Scary AI revised explanation inside
Yeah, minimax/alpha-beta does not really fit Toribash.
What I’m using right now is not a search bot. It is reinforcement learning with self-play.
More specifically, the current version uses RLlib APPO, which is basically a distributed actor-critic / PPO-style training algorithm. Instead of looking ahead through a game tree, the bot plays huge numbers of real Toribash matches, gets rewarded or punished for what happened, and slowly changes its policy.
The rough pipeline is:
1. Toribash runs normally.
2. A Lua script inside Toribash reads the game state.
3. Python receives that state through a local TCP bridge.
4. The neural network chooses the next joint/grip action.
5. Python sends the action back to Toribash.
6. Toribash advances the turn.
7. Repeat for millions of turns/matches.
The policy sees things like:
- own body positions and velocities
- opponent body positions and velocities
- joint states
- grips
- injury difference
- current frame/turn
- distance from dojo edge
- center-of-mass information
- hand distance to opponent
- balance/stability signals
- DQ/ring pressure
The action is not pure random control of every joint from scratch anymore. For ABD I use an action space based on ABD-style templates plus residual overrides.
So the network first picks one of several broad ABD action templates, then it can override individual joints and grips. That makes the search space smaller and more Toribash-shaped than saying “pick all joints blindly every turn”.
Training is a mix of:
- current policy vs current policy
- current policy vs random
- current policy vs recent checkpoints
- current policy vs the current champion checkpoint
- current policy vs finalist/top checkpoints from sweeps
So your idea of population-based / Nash-style self-play is pretty close to where this is going.
It is not a true Nash equilibrium solver right now. I’m not calculating an exact mixed strategy equilibrium over a payoff matrix. It is more practical: a league system. The bot trains against a population of old versions so it does not just overfit to beating itself today and forget how to beat yesterday’s versions.
Current opponent sampling is roughly weighted toward strong opponents:
- some pure self-play
- very little random
- some recent checkpoints
- a lot of champion pressure
- some finalist/top checkpoint pressure
Every checkpoint gets evaluated separately. Evaluation does not directly train the model, but it decides which checkpoints are strong, which ones become champion/finalists, and therefore which opponents future training uses.
Reward is also not just “win good, lose bad”. ABD needs shaping or the bot discovers dumb survival tricks. Current reward includes:
- terminal win/loss reward
- injury advantage
- DQ/ring pressure
- edge safety
- useful grips
- balance/stability only when actually fighting
- tie penalty
- anti-stall penalty
- phase-based control rewards
That last part was important because it started learning tripod/stall behavior. Good balance, bad fighting. So now stability is rewarded only when connected to useful activity, not just “stand there and survive”.
In simple terms:
The bot is learning a policy:
“given this Toribash state, what joint/grip move gives me the best long-term chance to win against this pool of opponents?”
Not:
“calculate every possible future move and pick the best one.”
Toribash is too continuous/physics-heavy/weird for classic tree search to be practical.
Long term, a more formal population/Nash system could make sense: keep a payoff matrix between checkpoints, build a league, sample opponents based on exploitability, maybe train specialist counter-policies. But the current working version is APPO self-play + checkpoint league + champion sweeps.
Last edited by AlteredCode; Jun 9, 2026 at 02:26 AM.
Hey brother. This is some cool shit. I remember speaking with Kris at length about his work on the decap AI bot. Are you retaining your data in a .csv or .xlxs format by chance with a specific delimiter?
In and of itself, I don't have a problem that this entire project is (in all likelihood) "vibe coded". I don't even have a problem with the simple fact that the original post seems to be entirely written by a LLM. But, when you made the decision to include 11 (?!) AI-generated banners, on top of the fact the post is already unnecessarily long -- and now you're doubling down by throwing the questions of actual users into the prompt and pasting the output here in your responses -- all this insults the intelligence of the reader.
And if that's what you're going to do, how about you publicize your repository and have your agent create a skill out of the project and chat history? It'll save time for everyone involved!
Last edited by Moonshake; Jun 8, 2026 at 09:48 PM.
Reason: <24 hour edit/bump
<[Obey]Quest> yall needa tap into my telegram on gad