Log inGet started
Package

tableKit.package

README.md

tableKit: game tables, seats, nameplates, turn indicators and table cameras

Players walk up to a table, take a seat, see everyone's name at their seat and whose turn it is, and look at the table from a proper table camera. tableKit is the furniture and the seating for any game played round a table: a card duel, a dice race, a board game, a quiz, a tea party.

  • Sit down: walk up to a free chair and a prompt appears (E, the pad's A, or tap it on a phone). You drop into the chair in a seated pose, your walk is stood down and the camera moves to the table. Esc, the pad's B or the Stand up button gives everything back.
  • Seats everyone agrees on: one authority (the room host for a scene table) assigns seats, so two players never land in one chair. A late joiner sees who sits where and can take a free seat or Watch from a spectator camera. A player who leaves frees their seat (seatFreed).
  • Names and colours: every seat has a colour and a nameplate with the player's name and an optional status line ("3 cards", "Dealer").
  • Whose turn: a turn indicator moves to the active seat, and that player sees a Your turn banner.
  • A place for your game: :surface() gives the tabletop's centre, height and size so other kits put a board, cards or a dice tray on it.
  • Every look is one setting: six table styles, round or long, 2 to 6 seats, five nameplates, five turn indicators, four camera views. A TableGallery flips through them live.
  • Every device: mouse and keyboard, gamepad and touch, in the desktop app and the browser, and a camera that frames the table on a tall phone screen.

Quick start

In your scene's build.luau:

local TK = require("tableKit.api")

function content()
    -- ... your floor, lighting and the normal walking player ...
    TK.Table { name = "Duel", position = { 0, 0, -3 }, style = "felt", shape = "round", seats = 2,
        nameplate = "brass", indicator = "spotlight", camera = "seat" }
    TK.Gallery {}   -- optional: a live style browser
end

Play, walk up to a chair and press E. In your game code (a component or the scene's entrypoint.luau):

local TK = require("tableKit.api")

TK.on("sat", function(e) print(e.name .. " sat in seat " .. e.seat .. " at " .. e.table) end)
TK.on("turn", function(e) if e.mine then print("my turn") end end)

local t = TK.table("Duel")
if t:isAuthority() then t:setTurn(1) end   -- the host runs the game
t:setStatus(1, "Dealer")
local top = t:surface()                       -- { centre = {x,y,z}, height, radius, halfX, halfZ, extent, yaw, toWorld }

What the scene needs

  • A player template (PlayerPrototype) with a walking humanoid body (the default humanoid avatar works) and a camera rig: the normal walking player. tableKit sits that player down; it does not build its own.
  • Nothing else. The kit brings its own input scheme (tableKit.seated stands the player controls group down while seated) and reads E / Enter, Esc / Backspace, C, G and the pad's face buttons directly. A humanoid body is posed with the kit's seated clip; a body with no skeleton is held in the chair as it is (or hidden, with pose = "hide").

Settings

Every setting of TK.Table{...} is a synced field of the tableKit.GameTable component, so a change reaches every player.

SettingDefaultWhat it does
name"GameTable"The name TK.table(name) finds, on every peer (carried in the synced key field).
position{ 0, 0, 0 }The floor under the table's centre.
yaw0Turns the table (degrees).
titlethe nameShown on prompts and the HUD.
style"felt"Table look: felt, tavern, kitchen, scifi, picnic, pixel.
shape"round"round or long (rectangular).
seats42 to 6.
nameplate"brass"brass, chalk, hologram, pixel, placecard.
indicator"spotlight"spotlight, ring, arrow, token, glow.
camera"seat"The view on sitting down: seat, top, orbit, cinematic.
spectatorCamera"cinematic"The view a spectator gets.
bannertrue"Your turn" banner for the active player (always on for glow).
prompttrueShow the sit / watch prompt; off if your game seats players itself.
reach1.7How close (m) a player must be to a seat to take it.
colliderstruePlayers walk round the table, not through it.
pose"sit"A seated body: sit (seated clip), hide, or stand beside the chair.
openfalseA try-out table (a gallery): any player may change whose turn it is, statuses and seats. Off, only the host's game code does, and a player's setTurn, nextTurn, setStatus, free or reset is refused.
hud"bottom"Where the seated bar (name, view, Stand up) sits: bottom, top, corner (bottom right, compact) or none (Esc / B still stand up). Use top, corner or none when your game draws a hand of cards at the bottom.

Names are forgiving: "Green Felt", "poker", "blanket", "8-bit", "coin", "overhead" all work (TK.normalize(kind, name)).

The catalog

Table styles (style)

idNameSeatsLook
feltGreen Felt Card Tableupholstered chairsWalnut apron and turned pedestal, padded leather rail, deep green felt, a stack of chips.
tavernTavern Tablethree-legged stoolsOak planks with an iron band, chunky legs, a pewter candle that flickers.
kitchenKitchen Tablespindle-back chairsPainted farmhouse table, oak top, linen runner, a jug of wildflowers.
scifiSci-fi Hologram Tablehover stoolsGunmetal pedestal, glowing rim, translucent hologram top with a scan ring and a spinning crystal.
picnicPicnic Blanketfloor cushionsA checked blanket on the floor, plump cushions, a wicker basket and a bowl of apples.
pixelPixel Tableblocky chairsChunky voxel table in bright retro colours with a stepped round top.

Shapes (shape) and seats

idSeats
roundSpread evenly round the top, seat 1 at the front. The top grows with the count.
longFacing across the long sides; 3 and 5 add a head seat, 6 uses both ends.

Seat colours, in order: Amber #f2b134, Sky #4aa8f0, Coral #ef5b4c, Mint #5fcf7a, Violet #b07ae8, Rose #f07ab8. Turn order runs round the table from seat 1.

Nameplates (nameplate)

idNameLook
brassBrass PlaqueEngraved brass on a walnut block, enamel strip in the seat colour.
chalkChalk SlateA framed slate, the name chalked in white with a coloured underline.
hologramFloating HologramA glowing panel over the seat that turns to face the viewer.
pixelPixel SignA blocky sign on a post with a pixel border in the seat colour.
placecardPlace CardA folded paper tent card with a coloured ribbon.

Turn indicators (indicator)

idNameLook
spotlightSpotlightA warm spotlight with a visible beam that glides to the active seat.
ringGlowing RingA pulsing ring of light on the floor round the active seat, in its colour.
arrowFloating ArrowA bobbing, spinning arrow over the active player's head.
tokenTurn TokenA spinning token that slides across the table to the active seat.
glowNameplate Glow and BannerThe active nameplate glows; the active player sees "Your turn".

Camera views (camera)

idNameWhat you see
seatSeat ViewOver your shoulder from your chair, down onto the table.
topTop DownStraight down, your seat at the bottom of the screen.
orbitOrbitCircles the table: drag, right stick, A/D or arrows.
cinematicCinematic DollyA slow drifting dolly, the spectators' default.

While seated, C (pad Y, or the view button) steps through the views.

API

local TK = require("tableKit.api")

CallReturns / does
TK.Table{...}Spawns a synced table entity (in build.luau content()); returns the entity.
TK.Gallery{ table?, open? }Places the TableGallery.
TK.table(nameOrEntity?)The live controller (no argument: the first table).
TK.tables()Every live table controller.
TK.mine()Where this player is: nil at no table, else { table, seat, watching, seated } (seat is nil while watching).
TK.on(event, fn, opts?)Listen on every peer; returns a connection with :Disconnect(). opts: a key string (a later on with the same event and key replaces this one) or { owner = entity } (ends once that entity is gone).
TK.CATALOG, TK.variants{ kind, tag, search }, TK.normalize(kind, name)The catalog.
TK.STYLES, TK.SHAPES, TK.NAMEPLATES, TK.INDICATORS, TK.CAMERAS, TK.SEAT_COLORSId lists.
TK.Catalog, TK.Layout, TK.Seating, TK.IndicatorsThe pure modules.

The controller (local t = TK.table("Duel")):

MethodWhat it does
t:sit(seat?)Ask for a seat (the first free one when nil).
t:stand()Stand up.
t:watch() / t:unwatch()Spectate with the spectator camera.
t:seats(){ [seat] = { peer, name, color, status, free } } for every seat.
t:seatCount(), t:mySeat(), t:seatOf(peer), t:peerAt(seat), t:isSeated(peer?), t:isWatching()Who sits where (isSeated() with no peer asks about this player).
t:setTurn(seat), t:nextTurn(), t:turn()Whose turn (0 = nobody); nextTurn skips empty seats.
t:setStatus(seat, text)A short line under the seat's name.
t:free(seat)Free a seat (reason kicked).
t:reset()Empty every seat and clear the turn.
t:surface(){ centre, height, shape, radius, halfX, halfZ, extent, yaw, rotation, toWorld(lx, lz) } of the tabletop.
t:seatTransform(seat){ position, rotation, yaw, facing, front, color }: the chair in the world and a spot on the top before it.
t:setCamera(view), t:camera()This player's view while seated or watching.
t:set(field, value) or t:set{...}Change a setting on every screen.
t:isAuthority(), t:config(), t:frame(), t:title()Who runs the table; its settings; its position and yaw.

Requests from any player go to the authority, which applies them and publishes the result. Run game rules on the authority (if t:isAuthority() then ... end).

Events

EventWhenFields
satA player took a seat.table, tableId, seat, peer, name, color, mine
stoodA player stood up.same
seatFreedA seat became free: reason is stood, left (they left the room), moved or kicked.same + reason
turnThe turn moved (seat 0 = nobody).same
statusA seat's status line changed.same + status
watch / unwatchThis player started or stopped watching.table, tableId, peer, mine
*Every event, with event naming it.

Every peer replays events from the synced state, so each fires once on every screen; a late joiner hears only what happens after it joined (read t:seats() and t:turn() for the state).

Inside the package

  • api (the interface), catalog, layout, seating, indicators (pure), models (the 3D look), registry (runtime, events, input, poses).
  • GameTable, TableCamera, TableGallery components; the seated input map; the sit animation (an original seated idle).
  • tableKit.testSuite: layouts, the seating model, turn indicators and the catalog, with nothing from the host world.
  • Guides: how-to-add-a-game-table-with-seats-nameplates-and-turn-indicators and how-to-make-players-sit-at-a-table-and-take-turns-step-by-step.

Known limits

  • One player per seat and one seat (or one watched table) per player at a time.
  • A body with no humanoid skeleton is not posed; choose pose = "hide" or "stand" for such avatars.
  • The authority is the table entity's owner (the room host for a scene table); if it leaves, the next owner carries on from the synced state.
  • Turn order and rules are your game's: tableKit holds whose turn it is, it does not decide it.

Changes

  • 1.0.12: on a phone or other small screen, the Sit / Watch prompt you see standing by a table is a centred column just under the touch buttons in the top corners, clear of the Jump and Sprint buttons at the bottom and of HUDs in the middle (a level bar). Seated and watching bars are unchanged. Checked by touch at 390x844.
  • 1.0.11: nobody takes someone else's turn. Whose turn it is, statuses, freeing a seat and resetting the table come only from the host's game code; a player's own setTurn or nextTurn is refused (in Game Night a player could hand himself the turn indicator at the card table). New open setting for a try-out table that visitors may play with. TK.on(event, fn, opts) takes a key or an owner entity, so listeners registered again in every play session no longer pile up.
  • 1.0.10: the turn chime description uploads in full (1.0.9 could carry it empty).
  • 1.0.9: the turn chime carries a description of what it is and when it plays (1.0.8 shipped it with a placeholder).
  • 1.0.8: clearer turns and a better seat. A glowing gem in the seat's colour turns and bobs over the head of whoever's turn it is, at every table whatever the indicator (Models.beacon), and a soft chime plays on a player's screen when the turn comes to them (sound, volume). The seat view is now the player's own eyes, just above and in front of the head, so their avatar no longer fills half the screen, and their own nameplate's words are hidden on their own screen in that view.
  • 1.0.7: phones and tablets. The seated bar at the top keeps clear of the engine's touch buttons (ui.safeArea().controls), and t:hudInset() says where it ends so a game's own screen (cards, a board panel) can start below it. The top view on a tall screen stays nearly straight down and widens its lens to fit the table, instead of leaning far back (a long table was small and far off on an upright phone); the camera's own lens comes back after.
  • 1.0.6: a second player can always sit and stand. Each table now listens for the requests sent to it from its own component instance and applies them in its own update; before, the registry module's listener could stay bound to an older copy of the registry after the kit was reloaded, so requests reached the host and were silently dropped (seen in a two-client test in Game Night: five Sit requests arrived and none seated the player). The registry's listener steps aside for tables that listen themselves.
  • 1.0.5: sitting down and standing up from a player who is not the room host always lands: the request is re-sent (up to six times, every 0.8 s) until the synced seats show it, so a request that crosses another state write on the authority is no longer lost. Found in a two-client test in Game Night, where a second player's Sit and Stand up sometimes did nothing. A seat someone else took in the meantime is not retried.
  • 1.0.4: tables resolve by name on every peer: TK.Table writes the name into the synced key field (an entity's name does not reach other players or joiners), and TK.table(name) matches it, then the entity name, then the title. Tables placed with an older TK.Table resolve by their title on other peers until the scene is rebuilt.
  • 1.0.3: the seat view sits higher and further over the shoulder so the tabletop, not your own head, fills the frame (16:9 and phone portrait); nameplate text reads the right way round from both sides of the table; a seated player's floating engine name label is hidden on every screen (their nameplate shows the name).
  • 1.0.2: the top-down view stays under a hanging lamp (2.55 m) and leans back from your seat to fit the whole top; a read right after the authority's own change (t:seats(), t:turn()) sees it at once; the gallery list scrolls.
  • 1.0.1: the spotlight's visible beam is hidden for a player seated at that table (the light and floor pool stay), so it never crosses the seat camera; new hud setting (bottom, top, corner, none) with a compact bar on phones and in the corner; names and status lines shrink (and wrap) to fit every nameplate style; t:isSeated(peer?); TK.mine() returns { table, seat, watching, seated }.
  • 1.0.0: first release.