Skip to content

feat(lighting): author colored light sources - #64

Merged
zoeyrose merged 4 commits into
1.xfrom
feat/colored-lighting-75
Aug 10, 2026
Merged

zoeyrose merged 4 commits into
1.xfrom
feat/colored-lighting-75

Conversation

@zoeyrose

@zoeyrose zoeyrose commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add the exact six-digit object.light_color authored-content field and regenerate schema/editor projections
  • give representative wall torches and red/blue forcefields explicit light colors
  • cover schema constraints, Gridarta exposure, Python RGB bounds, live mutation paths, applied-item propagation, and save/load persistence
  • preserve the immutable provenance of the historical authored-syntax benchmark while advancing the current baseline lock

Validation

  • python3 tools/validate.py: 89/89 tests passed, including aggregate schema/catalog/runtime/package checks
  • generated authored-content projections are current
  • companion Classic profile build consumed content HEAD 2d7c68b178d6a3d5b94d6c2bedfa0c6fa6e4c77c
  • git diff --check passes and the worktree is clean
  • fresh whole-diff review found zero actionable findings

Companion to atrinik/classic#75 and atrinik/classic#77. The Classic PR is the canonical closing change.

@zoeyrose zoeyrose moved this to Review in Atrinik work Aug 10, 2026
@zoeyrose
zoeyrose marked this pull request as ready for review August 10, 2026 10:37
@zoeyrose
zoeyrose merged commit 0eea49e into 1.x Aug 10, 2026
5 checks passed
@zoeyrose
zoeyrose deleted the feat/colored-lighting-75 branch August 10, 2026 15:41
@github-project-automation github-project-automation Bot moved this from Review to Done in Atrinik work Aug 10, 2026
zoeyrose added a commit to atrinik/classic that referenced this pull request Aug 10, 2026
## Summary

- add strict `light_color RRGGBB` object support, fixed-point RGB
propagation, live Python mutation hooks, and colored applied-light
behavior while preserving scalar gameplay visibility
- extend MAP2 protocol v1075 with sparse RGB samples and ordered,
bounded continuation packets
- render per-channel smooth lighting across ground, walls, roofs,
objects, fog boundaries, and linked depths, with coherent discrete
fallback and stale-state resets
- add server, protocol, client-state, Python lifecycle, and
deterministic pixel-exact regressions

## Protocol and compatibility

- Classic protocol advances from 1074 to 1075 and retains exact-version
rejection.
- `MAP2_FLAG_EXT_LIGHT_RGB` follows the complete seven-bit field bitmap
and precedes animation data. A zero bitmap resets prior explicit color
to scalar gray.
- Full packets declare a `uint16_t` continuation count; partial packets
carry ordered sequence/map/scroll identity. Level payloads are capped at
65,522 bytes so the 7-byte partial header plus 5-byte level frame remain
within the 65,534-byte envelope.

## Performance and limits

Measurements were taken on this runner at Classic base `fca1eb0e` and
head `52d85b4b`; client timings use Release builds and 100 samples after
five warmups around the single `map_draw_map()` call in the frozen
320×240 software-renderer fixture. Server microbenchmarks use the Debug
test build, a 21×21 map, and 1,000 iterations.

| Surface | Ordinary / before | Colored or dense / after | Bound and
interpretation |
| --- | ---: | ---: | --- |
| Frozen full MAP2 fixture | 325 B at v1074 | 327 B neutral; 525 B
colored multi-depth | Neutral cost is +2 B (+0.62%) for continuation
count; color remains sparse. |
| Live ordinary room MAP2 | 11,128 B full; 46 B unchanged; 1,116 B
one-tile scroll | 2,277 B initial red; 48 B same-level hue change; 37 B
neutral reset | Delta-only hue/reset packets remain small; neutral
scrolling has no per-tile RGB payload. |
| Dense 21×21 producer | n/a | 116,909 B across 2 payloads; largest
65,487 B | Every payload is below 65,534 B; validation proves ordered
complete tile records. |
| Server source update pair | 15.17 µs neutral remove/add | 47.21 µs
colored remove/add | +32.04 µs per authored colored update; no
frame-loop scan is introduced. |
| Server full rebuild | 12.69 µs neutral | 28.84 µs colored | +16.15 µs
for one radius-13 source on 21×21; work stays source/mask bounded. |
| Client lighting frame | 29.25 ms base neutral | 32.97 ms current
neutral; 32.77 ms colored | Head is +3.72 ms (+12.7%) versus base and
colored adds no further cost in this fixture; bounded below 4 ms
regression. |
| Sample buffers, one 320×240 active depth | 308,080 B | 615,920 B |
+307,840 B; the 307,200-byte RGBA lightmap is unchanged. |
| Sample buffers, all 13 depths | 4,005,040 B | 8,006,960 B | +4,001,920
B (3.82 MiB); inactive-depth contexts are freed. |
| Lit-sprite cache, first frozen frame | 1 hit / 3 misses neutral | 1
hit / 10 misses colored multi-depth | More unique RGB signatures
correctly create distinct entries. Exact signatures are reusable; LRU
remains capped at 8 MiB per active depth and inactive-depth caches are
freed. |

The measured costs are bounded and intentional: neutral wire traffic is
effectively unchanged, RGB work is limited to explicitly colored state,
and the largest client delta is under 4 ms in the deterministic
software-renderer fixture.

## Validation

- `./atrinik build all --profile issue-75-colored-lighting --test`
- protocol: 2/2 passed
- libatrinik: 14/14 passed, including loopback socket/curl/STUN coverage
- client: 30/30 passed, including map color-state and smooth/discrete
pixel-exact player views
- server: 36/36 passed, including lighting, dense MAP2, applied-light,
and Python mutation/persistence coverage
- content companion: `python3 tools/validate.py` passed 89/89
- `python3 tools/verify_import_history.py`: verified five imported
histories
- all changed C headers/sources pass `clang-format --dry-run --Werror`;
`git diff --check` passes
- isolated topology `issue75-colored`, profile
`issue-75-colored-lighting`, state `scenario-issue75-colored`: latest
Classic/content heads resolved cleanly, server ready, client completed
the QUIC handshake and opened its asset stream; topology stopped
afterward

## Companion change

- atrinik/content#64 adds the exact schema/editor field, representative
warm/green/red/blue authored sources, and Python validation/lifecycle
coverage on `1.x`.

Closes #75
zoeyrose added a commit that referenced this pull request Aug 11, 2026
## Summary

- add exact six-digit `object.light_color` schema, generated metadata,
editor projection, catalog/core coverage, and representative
torch/forcefield examples from #64
- carry the completed #65 reviewed palette across 97 archetypes, 4
artifacts, and 11,393 effective instances without changing radii,
placement, obstruction, or gameplay visibility
- add a deterministic main-line semantic ledger that resolves
inheritance, artifacts, map overrides, invisible sources, and
toggle-active states and fails on new, stale, or changed review rows
- preserve the pinned Classic art-direction decisions from #67 while
excluding Classic screenshots, capture manifests, proof maps, and
runtime-evidence tooling

Closes #66.

Source work: #64 and #67.

- #64 commits carried: `d164ef40f9f09cdc28be2e9308d108737d0aec6a`,
`2b7b452cb3b1d2086266ebb18d9b11d30d866117`, and
`7874441f9440ee0930f20a354e3f66c031b4ceb4`
- #67 completed audit batch carried from reviewed head
`958b557650252518b9ea2850200920d07c879bd2`

## Coordinates

- Base: `main` at `875ef6f7a44c1b8d9b864137eda321a3d29526e5`
- Head: `feat/66-colored-lighting-main` at
`c7c8c3d5c227a9dd7eaf98584209cbe32a124074`
- Worktree:
`/workspaces/atrinik/workspace/worktrees/content/issue-66-colored-lighting-main`
- Profile: `issue-66-colored-lighting-main`
- Commits:
- `8f60041dee1b4b0295d70df5c929e4570527869e feat(lighting): author
colored light sources`
- `c78993f29056cb3aa8dd9660812add6589379f98 test(lighting): validate
Python RGB bounds`
- `ddc733c2e7d888f67e793c48d60aa7816af45bd5 fix(lighting): complete
editor and Python coverage`
- `c7c8c3d5c227a9dd7eaf98584209cbe32a124074 feat(lighting): port
reviewed light-source palette`

The fourth #64 source commit,
`2d7c68b178d6a3d5b94d6c2bedfa0c6fa6e4c77c`, was already present
identically on `main` and therefore produced an empty port.

## Validation

Passed on committed head `c7c8c3d5c227a9dd7eaf98584209cbe32a124074`:

```text
python3 tools/validate.py
python3 tools/world_content_audit.py lights --check
python3 -m json.tool maps/light-source-review.json
git diff --check 875ef6f...HEAD
```

- 119 unit tests passed
- 3,559 canonical archetype plurals remain complete
- 1,354 archetypes and 3,650 maps pass lossless validation
- light audit: 97 archetypes, 4 artifacts, 11,393 instances across 625
maps; 5,558 explicit colors, 5,936 intentional neutral, zero unreviewed
- 336 generated schema fields are current
- catalog: 8,098 definitions and 68,563 references
- grammar contracts, authored-syntax round trips, resource collection,
licensing, provenance, and isolated runtime packaging passed

## Replacement capability boundary

The exact profile and topology inspection commands are:

```sh
cd /workspaces/atrinik
./atrinik profile show issue-66-colored-lighting-main --json
./atrinik topology show issue-66-colored-lighting-main --state default --json
cd /workspaces/atrinik/workspace/worktrees/content/issue-66-colored-lighting-main
python3 tools/world_content_audit.py lights --check
python3 tools/validate.py
```

The profile resolves content exactly to this worktree and head. The
replacement stack does not yet provide integrated content build,
runtime, or renderer adapters; those boundaries are tracked by
atrinik/atrinik#266, atrinik/atrinik#269, and atrinik/atrinik#270. The
main-line checks therefore prove authored/schema/catalog/semantic
compatibility without claiming visual activation, and Classic is not
substituted as replacement verification.

No topology or scenario was created or started. There is nothing to shut
down or clean up; preserve the profile, worktree, and ignored review
report while this PR is open.

## Review

Three independent fresh-context reviews plus a primary complete
whole-diff pass found zero actionable findings on exact head
`c7c8c3d5c227a9dd7eaf98584209cbe32a124074`.

- all 151 authored path-and-RGB additions exactly match the union of #64
and #67, with none missing or extra
- all 19 palette entries, 97 archetypes, 4 artifacts, 120 color
suppliers, 14 toggle states, 7 contextual checks, and 625 map
decisions/rationales are preserved
- 24 regenerated semantic hashes are limited to the 10 blue/red
forcefield definitions, their 10 supplier rows, and 4 dependent maps
whose main-line source locations differ because of pre-existing explicit
plurals
- every authored hunk is a `light_color` addition; no radius, placement,
obstruction, visibility, binary, mode, or unrelated release-line change
is present
- all four latest-head GitHub checks pass, and there are no review
comments or threads
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.8.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

zoeyrose added a commit that referenced this pull request Aug 23, 2026
## Summary

- add exact six-digit `object.light_color` schema, generated metadata,
editor projection, catalog/core coverage, and representative
torch/forcefield examples from #64
- carry the completed #65 reviewed palette across 97 archetypes, 4
artifacts, and 11,393 effective instances without changing radii,
placement, obstruction, or gameplay visibility
- add a deterministic main-line semantic ledger that resolves
inheritance, artifacts, map overrides, invisible sources, and
toggle-active states and fails on new, stale, or changed review rows
- preserve the pinned Classic art-direction decisions from #67 while
excluding Classic screenshots, capture manifests, proof maps, and
runtime-evidence tooling

Closes #66.

Source work: #64 and #67.

- #64 commits carried: `b8b9cc3dcb8e376decd9bc83ea87e3238428515a`,
`7ca5279e22424dc026f0b10830e8fc94f3161336`, and
`6c7ef2b46ced053b4764e98cf6ac66ff0a90ac2f`
- #67 completed audit batch carried from reviewed head
`cdc6c57b0ef3d4739c99e846eb2054e4eafdce26`

## Coordinates

- Base: `main` at `6394de2e386bdace28285b3ccfceca4149a15e65`
- Head: `feat/66-colored-lighting-main` at
`df387a752992880423f7eed7633a03a0fc71d5e0`
- Worktree:
`/workspaces/atrinik/workspace/worktrees/content/issue-66-colored-lighting-main`
- Profile: `issue-66-colored-lighting-main`
- Commits:
- `313dd0f4c2cac72adedf2ab6cdc38f40c861ba39 feat(lighting): author
colored light sources`
- `9f55a00c1feff57d242bdf88c2081695e01956cc test(lighting): validate
Python RGB bounds`
- `6459b7808b98266ce9d0a5d9ec3c6904c7e30e0a fix(lighting): complete
editor and Python coverage`
- `df387a752992880423f7eed7633a03a0fc71d5e0 feat(lighting): port
reviewed light-source palette`

The fourth #64 source commit,
`0a2d4538f59234a75d59c364ec28b87d16172b6a`, was already present
identically on `main` and therefore produced an empty port.

## Validation

Passed on committed head `df387a752992880423f7eed7633a03a0fc71d5e0`:

```text
python3 tools/validate.py
python3 tools/world_content_audit.py lights --check
python3 -m json.tool maps/light-source-review.json
git diff --check 6394de2...HEAD
```

- 119 unit tests passed
- 3,559 canonical archetype plurals remain complete
- 1,354 archetypes and 3,650 maps pass lossless validation
- light audit: 97 archetypes, 4 artifacts, 11,393 instances across 625
maps; 5,558 explicit colors, 5,936 intentional neutral, zero unreviewed
- 336 generated schema fields are current
- catalog: 8,098 definitions and 68,563 references
- grammar contracts, authored-syntax round trips, resource collection,
licensing, provenance, and isolated runtime packaging passed

## Replacement capability boundary

The exact profile and topology inspection commands are:

```sh
cd /workspaces/atrinik
./atrinik profile show issue-66-colored-lighting-main --json
./atrinik topology show issue-66-colored-lighting-main --state default --json
cd /workspaces/atrinik/workspace/worktrees/content/issue-66-colored-lighting-main
python3 tools/world_content_audit.py lights --check
python3 tools/validate.py
```

The profile resolves content exactly to this worktree and head. The
replacement stack does not yet provide integrated content build,
runtime, or renderer adapters; those boundaries are tracked by
atrinik/atrinik#266, atrinik/atrinik#269, and atrinik/atrinik#270. The
main-line checks therefore prove authored/schema/catalog/semantic
compatibility without claiming visual activation, and Classic is not
substituted as replacement verification.

No topology or scenario was created or started. There is nothing to shut
down or clean up; preserve the profile, worktree, and ignored review
report while this PR is open.

## Review

Three independent fresh-context reviews plus a primary complete
whole-diff pass found zero actionable findings on exact head
`df387a752992880423f7eed7633a03a0fc71d5e0`.

- all 151 authored path-and-RGB additions exactly match the union of #64
and #67, with none missing or extra
- all 19 palette entries, 97 archetypes, 4 artifacts, 120 color
suppliers, 14 toggle states, 7 contextual checks, and 625 map
decisions/rationales are preserved
- 24 regenerated semantic hashes are limited to the 10 blue/red
forcefield definitions, their 10 supplier rows, and 4 dependent maps
whose main-line source locations differ because of pre-existing explicit
plurals
- every authored hunk is a `light_color` addition; no radius, placement,
obstruction, visibility, binary, mode, or unrelated release-line change
is present
- all four latest-head GitHub checks pass, and there are no review
comments or threads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant