Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GlossaryNovember 22, 20263 min read

What is netcode?

Netcode decides who is right when two players disagree, and hides the delay between them. Here are the main models, which genres use which, and the bugs to expect.

Startbase Team
Editorial ink illustration of two chess players at separate tables linked by a flying envelope, the envelope in ember orange

Key takeaways

  • Netcode is everything that keeps players' copies of a game in agreement despite delay: who decides, what is sent, and how lag is hidden.
  • Server-authoritative netcode with prediction and interpolation is the default for action games; event syncing suits turns and boards.
  • Never trust the client: the server checks moves, hits and scores, or cheaters will set their own.

Netcode is a catch-all name for the networking code in a multiplayer game: what each player sends, who has the final say on what happened, and the tricks that make a delayed connection feel immediate. Good netcode is invisible; bad netcode is the reason players blame "lag" for everything.

Picture two friends playing chess by post. Each keeps a board at home, and letters carry moves between them. Netcode is the rulebook for those letters: what goes in them, whose board wins if the two disagree, and whether you are allowed to make your next move before the reply arrives.

Who decides: authority models

  • Server-authoritative. Players send inputs ("pressed left, fired"); a server runs the real game and tells everyone the result. Hardest to cheat, and the default for action games.
  • Event-based shared state. Players send actions ("played card 7", "moved piece to e4") through a realtime channel, and a backend validates and stores the official state. Ideal for turns, boards, quizzes and party games.
  • Peer-to-peer. Players talk directly, with no server in the middle. Cheap, but cheating and connection issues are harder to handle; most browser games avoid it.

Hiding the delay

Even 80 ms of latency makes a game unplayable if every keypress waits for the server. Four techniques fix that:

  1. 01Client-side prediction. Your character moves the instant you press, using the same rules the server uses. When the server's answer arrives, the client quietly corrects any difference.
  2. 02Reconciliation. If the server disagrees, rewind to its state and replay inputs you sent since, so corrections are small nudges instead of snaps.
  3. 03Entity interpolation. Other players are drawn about 100 ms in the past, sliding smoothly between snapshots that arrive at the server's tick rate.
  4. 04Lag compensation and rollback. The server rewinds to judge a shot by what the shooter saw. Fighting games go further with rollback: simulate ahead, then roll back and replay when the opponent's real input arrives.

Which netcode for which game

  • Board, card, trivia, word games: event-based. No prediction needed (online board games).
  • .io and arena games: server-authoritative at 10 to 20 ticks per second, with prediction for your own movement (how to make an .io game).
  • Fast action: server-authoritative, higher tick rate, prediction, interpolation and lag compensation.

Netcode on Startbase

Startbase covers both main models (multiplayer docs): live sync over your backend's realtime channels for lobbies, presence, turns and live boards, and room servers that give action games one isolated server per match, built by the agent in your project. Previews run the room server on every plan; publishing it with the game needs a paid plan. The genre decides which you want, so say it up front. For the full walkthrough, read how to build a multiplayer game.

Make this a 2 to 6 player online arena with a room server. The server is authoritative: clients send inputs only, and the server validates movement speed, cooldowns and hits. Predict the local player's movement and reconcile with server state, interpolate others 100 ms behind, and judge shots with lag compensation up to 150 ms.

Common confusions and bugs

  • Trusting the client. If the browser reports "I scored 9,999", someone will send that. The server checks rules.
  • Rubber-banding. Snapping back after running ahead means prediction and server rules disagree, or packets are lost. Share the movement code between client and server.
  • Netcode vs network speed. Great netcode cannot remove delay; it decides who waits and how visibly.

Frequently asked questions

What does good netcode mean?

Your own actions feel instant, other players move smoothly, hits are judged fairly, and corrections are rare and small. It is about hiding delay and settling disagreements well.

What is rollback netcode?

A technique, popular in fighting games, where each player's game runs ahead using predicted opponent inputs, then rewinds and replays a few frames when the real inputs arrive.

Do turn-based games need netcode?

They need simpler netcode: send each action, validate it on the backend, and broadcast the new state. No prediction or interpolation is required.

On this page

  • Who decides: authority models
  • Hiding the delay
  • Which netcode for which game
  • Netcode on Startbase
  • Common confusions and bugs

Keep reading

More in Glossary
Editorial ink illustration of a hand-cranked music box drum plucking a metal comb, the crank handle in ember orange
GlossaryNovember 22, 2026

What is a game loop?

Every real-time game runs one repeating cycle: read input, update the world, draw it. Here is what that cycle looks like and why it decides how your game feels.

3 min read
Editorial ink illustration of a brass stopwatch beside a small wind-up toy car, the second hand in ember orange
GlossaryNovember 22, 2026

What is delta time?

Delta time is the number that keeps your game the same speed on every screen. Here is how to use it, where it breaks, and how to spot a game that forgot it.

3 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.