# Alts

> The Characters page

Page: https://polestar.guide/docs/contributors/architecture/alts (Polestar docs > Contributors > Architecture)

`addon/Polestar/Alts/` (`Alts\Alts.xml`, loaded after `Talents\Talents.xml`):
`Snapshot.lua` (`Polestar.Alts`: the saved snapshots, the events that write
them, the `alts` command), `Options.lua` (Discovery → Characters),
`View.lua` (the hub section, order 60).

```
Polestar.Alts.Key() -> "Name-Realm"                         -- as Maps/Instances.lua files its entries
Polestar.Alts.List(sortBy) -> entries                       -- the playing character first, then "seen" (default) | "rested" | "level"
Polestar.Alts.Forget(key) -> boolean                        -- never the playing character
Polestar.Alts.Write(silent, touch) -> boolean               -- the playing character's entry (touch: only `seen`); false with alts.enabled off
Polestar.Alts.ProjectRested(entry, now) -> xp | nil         -- no saved state; nil at the level cap (now defaults to the server time)
Polestar.Alts.Rested(entry, now) -> xp | nil                -- live for the playing character, else projected
Polestar.Alts.IsCurrent(entry), Polestar.Alts.MaxLevel(), Polestar.Alts.Enabled()
```

- **Store.** `PolestarDB.alts.chars["Name-Realm"]`, one small entry per
  character: name, realm, class, race, faction, level, xp, xpMax, rested,
  resting, zone, bind, money, profs (skill line to rank), tabs (up to six
  `{ id, title, step, count, complete }` from `Engine.GetTabs`) with `active`, `seen`
  (server time), `key`. Values that equal nothing are left out. An alt's
  entry is as of its last write, normally its logout.
- **Writes.** All in the world: at login (after five seconds, once the tabs
  exist), on resting changes at once, on level-ups, XP, zone, money, skill and
  tab changes coalesced into one write every ten seconds (a single pending
  timer) while not resting, and at once while `IsResting()` reads true, and at
  once when the player asks to leave (`PLAYER_CAMPING` / `PLAYER_QUITING`
  where the client has them). `Logout` and `Quit` are protected functions and
  are not hooked; writing at once while resting (an inn or city, where an
  instant logout is possible) is what leaves the saved entry current when
  they are used. Also when the Characters page is drawn (so the playing
  character is current there) and when `alts.enabled` is turned on. A write merges into the entry: a field that does not
  read keeps its saved value; the zone is the zone-type map above the player's
  map, not an indoor area's name. `PLAYER_LEAVING_WORLD` and `PLAYER_LOGOUT`
  read nothing and only move `seen`: the client answers wrongly while the
  world goes (resting false, no gold, no map, the indoor area for the zone),
  plausibly enough that nothing could tell, so those reads would overwrite
  good values. `ALTS_UPDATED` follows a write. `alts.enabled` (default on)
  off: no events registered, no writes; saved entries are still listed, and
  can be forgotten.
- **Rested XP.** `ProjectRested` uses Classic's rules as named constants
  (`REST_PER_8H`, `AWAY_FACTOR`, `REST_CAP`); Forever's rates are unverified,
  so an alt's figure is an estimate.
- **Section.** One `Button` row per character (so the gamepad can focus it),
  sorted by `alts.sort` (the hub tabs: Last played, Most rested, Level); the
  sidebar has an entry per character, which selects and scrolls to its row; the instance count, in the subtitle, is `Maps.GetInstanceStatus()`.
  Forget uses `W.Confirm`. `SHOW_ALTS` opens it (`/pole alts`).

---

Next page: [Toolchain](https://polestar.guide/docs/contributors/architecture/toolchain.md) · Every docs page: https://polestar.guide/llms.txt · All docs in one file: https://polestar.guide/llms-full.txt
