Build an authoritative 30 Hz game server in Go that cheating clients cannot fool, make it feel immediate over an impaired network with prediction, interpolation and lag compensation, and operate it as a fleet with matchmaking, signed tokens, draining and exactly-once results.
Server-side Game Developer. Advanced.
For backend and game developers who can program and use HTTP, SQL and Docker, and want to build an authoritative game server with netcode, lag compensation, matchmaking and fleet operations.
This page explains how the whole system fits together before the lessons take each part apart. Read it once now, and return to it whenever a lesson mentions a component you have not met yet. Every connection described here exists in source/compose.yaml and the Go packages under source/internal/.
This project assumes you can already program, call an HTTP API and start containers. It does not assume you have ever written networking code for a game. This page lists exactly what you should be able to do before you start, what the project will teach you, and how to check your workstation.
The first design decision in an online game is who is allowed to decide what happened. This lesson explains why the answer for a competitive game is "only the server", what that demands of the simulation, and how the project's internal/sim package meets those demands with a fixed timestep and integer physics. The tick-loop lesson then shows where the simulation sits inside a server.
The simulation lesson defined what one tick does to one player. This lesson follows the game server around it: how packets get from the socket to a match without disturbing the simulation, how a match keeps its 30 Hz rhythm, and how it applies inputs so that a modified client gains nothing. Everything here is in internal/gameserver/server.go and match.go.
An authoritative server is fair, but taken literally it feels terrible: press a key, wait a round trip, then see your player move. At 100 ms of round trip that is a noticeable lag on every keypress. This lesson explains the two techniques every action game uses to hide it, client-side prediction with server reconciliation for your own player and entity interpolation for everyone else, as implemented in internal/netcode and used by the bot in internal/bot/client.go.
The previous lessons assumed inputs reach the server and snapshots reach the client. This lesson builds the protocol that carries them: why it uses UDP, what every packet's 12-byte header does, how acknowledgement bit fields turn lossy datagrams into round-trip and loss measurements, and how snapshots are encoded as differences against what each player confirmed. The code is in internal/protocol.
Interpolation shows every other player in the past. That keeps movement smooth, but it means a shooter aims at where the target was. If the server judged the shot against where the target is when the input arrives, a perfectly aimed shot at a moving target would miss whenever the target was moving sideways. This lesson explains how the server rewinds the world to the shooter's view, how far it is allowed to rewind, and what that costs the target. The code is in internal/lagco
A game server should spend its time simulating, not deciding who plays whom. This lesson follows a player from "I want to play" to an accepted UDP connection: the queue in Redis, forming a match, choosing a server, and the signed token that carries the matchmaker's decision to the server. The code is in internal/matchmaker/queue.go, internal/token and the game server's allocate handler.
One game server is a single point of failure, and it has to be replaced every time the game changes. A fleet of servers solves both, if the rest of the system always knows which servers exist, which can take new matches, and which have silently died. This lesson covers the registry built from expiring Redis records, the drain procedure for deploys, and what happens to matches when a server is killed. The code is in internal/gameserver/registry.go, server.go, and internal/matc
A match result is the one output of a game that players care about after the game. It must be recorded even if the network or the matchmaker misbehaves, and it must be recorded only once even if it is sent more than once. This lesson shows how the game server reports, why it retries, and how the matchmaker makes retries harmless with a signature, an idempotency key and one database transaction. The code is in internal/gameserver/report.go, internal/matchmaker/store.go and int
A game server that works with eight bots can still fail with eighty. This lesson explains what to measure in a real-time server, how the project exposes those measurements to Prometheus, how to load the fleet with bots and read the result honestly, and how the alert rules turn measurements into the few conditions worth waking someone for. The code is in internal/gameserver/metrics.go, internal/matchmaker/metrics.go and deploy/prometheus/.
Online games attract attackers for reasons other services rarely face: winning, griefing other players, and selling cheats. This lesson lists what an attacker can try against this system, which control in the code answers each attempt, and what the lab deliberately leaves open. Read it after the other lessons; it ties together controls you have already met.
Starting point: a copy of the project source and a workstation you may administer. Finishing point: Docker answers, has enough CPU, memory and disk for the lab, and the four loopback ports the lab will publish are free or replaced.
Starting point: workstation checks passed. Finishing point: a lab.settings file that Docker Compose reads in every terminal, and a Compose configuration that validates; no container exists yet.
Starting point: settings exported in this terminal; internet access for downloads. Finishing point: the static checks pass and the <prefix>-app:local image holds the four Go programs.
Starting point: the image exists and no lab containers are running. Finishing point: keys and passwords created once; PostgreSQL, Redis, the matchmaker, two game servers, netsim and Prometheus healthy; both servers registered in the fleet with free capacity.
Starting point: the lab is running with both servers registered. Finishing point: bots have played complete matches with no impairment and at 100 ms round trip with 2% loss; you have read their prediction error, round-trip time and snapshot statistics, watched a match on the spectator page, and compared delta and full snapshot bytes.
Starting point: the lab is running; netsim may still add 100 ms round trip. Finishing point: a cheating bot played a match without moving faster than the speed cap or firing faster than the cooldown, the server counted each kind of rejected input, and tampered, garbage, wrong-server, reused and expired connect tokens were each refused with their own reason.
Starting point: the lab is running and no other matches are in progress. Finishing point: three scripted duels measured the shooter's hit rate at 150 ms round trip with and without lag compensation, and at 450 ms with it; lag compensation is switched back on; netsim is back to no impairment.
Starting point: the lab is running with lag compensation on and no impairment. Finishing point: a replayed and a forged result changed nothing; a drained server finished its match while a new match went elsewhere; a killed server's match was abandoned, its alert fired and cleared after a restart, and new matches used the surviving server.
Starting point: both servers registered and idle. Finishing point: sixteen bots filled every match slot while four more waited, the capacity alert fired, and you recorded tick-duration percentiles, bandwidth, queue wait and the host load average.
Starting point: any state, including a failed step. Finishing point: no container, network or volume with your project label remains; the keys, passwords, results and ratings are gone with their volumes; images are kept and listed.
Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.
Runs entirely on your own workstation with Docker: no cloud account or paid service is used. The container images use about 1 GB of disk. Workstation, network and Docker licensing terms remain your responsibility.
Vectametric Project Source Licence (2026-09-27): personal learning, modification/deployment and attributed portfolio/interview demonstrations are permitted. Lawfully obtained copies remain usable after online access expires. Do not redistribute original source or the Source Pack; commercial/client production use requires separate permission. Third-party terms remain separate. See included LICENSE.txt and the Project Source Licence section of the site Terms.
You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.
Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.
No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.
The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.
The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.
Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.
Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy