gamelab

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gamelab is GameLab, a game backend: sign-in and a leaderboard over HTTP, matchmaking over WebSocket, and a UDP game server that players join with the ticket matchmaking gave them and send inputs to, answered on the server's tick. It is the reference app for the gaming pack.

Planted bottlenecks (see README.md), each switched off by a fix flag:

  • matchmaking: every tick, each waiting player is compared with every other to find the closest ratings, while holding the queue lock that joins also need, so the work grows with the square of the queue during a rush (fix "matchmaking" sorts the queue by rating once and groups neighbours).
  • leaderboard: each score re-sorts the whole leaderboard under its lock and each rank lookup scans it, so score submissions and reads slow down with the number of players (fix "leaderboard" keeps it sorted with binary-search inserts and finds ranks the same way).

Index

Constants

This section is empty.

Variables

View Source
var Modes = map[string]int{"duel": 2, "squad": 4}

Modes are the match sizes players can queue for.

Functions

func Open

func Open(cfg labkit.Config) (*labkit.App, error)

Open starts GameLab's UDP game server on cfg.Listen and returns the app.

func Seeded

func Seeded(fast bool) int

Seeded is how many players the leaderboard starts with: p1 to p100000 (p1 to p10000 with -fast).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL