From 389e307f205f9b7edf604fb9f86e1038ead736ef Mon Sep 17 00:00:00 2001
From: historia <[not public]>
Date: Tue, 16 Jun 2026 23:37:50 -0400
Subject: feat: major xterm256 color overhaul, see worldbuilding docs.
---
AGENTS.md | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
(limited to 'AGENTS.md')
diff --git a/AGENTS.md b/AGENTS.md
index 6dc559b..7dc4c47 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,6 +1,6 @@
# AGENTS.md
-Third Collapse — a Runescape-like sci-fi MUD written in Go. Data-driven via YAML files. No database, no ORM.
+The House of Icarus — a Runescape-like sci-fi MUD written in Go. Data-driven via YAML files. No database, no ORM.
Set on a terraformed asteroid where technology has regressed. "Science" replaces Prayer, "Technology" replaces Magic, Scavenging replaces Runecrafting.
@@ -37,7 +37,7 @@ internal/
combat/ Combat state tracking, combat lock, OSRS-style combat formulas
object/ ItemDef, ObjectDef, item/object YAML loaders, EquipSlot, WeaponType, ItemStats
engine/ Tick scheduler — configurable ms interval, subscriber pattern, ToTicks()
- color/ ANSI 16-color and xterm256-color escape code tags (text, , etc.)
+ color/ xterm-256 color system with auto ANSI downgrade, numeric palette (0-255), gradients, inline tags
```
`internal/game/` is the largest package. Key files:
@@ -111,7 +111,23 @@ data/players/characters/ Character YAML (gitignored)
Wander config (`wander_rooms`, `wander_interval`) is set per-instance in room YAML — mob defs are generic. Mobs wander via legal (unconditioned) room exits; objects teleport between rooms in their list.
-See `WORLDBUILDING.md` for full YAML format reference with examples.
+See `worldbuilding_guide/` for full YAML format reference with examples.
+
+## Inline Color Tags
+
+Room descriptions (and prompts) support inline color tags using `{spec}text{/}` syntax. Untagged text in room descriptions uses the `room_desc` color target.
+
+```yaml
+description: "On the table lies a {182 bold}mysterious vase{/} with a rose in it."
+```
+
+Tag spec format matches the color command: `{<0-255> [bold] [dim] [underline]}text{/}`.
+
+Gradients are supported: `{g:196,82}gradient text{/}`. Multi-stop: `{g:45,39,59}three stops{/}`.
+
+Gradients interpolate in RGB space across the xterm-256 palette. In ANSI mode, each character maps to the nearest ANSI color.
+
+Item and object YAML `color` fields also support gradient syntax: `color: "g:196,208,226"`.
## Commands
@@ -127,14 +143,17 @@ See `WORLDBUILDING.md` for full YAML format reference with examples.
| `exits` | List available exits |
| `help [topic]` | Help topics from data/help/ |
| `map` | BFS ASCII map centered on player |
-| `option` / `options [name] [value]` | Character settings (see Option System) |
+| `option` / `options [name] [value]` | Account-wide settings (see Option System) |
| `alias ` | Account-wide command alias with arg passthrough |
| `unalias ` | Remove an alias |
| `description` / `desc` | Set custom player description |
+| `prompt ` | Set custom per-character command prompt |
| `queued` | Show pending tick actions |
| `color` / `colors [target] [value]` | Customize display colors (account-wide) |
| `color reset ` | Reset a color target to server default |
| `color off` | Disable color for a specific target |
+| `colortable` | Display xterm-256 color reference chart |
+| `style ` | Set combat style: accurate, aggressive, defensive, balanced (prefix match) |
### Free (stackable, execute before active)
| Command | Description |
@@ -142,7 +161,6 @@ See `WORLDBUILDING.md` for full YAML format reference with examples.
| `wear` / `wield - ` | Equip item to correct slot. `wear all` auto-equips best per slot |
| `wear all` | Auto-equips highest-value item per slot from inventory |
| `remove` / `unwear` / `unwield
- ` | Unequip item back to inventory |
-| `style ` | Set combat style: accurate, aggressive, defensive, balanced (prefix match) |
| `eat
- ` | Eat food to heal (3-tick cooldown, can eat during combat) |
### Active (replaces previous active, queued per tick)
@@ -343,7 +361,7 @@ See `internal/game/action_burn.go`.
## Option System
-Player options set via `option `:
+Account-wide options set via `option `. Options are stored in the account YAML and shared by all characters on the same account.
| Option | Type | Default | Description |
|---|---|---|---|
@@ -357,7 +375,7 @@ Player options set via `option `:
| `reserve` | bool | true | Show full reserved item details |
| `depletion` | bool | false | Show depletion and despawn timers |
| `despawn` | bool | false | Show ground item despawn timers |
-| `color` | string | "none" | none/ansi/xterm256 — color output mode |
+| `color` | string | "xterm256" | none/ansi/xterm256 — color output mode |
| `mapwidth` | int | 30 | Map viewport width |
| `mapheight` | int | 20 | Map viewport height |
| `mappadding` | string | "none" | none/x/y/xy — blank-row stripping |
@@ -365,7 +383,10 @@ Player options set via `option `:
| `queue_silently` | bool | true | Suppress queue messages |
| `room_desc_width` | int | 70 | Room desc line wrap width |
| `unicode` | bool | true | Unicode box-drawing characters |
-| `prompt` | string | "> " | Custom command prompt |
+
+Prompt is NOT an option — it is a per-character setting via the `prompt` command. Default: `"> "`. Stored in character YAML as `prompt:`.
+
+New accounts are asked "Should I disable color? [y/N]" after password creation. Pressing enter defaults to No (xterm256 enabled). Choosing Y sets color to "none".
## ItemDef Fields
@@ -438,6 +459,7 @@ From `internal/net/server.go`:
| `StatePassword` | Entering password |
| `StateNewAccountPass` | Setting password for new account |
| `StateNewAccountConfirm` | Confirming password |
+| `StateColorChoice` | New account: "Should I disable color?" |
| `StateMenu` | Main menu |
| `StateNewCharName` | Naming new character |
| `StateRenameAccount` | Renaming account |
@@ -449,6 +471,8 @@ From `internal/net/server.go`:
| `StateChangeDescription` | Setting player description |
| `StateTalk` | NPC conversation input |
| `StateDropAllConfirm` | Confirming `drop all` |
+| `StateCookRecipe` | Cook recipe selection |
+| `StateColorChoice` | New account color preference |
## Adding a New Skill
--
cgit v1.2.3