ShatteredAI

An AI written bot that plays my favorite roguelike since I don't have time to play it myself

What is ShatteredAI?

Disclaimer: This part is human, not AI. The code and most everything else is AI.

Shattered Pixel Dungeon is a free, GPL licensed turn-based roguelike. Shattered is the most popular fork of the original Pixel Dungeon. I firmly believe this fork is the best free game out there if you need to kill time on a long flight (YMMV).

Want to try it out? You can download Shattered on the Google Play or Apple store.

The goal of the game is to beat the final boss and collect the game winning amulet. Every run has a random dungeon map, random items and a random selection special rooms and quests.

The ShatteredAI fork is the original game with an added API that allows a bot written in Python to play a game the same way a human does. Nothing was coded by a human, the AI periodically evaluates learnings which are fed back into the code. I've selected one character (Mage) to play with a random seed. The reason for only selecting one character is to reduce to the complexity of the bot for now, but more characters could in theory be added later.

When a run completes the supervising control loop uploads a video recording and displays it on this page. There are also stats collected for each run and floor that can be viewed as well.

Frequently asked questions

Disclaimer: This part is human, not AI. The code and most everything else is AI.

What is Shattered Pixel Dungeon?:

Shattered is the most popular fork of the original Pixel Dungeon and is a great game to check out if you like roguelikes. You can download it on the Google Play or Apple store.

How does the bot play the game?

The bot plays using local JSON api that has two commands - GET /state reads what the human player would be able to observe and POST /action performs an action the same way a human would if they were playing the game. For more details, see the API docs

Why no sound?

The Shattered Pixel Dungeon background music is some of the best video game music imo, but unfortunately when recording games for playback my dinky little shared hosting VM was unable to deal with it.

Is AI playing the game?

Not really - AI is writing the code to play the game where it periodically make improvements. The bot code was also primed with some basic strategy elements (like surprise attacks) and other game specific prompts to help it with gameplay.

What model is used to generate the bot code?

Mostly GPT-6.1 Sol

Why are you only using a single character, Mage?

Mage seems like the best starting character since it can deal with both ranged and melee attacks immediately.

Why did you create this?

As a parent I basically have zero times to play video games, especially roguelikes like this one that are next to impossible to beat so I thought why not let an AI play for me?

Can the game be won using the bot?

Nope, right now it can't get further than level 11 (tho check to see if we have improved any since this was written)

Really, can you even play this game?

Yes, totally! I am a big fan of Shattered and I have beat the game myself with every class (before the duelist was introduced). Around that time my son was born so I really don't have any time any more. It also, in my opinion, got a lot more difficult recently but others may disagree.

How about running the bot with challenges enabled?

That's possible, however right now I think the game is a bit more interesting to run in vanilla mode and is hard enough for the bot to play.

How can I run this game myself?

You can run the fork and the bot yourself by cloning the repo for the fork and the repo for the bot.

How can I contact you for more questions or make a suggestion?

Send me an email

No recordings yet

Per-run statistics

About per-run statistics

The first five graphs use the latest 50 published runs, ordered oldest to newest. Each bar is a run, stacked by floor; branches remain separate.

All observed floors are included, including the floor where the run ended. A single valid value is enough. Missing or incomplete totals are gaps, never zero; a bar can therefore be a partial total.

Click a floor in the legend to isolate it; its outline glows. Click it again to restore all floors, or click another floor to switch the filter.

Experience and gold are observed gains on that floor. Gold sums positive balance changes, not net wealth. Turns are game turns, not API inputs or recording time. Repeated visits accumulate on the same floor.

The fourth chart counts game turns spent starving on each floor, including the terminal floor, using the hunger buff at the start of each observed clock interval. Hunger transitions inside an interval can shift the boundary slightly. Branches and revisits follow the same rules; missing or incomplete records are gaps, not zero.

The levels-gained chart uses the latest 50 runs on the x-axis and character levels gained on the y-axis, stacked by floor like the other charts. Each segment is the gain on that floor, often 0 or 1. Starting level 1 is not a gain. Click a floor in its legend to isolate it. Revisits accumulate; branches stay separate, and missing data is a gap.

Loading statistics…

No valid per-run statistics available for the latest 50 runs.

Maximum values per completed floor

About maximum values

Each chart shows the largest observed value for each completed floor across the latest 50 published runs. A floor needs only one valid value here—there is no 20-point minimum.

Floors where a run ended and incomplete metric totals are excluded. The floor is on the x-axis; XP, gold or game turns are on the y-axis. Branches remain separate, and each chart uses its own scale.

The maximum values table identifies the winning run and sample count for each metric. Different metrics may have different winning runs. Gold means positive observed balance changes, not net wealth.

The level chart shows the maximum number of levels gained on each completed floor, not the cumulative character level. It uses the latest 50 published runs, excludes terminal floors and incomplete evidence, and identifies the winning run in the table.

Maximum values and sample counts
FloorMetricMaximumRunData points

All runs

    No published runs yet.

    All runs · labels

    lvl is the highest character level reached; depth is the deepest floor reached. gold sums observed increases in the gold balance, so purchases do not subtract from it; it is not the maximum wallet balance. turns is elapsed game time, not the number of bot inputs or recording duration. str is ending strength. Minutes describe recording length. An em dash means missing or incomplete evidence, not zero. “Observed depth” or ≥ marks a known depth without a certified run maximum. Older completed runs may use their final character level, since levels do not decrease.