Finding Atari Games in Randomly Generated Data

bbenchoff.github.io

174 points by wanderingjew 9 days ago


selcuka - 9 days ago

When I was a kid, I had a ZX Spectrum 48K with a cassette tape as the storage unit. Tapes are notoriously unreliable. One day I loaded a game [1] and got the dreaded "R tape loading error".

Instead of adjusting the azimuth and retrying, I decided to take my chances and typed RUN to execute the one-line BASIC bootloader that starts the actual machine-code game.

To my surprise, the game started, but there was something odd. Even though I should have lost all my lives, the game kept going. Somehow the loading error had modified a few bytes in the game that were responsible for checking the game-over condition.

I finished the game several times without ever seeing the Game Over message. Well, the probability isn't as low as accidentally writing a game from scratch, but it's certainly interesting when you think about it.

[1] https://en.wikipedia.org/wiki/Firebirds_(video_game)

jerf - 9 days ago

Nifty and fun.

I would say, however, given the staggering space of possible ROMs, it's not particularly cheating to change from using the acceptance criteria to judge random ROMs, to using the acceptance criteria in the generation phase. It's fine to do things like generate random opcodes instead of purely random numbers for the first 1KB, for instance.

It's really just an optimization of what you're already doing; it's equivalent to randomly generating a lot of options then rejecting the ones that don't fit, except it goes much faster and produces a lot more output of interest instead of burning energy on things that are just going to be rejected anyhow.

staplung - 9 days ago

Fun. It's basically Borges Library of Babel[1] where each book is a 4K ROM!

If you do the math based on the specs given in the story (and crucially, you assume that each possible book appears once) you end up with a library several times larger than the observable universe.

1: https://en.wikipedia.org/wiki/The_Library_of_Babel

a_cardboard_box - 9 days ago

> All of these produce valid video output and show dynamic or structured data.

While they will usually produce video on old CRTs, the video signal they generate is technically not valid. The VSync signal needs to be generated in software, and random programs are unlikely to do so correctly. Different TVs will behave differently (usually rolling on old TVs, blank on new TVs), and probably none would look like what the emulator is showing.

I tried running the game-like ROM in Stella and couldn't get it to work. It seems to depend on the startup state, which means it likely wouldn't run on an actual console.

edent - 9 days ago

All fun and games until you look up and notice that overhead, without any fuss, the stars were going out.

JetSetIlly - 9 days ago

The simplest 2600 games were just 2k in size not 4k. Combat for example, is a 2k rom.

If you want to increase your chances of finding something but still generating a "complete" rom, then limit the size to 2k.

tdjsnelling - 9 days ago

Great concept. Very Library of Babel[1] -esque.

[1] https://libraryofbabel.app/ disclaimer - my own project

xhrpost - 9 days ago

Reminds me about "Pulling JPEGs From Thin Air": https://news.ycombinator.com/item?id=8571879

jsnider3 - 9 days ago

Interesting. I know the author thinks asking an LLM to make Atari games is cheating, but did he consider just randomly sampling from the assembly code of Atari games?

coldcity - 9 days ago

Ace!

Quite a while ago I did something similar [1] with a much simpler problem space: 32-byte DOS programs and rudimentary genetic programming.

[1] https://www.pouet.net/prod.php?which=59302

mjd - 9 days ago

This is one of the dumbest projects I've ever seen, and I mean it as a compliment.

I'm in awe.

anthk - 9 days ago

Chip8 would be easier.

Also, instead of Z-Machine games, try writting Inform6 code, the games are highly modular and OOP oriented so creating something understandable can also be made without even an AI, just premade phrases with cliché settings.

physix - 8 days ago

I love it, it's crazy!

It would be cool to start with a random ROM image and then use a Monte Carlo technique (simulated annealing), making a set of random changes to the image by flipping bits, use the change in the "composite score" for the decision step in the MC iteration, and have your image "evolve" into something.

Repeat until one finds a game that is new!

Should only take a few ages of the universe. :-)

p0w3n3d - 9 days ago

When did we get from pulling games to pulling something that runs on Atari? Entropy theory describes why the monkeys won't write shakespeare even after billion years. It's not about probability, it's about information which those monkeys will lack. Randomly generated data might contain parts of the game but not the game itself.

_benj - 9 days ago

This is such an interesting experiment! Somebody else already mentioned Borges, but yeah!

Not exactly the same but reminds me of one time I did an experiment with rational number attempting to see which patterns emerged… 111? 112? 113? etc.

mock-possum - 8 days ago

51014 is tantalizing! I wish the author had taken this farther to see what else would materialize from the aether!

wannabebarista - 9 days ago

Interesting project! The buzzing from the emulator was quite the jump scare though.

VladVladikoff - 9 days ago

Thanks to the author for the humorous read. Great project!

freehorse - 9 days ago

Proof that scaling compute is all you need.

freehorse - 9 days ago

Scaling compute is all you need.

Moosturm - 9 days ago

Now someone has to find interesting ROMs in Pi.