@zaisma/net
The online core: one room carries every kind of sync a game uses, characters, objects, events, turns and worlds of bodies many players act on at once. Each piece says what it shares, never how, and it runs the same on Zaisma's relay, on a game server in Zaisma's rooms, and on that game server run on a developer's own machine.
- Kind
- Foundation
- Built on
- @zaisma/standard
- Version
- 2.2.0
- Licence
- MIT, open source
- By
- btc7274
- Rated
- No ratings yet
ShellCopied
npx @zaisma/cli pieces add @zaisma/netWhat it needs
Nothing: it stands on its own.
Fits is said only for what Zaisma ran together. Not tested means nobody at Zaisma has.
Settings and hooks
Everything a game can change without editing the piece, so it moves to a newer version and keeps the game's changes.
- minimum_interpolation_delay_msThe least time behind the newest snapshot that what other players move is drawn. It grows by itself to how late and unevenly snapshots arrive, so nothing stalls or jumps; lower it for fights that need the freshest view, raise it to smooth a poor connection more.Number, 0 to 500, starts at 50Setting
- maximum_interpolation_delay_msThe most time behind the newest snapshot that what other players move is drawn, however late snapshots come. 0 is no limit.Number, 0 to 1000, starts at 0Setting
- interpolation_delay_modeadaptive draws others as little behind as their snapshots' lateness allows, never counting a stall a lost packet caused; fixed always draws them minimum_interpolation_delay_ms behind, so a hit is judged at the same delay every time.One of adaptive, fixed; starts at adaptiveSetting
- maximum_extrapolation_msHow far past the newest snapshot something another player moves keeps going while the next snapshot is late, before it holds still. 0 never guesses.Number, 0 to 250, starts at 100Setting
- correction_smoothing_secHow quickly a correction eases away when whoever is in charge saw something this player's game ran ahead somewhere else: most of it is gone in about twice this. 0 jumps at once.Number, 0 to 1, starts at 0.045Setting
- maximum_replay_pctIn a world, the most work a player's game spends going back and running steps again when the word differs from what it ran ahead, as a share of the steps it runs forward. Past it, a correction waits for the next step with room for it, so a crowded world never starves a game; raise it for a world of few players that wants every correction at once.Number, 5 to 100, starts at 50Setting
- snapshots_per_secHow many times a second whoever is the word on something says where it is: the game server, or on the relay each player's game for its own. Never more than the steps a second, and nothing is said while nothing changes.Whole number, 1 to 60, starts at 20Setting
- maximum_snapshot_size_bytesThe most one snapshot holds. What doesn't fit waits for the next and goes first there, so a crowded moment costs a little freshness, never a flood; under about 1,200 a snapshot also fits one datagram on a developer's own server.Whole number, 200 to 16000, starts at 1100Setting
- maximum_rewind_msHow far back a hit may be judged by what the attacker saw, counted from the step their input was made for: a player further behind than this is judged at this, so a slow connection is never an advantage.Number, 0 to 1000, starts at 500Setting
- turn_time_limit_secHow long a player has for their turn before it passes to the next. 0 is no limit.Number, 0 to 604800, starts at 0Setting
- objects_owner_left_modeWhat happens to a player's shared objects when they leave: removed, or handed to whoever is in charge of the room (the game server, or the room's host on the relay).One of remove, give_to_authority; starts at removeSetting
- before_eventOn a game server, asked before a player's event reaches anyone, with true and the event ({ playerId, eventName, payload, toPlayerIds, roomState }); answer false to stop it.Decision
- before_object_changeOn a game server, asked before a player makes, changes or removes a shared object, with true and the change ({ playerId, changeKind, object, changes, roomState }); answer false to refuse it, and that player's copy is put right.Decision
- before_inputWhere a player's inputs are taken (the game server, or the host's game for a world on the relay), asked before an input moves their character or their thing in a world, with the input as received and checked ({ kindName, entityId, playerId, roomState }); answer another input to change it, or null for none.Decision
- before_turn_moveWhere the room is decided (the game server, or the host's game on the relay), asked before a player's move in their turn counts, with true and the move ({ playerId, turnNumber, move, roomState }); answer false to refuse it.Decision
- entity_priorityWhere something is said to the players, asked how urgent a character or a thing in a world is for one viewer, with its usual urgency (1, or 8 for the viewer's own) and ({ kindName, entityId, viewerPlayerId, roomState }); answer more for what must stay freshest, less for what's far away, or 0 to hide it from that viewer. viewerPlayerId is null on the relay, where everyone hears the same.Decision
- correctedIn a player's game, told when whoever is in charge saw the player's own character or thing somewhere other than the game had it, with how far each field was off ({ kindName, entityId, difference, isSnapped }).Event
- mismatchTold once when the other side shares something else than this one (other kinds, other fields, or another ticksPerSec), so nothing it sends can be read ({ fromPlayerId, fix }).Event
- emittedTold when a character's or a world's step says something happened (emit), where it's run for the first time: in the player's own game once (never on a replay), and on the game server with what the player saw ({ kindName, entityId, eventName, payload, tickIndex, playerId, viewTickNumber, isReplay }).Event
- ticks_caught_upOn a game server, told when the room's steps fell behind its clock (a busy machine, a late call) and it ran the steps it owed at once, or skipped them when there were too many ({ caughtUpTickCount, skippedTickCount }).Event
- inputs_lateIn a player's game, told when whoever is in charge says this player's inputs arrived after their step had run, before the game moves further ahead to make up for it ({ lateTickCount }).Event
- stalledIn a player's game with a game server, told as soon as the game server hasn't answered this game's inputs for well past a trip there and back (three pings, at least half a second): a stalled connection, long before the room gives up on it. Show a hint. ({ quietMs })Event
- resumedIn a player's game, told when the game server is heard again after stalled ({ stalledMs }).Event
None.
Versions
- 2.2.0Nov 30, 2026 · 21 files · 426 KB · 12 files changed since 2.1.0Newest
- 2.1.0Nov 30, 2026 · 21 files · 398 KB · 14 files changed since 2.0.0
- 2.0.0Nov 29, 2026 · 21 files · 347 KB
No version has passed its checks yet.







