A 2D netcode mini game that lets you see latency
Translated by AIView original
What's the problem?
In online games, when your ping is low but your character still stutters, the reason isn't obvious. Server authority, ticks, snapshots and interpolation all float around as separate terms, and if you only read about them you forget them fast. I'd like a small tool where you can move around yourself and feel the difference.
Here's the idea
A single 2D screen that opens in the browser. There's your character and an opponent character moving in a fixed pattern. Sliders let you set a fake latency and a packet loss rate. A mode button switches between no interpolation, interpolation, and interpolation with extrapolation, so you can compare how the same movement looks different in each. The opponent's server position is drawn as a dot and the position shown on screen as a circle, overlapping, so the gap is obvious at a glance. Once it's done you can play with a friend and talk about how the lag feels. The goal is to keep it light, like an educational toy, without making it a big game.
Difficulty and tools
- Difficulty: weekend project
- Tools: Claude Code, Cursor, HTML Canvas
Vibe-coding starter prompt
만들 것: 브라우저에서 열리는 2D 넷코드 체험 미니 게임. 한 개의 HTML 파일로 만들어 주세요. 핵심 기능: 1) 내 캐릭터는 방향키로 움직이고 상대 캐릭터는 정해진 패턴으로 움직여요. 2) 슬라이더로 가상 지연 시간 0에서 300ms까지와 패킷 손실 비율을 조절해요. 3) 모드 버튼 세 개를 두어요: 보간 없음, 보간, 보간과 외삽. 같은 상대 움직임을 모드별로 다르게 그려요. 4) 상대의 서버 위치는 점으로, 화면에 그린 위치는 원으로 겹쳐 보여 주세요. 5) 현재 지연 값과 모드 이름을 화면 위쪽에 표시해요. 첫 단계: 캔버스와 상대 캐릭터의 움직임부터 만들고, 지연을 적용한 스냅샷 큐를 만든 뒤, 모드 세 개를 차례로 붙여 주세요. 외부 라이브러리 없이 바닐라 자바스크립트로 작성해 주세요.
Inspired by
- Lag and server costs, as game devs talk about them · GeekNews
If you build it, put a link to this post in your Showcase post and show it off.
Comments 0
No comments yet
Be the first to comment.