gamelab

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

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