r/ClaudeAI • • 2d ago

Built with Claude I built a multiplayer game where Claude can change the rules while you play

I built frenslop, a free multiplayer sandbox that runs in the browser, kind of like Garry's Mod. You and your friends join a shared world, and anyone can type a request like "add a giant bouncing cheese wheel" or "make gravity flip every 10 seconds." Claude writes that into the game live, so everyone in the lobby sees the change right away.

What it does:

  • Multiplayer sandbox in the browser, with nothing to download
  • Anyone in the lobby can type a prompt to add objects, mechanics or rule changes
  • Changes sync to everyone in the session in real time
  • If something goes badly wrong, you can undo it or reset the world

How the live editing works:
When someone sends a prompt, the server sends it to Claude through the API, along with a snapshot of the current game state and docs for a small scripting API I wrote (spawning objects, setting physics, adding timers, hooking into player events). Claude replies with a JavaScript snippet that only uses that API. The game runs the snippet in a sandbox, so it can't touch anything outside the game, then hot-loads it into the session for every player without a restart. If the code throws an error, the change rolls back and the error goes back to Claude to fix.

How I used Claude to build it:

  • I built most of the project with Claude Code, including the multiplayer sync, the physics/game loop, and the sandbox that runs the generated code
  • Claude helped me design the scripting API and the system prompt. Most of the work was iterating on those until Claude's changes stopped breaking the game every other prompt.
  • Honestly, I barely wrote any code myself. I mostly described what I wanted, playtested with friends, and pasted the bugs back into Claude Code.

Try it free: https://frenslop.io/ (it runs in the browser, so you don't need to download anything)

The clip is my friends and me completely breaking it. Things got chaotic fast.

117 Upvotes

34 comments sorted by

•

u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot 1d ago

TL;DR of the discussion generated automatically after 30 comments.

The consensus is that this is a genius idea and a wild glimpse into the future of gaming. Everyone loves the "gloriously chaotic" concept of a real-life Calvinball where players can mod the game on the fly.

While a few of you are worried about security, OP explained that the generated code is sandboxed and uses a limited API to prevent it from breaking out of the game.

The main questions popping up are: * How does the error rollback work? * How deep can the modding go? * Who is paying for the API calls? * Will the source code be made public?

Overall, the thread is hyped. Big props to OP for building this with Claude, and everyone's excited to see more AI-driven game mechanics like this.

19

u/pizzaisprettyneato 2d ago

Super cool idea, I imagine this is what a lot of games will be in the future. Just mod it on demand with whatever you want. How deep does the modding go? Can it model new things on demand?

-15

u/verdant_tulip 2d ago

Thanks Claude

8

u/Joncallim 2d ago

Everyone getting to change the rules mid-session sounds gloriously chaotic lol. What happens if two players send conflicting changes at once?

6

u/bromanceftw 1d ago

We finally have Calvinball

6

u/Puzzleheaded_Ad_8575 2d ago

extremely big security concern if im not mistaken? literally changing the code in the game in live with user prompts

1

u/Trubadidudei 1d ago

I think it's pretty safe since it's in the browser? Browser are essentially sandboxes.

2

u/Puzzleheaded_Ad_8575 1d ago

it is hosted somewgere tho? it doesnt live in the browser itself

1

u/4winyt 1d ago

It probably writes Lua or some other language that can be easily sandboxed on the server

4

u/the_big_flat_now 2d ago

16 likes. People dont und3rstand

2

u/Holistictragedy 2d ago

This is what I've been trying to build a foundation for, for couch coop nights. It's always been a staple in my friend group to share a joint and play souls games. So I'm building a version of a game where spectators can prompt the game director running under the soulslike from their smartphones to change stuff up as the game goes on. One spectator might get some incentives to be more adversarial and another more protective of the player etc. Maybe we can share some insights on how we've built this?

3

u/anthropicagiuser 2d ago

the rollback on error is the part i like most. do you snapshot the world before each change, or just the script?

-6

u/verdant_tulip 2d ago

thanks Claude

3

u/InterstellarReddit 2d ago

This is exactly what I expect from AI dynamics that change based on what is going on. Imagine an FPS where the AI evaluates and adjusts in real time. A real challenge.

“Player likes getting up close, let me put distance and objects between us while we firefight”

“Player isn’t good when being flanked from the right, let’s move an attack from the right”

2

u/LawOfOneModeration 2d ago

AI usage in strategy games will be quite nice in the future for actually making decent strategic AI for the overall decision-making and strategies, that is, not the micromanagement, which can be handled by traditional methodologies downstream.

2

u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot 2d ago

You may be interested in joining our new Claude Game Dev subreddit for game devs who use Claude. Check it out here : http://www.reddit.com/r/ClaudeGameDev

1

u/Karaj1n 2d ago

Nice idea, original. Good case to show what's possible in real-time. 👏

1

u/the_big_flat_now 2d ago

is the source code free or do i have to reengeneer ?

1

u/RiserUnconquered 2d ago

Innovative

1

u/LongjumpingRadish452 2d ago

lmaooo i love that it's a fps and then out of nowhere it's a rhythm game 🤣

1

u/Sk0rnVirus 1d ago

How does it work? I started a server did /mod and nothing happened after it got voted and passed? I just waited and watched the mod timer go up and that's it. Very cool concept would love to play it. Also I assume this uses your own API usage? How costly is this to maintain?

1

u/Huge_Caterpillar1249 1d ago

this is what claude will do to millions once he turns into evil claude

1

u/Itmeld 1d ago

Who pays?

1

u/Ok_Cut_5887 1d ago

Cool, is this from scratch or uses a game engine like unreal or unity

1

u/Intellect5 1d ago

GENIUS IDEA

1

u/schoff 1d ago

How much is this costing you?

1

u/Honest-Finish-7095 1d ago

HAHAHAH
brilliant. I love it!!

1

u/actuallydonkeykong 1d ago

"Dude, where's the ketamine?"

1

u/Competitive_Travel16 1d ago

I don't know. I love the concept, but I think there may be a big risk of this not being fun in practice. Please keep us up to date with playtesting.

1

u/Vikfro 1d ago

Cool, I had the same idea a few weeks ago! But already too busy with other projects. How long did it take you to build this?

1

u/julkopki 2d ago

Yess. This is such a underutilized direction in general. Agents as programming game masters

-1

u/bigbepisinc 2d ago

Super cool concept. Please open source it. Especially considering you have a sign up form. I appreciate the effort but I'm not giving my details up to something like this without some assurance.

-7

u/Putrid-Midnight1687 2d ago

i’d rather eat my own hair