One shared record per player, so team, class, alive state and stats stop living in four separate dictionaries that disagree after a reconnect.
GSPlayerRoster holds the rows. GSPlayer is the node that represents a player in the scene. GSPlayerComponent is the base class other player addons extend.
- Copy
addons/gs_player/andaddons/gs_core/into your project. - Enable both in Project > Project Settings > Plugins.
Needs Godot 4.7 or newer.
var roster := GSPlayerRoster.new()
roster.config = GSPlayerConfig.new()
add_child(roster)
roster.join("ada", "Ada", peer_id, tick)
roster.set_team("ada", &"blue")
roster.set_alive("ada", true)
# Once a tick or once a second: frees seats whose reconnect window is up.
roster.advance(tick)On a client, use the same class with authoritative = false:
mirror.apply_wire(payload) # the whole roster, on connect
mirror.apply_row(row) # one changed row afterwardsA mirror decides nothing. Every change method on it fails with CODE_FORBIDDEN.
A dropped connection keeps the player's seat. Calling join with the same key inside the reconnect window is a rejoin: same record, team, score and join tick, new peer id. Set reconnect_window_sec = 0 to remove players immediately, which suits a lobby. Held seats count towards max_players by default, so a stranger cannot take the seat of a player who is reconnecting.
All in GSPlayerConfig, layered like every GameSpice Core config (defaults, JSON file, environment, command line).
| Setting | Default | Meaning |
|---|---|---|
max_players |
0 | Player limit. 0 means unlimited. |
reconnect_window_sec |
60 | How long a dropped player's seat is held. 0 removes immediately. |
GSPlayer extends Node, not a body, so it works in 2D and 3D and for players with no body (spectators, the dead, passengers). It finds its body and components in its children.
GSPlayerComponent finds its player by walking up the tree, so no NodePath is needed. Subclasses override _on_bound and _on_unbound, not _ready, because the key is assigned after _ready. is_active() checks the bind and the local_only rule.
| Class | Purpose |
|---|---|
GSPlayerRecord |
One player row: key, name, peer, team, class, character, alive, counters, metadata. |
GSPlayerRoster |
Joins, rejoins, held seats, expiry, stable key order. Authoritative on the server, mirrored on clients. |
GSPlayerConfig |
Capacity, reconnect window, name handling. |
GSPlayer |
The scene node. |
GSPlayerComponent |
Base class for player components. |
See docs/design.md for details.
Zee's Games is a collection of games I made on GameSpice, for demonstration and for fun. They show what the platform can do, and they run on live servers you can join. Anybody can create games on GameSpice, and each addon is its own repository and can be used separately from the games and from the rest of GameSpice.
All fourteen games vendor it:
- Fatal Contact
- Airdrift
- Playlot
- Hungario
- Buses From Hell
- Smash Copter
- Zombie Zone
- Hide n Seek
- Prop Hunt
- Murder Mystery
- Deathrun
- Wipeout
- Dangerous Delivery
- Look At Me
The whole collection is at zeesgames.com.
Part of the GameSpice platform: a family of Godot addons, MIT licensed and built with Claude Code. Its headless suite is res://examples/player_selftest.tscn. The roster is not a shelf item: the games in Zee's Games are built on GameSpice addons and run on live servers, so reconnects and seats have met real players. Report problems on the issue tracker.
MIT licence, see LICENSE. The only closed part of the GameSpice platform is the web back end; you can use your own instead of GameSpice's.
