← Server architecture · all tasks
Multiple characters under one login
server-architecture/022 · created 2026-08-31 · updated 2026-08-31
Kris, 2026-08-31: “at some point I’m thinking we might want to allow multiple characters under the one login — not now.” This file is the requested sketch of what the change looks like, written while 021’s single-identity model is fresh; it is a design note in backlog form, not scheduled work.
What changes — DB
- New
characterstable:id,account_idFK → accounts,display_name,character_seed,entity_id(UNIQUE — the body id moves here from accounts),created_at,last_played_at. accountsslims to auth-only: keepid,created_at,banned_at; itsdisplay_name/character_seed/entity_idcolumns migrate away.- Boot migration (idempotent, additive): for every existing account, mint one character row from the account’s current three fields — nobody loses their adventurer.
sessionsgainsactive_character_id(nullable FK) — which character this device is playing.account_collections: decide whether the element collection is per-account (shared knowledge across your characters — likely, per the trading design) or per-character. Per-account = no schema change.
What changes — director
signup_email/ provider signup: same one transaction, now inserting account + identity + FIRST character together.- New messages:
create_character {displayName, characterSeed},select_character {characterId}(stamps the session); optionaldelete_characteris a DECISION, not a given (the no-delete-anything rule from 019 may extend here). whoamireturnscharacters: [...]plus the session’s active one; join grants (join_home_areaetc.) resolveentity_id/display_namefrom the ACTIVE CHARACTER, not the account.- Home Areas: today
ensureHomeAreais per-account. The one real design fork: per-character homes (each adventurer their own front door — more Areas, portals need a “whose home” answer) vs one shared family home per account (cheapest, no portal changes). Decide before building. - Protocol version bump (whoami shape changes); old clients refused as usual.
What changes — client
account_session.gd: trackactive_character_id;signup_emailunchanged in shape; newcreate_character/select_charactercalls.account_flow.gd: the signed-in view’s character panel becomes the character list/picker (the 70%-sized preview per character, tap to select, a ”+ new adventurer” tile reusing the existing signup character step).- Remembered logins already store one seed per account — becomes “the last played character’s seed”; no format change needed.
- e2e harness (
game/test-device/): extend the driver’s loop with create-second-character → switch → verify the overhead name changes.
What does NOT change
- One account ↔ one auth identity (021’s model) — characters multiply UNDER the login; the login stays singular.
- Sessions/auth flow, the entry sheet, the sign-in screens.
View source in repository · also available as raw markdown.