frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Snaketron – Competitive multiplayer Snake. Back after 14 years

https://snaketron.io
4•lopatin•1h ago
Hi HN, I just completed a rewrite of Snaketron, a competitive multiplayer Snake game. (Yes, yes, in Rust)

A quick funny story about this game's history:

Back in 2012 I had (poorly) implemented the first version of Snaketron. The issue with it was that I was keeping game state on the client, and while I did realize that it was insecure, I also had no idea what to do about it without increasing latency to unplayable levels. I was still in school, never worked on games, and haven't even heard of the term "netcode" before. The excitement of releasing my first pet project got the better of me, and I placed this security concern in the "theoretical issues" bucket, and shipped it.

No one would even notice, and if they did, they wouldn't take the time to break into my little Snake game project, right?

WRONG! Hacker News absolutely lived up to its name. While I was busy with my first experience of handling a traffic surge, scaling up my database and fixing bugs, several players found the security holes and were beginning their Snake rampage. Reports were coming in of unkillable snakes so I decided to start up a game to see if I could catch it.

I loaded a 1v1 and my opponent was ... space invaders. My snake was a snake. Their "snake" was a rendering of the game Space Invaders. Needless to say they were also moving around and were invincible. I really wish I had taken a video of that, but I was floored that HN not just played, but hacked, my project is such an epic way.

I always wanted to rebuild it properly, so here's V2! The architecture and motivations are quite different this time around.

First, the state is server authoritative and lag is compensated for by client-state prediction. The game engine is written in Rust and compiled to WASM for the client side library.

To minimize the ops burden, I also imposed a strict resiliency requirement on this project: it must be auto-scalable. So a node can join the cluster and live games will rebalance to it without disrupting gameplay.

I also tried to make the new Snaketron a little more fun. The core mechanic is still, like classic Snake, collecting food without crashing. But now team matches have an objective to make competitive games more structured. There's also a Bronze to Grand Master ranking sub system (if enough people play, calibrating this will be interesting) and some fun features like boosting, combos, skins, and Play Of The Game detection.

On Rust: One of my original goals for doing this in Rust was so that I could learn the language. That didn't work out as well as I thought it would. Usually I learn by building stuff, but AI got so good that I stopped writing code by hand and preferred to spend my nights & weekends working on what was more intereting to me than borrow checking errors: game design and the high availability stuff.

On AI: Who knows if this would have gotten done without AI. Probably not, what with my day job and other things going on in life. It's 200k LOC (most of that is tests don't worry) but still.

Anyway, here are the project links. Thank you for reading, I hope you enjoy the game and any feedback is very much appreciated!

[0] https://snaketron.io

[1] https://github.com/lopatin/snaketron

[2] https://news.ycombinator.com/item?id=4028597 (original post from 2012)

Show HN: CardGo – Reusable, end-to-end encrypted context cards for AI chats

https://cardgo.ai
2•trinhngocdieu•23m ago•0 comments

Show HN: BentoPDF, Hyper Compress and Kura

https://www.bentopdf.com
2•__alam__•29m ago•0 comments

Show HN: Snaketron – Competitive multiplayer Snake. Back after 14 years

https://snaketron.io
4•lopatin•1h ago•0 comments

Show HN: Murmell – Collaborative cloud canvas for coding agents

https://murmell.com/
7•Mossab22•1h ago•2 comments

Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

https://github.com/gbin/defragger
76•gbin•4d ago•62 comments

Show HN: Cushion – PouchDB on Deno KV

https://jsr.io/@mikehall314/cushion
6•mikehall314•1h ago•1 comments

Show HN: Bolnee-Chat – Self Hosted Chatbot Integration in Your Business Website

https://github.com/AniketWathore/bolnee-chat
31•AniketWathore•6h ago•0 comments

Show HN: Drop a SQL schema, get an interactive ER diagram

https://mcdview.dev/
6•PatuDev•5h ago•2 comments

Show HN: Typebase – A single-folder back end you write in TypeScript

https://typebase.io
111•andrewww-dev•4d ago•30 comments

Show HN: C# Game Engine with its own scripting language and IDE

https://github.com/ArcadeMakerSources/ArcadeMaker/tree/master
6•am-gm•4h ago•0 comments

Show HN: Self-hosted mobile-friendly web UI for Herdr agents

https://github.com/luiscleto/shepherdr
6•lfcc•4h ago•0 comments

Show HN: ShevtoneAudio Orchestrator – Turning MIDI into Full Orchestration

https://orchestra.shevtoneaudio.com
4•MusicAlexandrov•4h ago•1 comments

Show HN: My startup-idea scanner scored 500 ideas; the best got 6.3/10

https://1mil.app/
3•fayerman•4h ago•1 comments

Show HN: 1endpoint – Cheaper access to AI models

https://1endpoint.dev
3•DustinPham12•5h ago•1 comments

Show HN: Galaxium, an experimental WebGPU space explorer

https://galaxium.app
126•guillaumec•6d ago•37 comments

Show HN: The Thousand – 1k founders, 1 question, one book

https://thethousand.co
3•jabed•5h ago•2 comments

Show HN: Get your free AI search visibility scan

https://www.visiscan.app
3•not_wowinter14•5h ago•0 comments

Show HN: Nuzzle – adorable live wallpapers of your pets

https://usenuzzle.com
3•13001r•5h ago•0 comments

Show HN: Time tracking for solo consultants that ends in a PDF invoice

https://hourtobill.com/demo
3•Stackedboost•5h ago•0 comments

Show HN: Train 300M/32-Layer Model in 1.5GB RAM on Base M1 Mac

2•vlad_kalinkin•5h ago•0 comments

Show HN: Rose – reusable foundation embeddings for industrial 1H NMR

https://github.com/romboai/rose-1h-nmr
2•zaza3311•5h ago•0 comments

Show HN: SubSmith – Turn your own videos into language-learning material

https://subsmith.app
74•IbrahimF96•2d ago•51 comments

Show HN: The load-bearing vocabulary of Claude

https://louisabraham.github.io/load-bearing/
689•Labo333•3d ago•321 comments

Show HN: Sesame - a local-first, open-source password manager

https://usesesame.app/
63•d0mkaaa•1d ago•84 comments

Show HN: Delete yourself from data brokers without a subscription

https://github.com/k7cfo/remove-your-data
18•k7peak•17h ago•6 comments

Show HN: Flint – A minimal C/C++ package manager and build tool written in C

https://github.com/mainak55512/flint
12•mbhatt99•22h ago•2 comments

Show HN: Practice where countries are in the world

3•blackbrokkoli•12h ago•0 comments

Show HN: OpenTIE and OpenXWA, Modern Ports of Tie Fighter and X-Wing Alliance

https://github.com/elyosh/OpenTIE/
224•elyosh•2d ago•57 comments

Show HN: PhpEZ – A tiny PHP framework for shared LAMP hosting

https://github.com/QcFe/phpEZ
10•qcfe•22h ago•2 comments

Show HN: Watches user sessions, finds bugs that matter, and fixes them

https://github.com/opslane/opslane
40•aray07•3d ago•11 comments