Skip to content

feat: Chronicle - in-game "what's new" page with a red seal for unread releases - #588

Open
JaXt0r wants to merge 1 commit into
developfrom
feature/ingame-changelog
Open

JaXt0r wants to merge 1 commit into
developfrom
feature/ingame-changelog

Conversation

@JaXt0r

@JaXt0r JaXt0r commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

What

Chronicle: an in-game "what's new" page, written for players in Gothic's voice instead of PR titles.

  • New tab Chronicle in the VR help panel (Gothic-Unity logo), in game and in the main menu, next to the Achievements tab.
  • "What's new" button on the game profile menu (VR + Flat, shown when 2+ games/mods are installed). No game is loaded there yet, so the page is in English and has no pictures.
  • A red seal on the logo (main menu + in-game menu), the Chronicle tab and the "What's new" button marks a release the player hasn't opened yet. It goes away after one look; no pop-up. The seen state is <persistentDataPath>/Chronicle.json, shared by all games, not stored in saves.
  • Releases are grouped by category: Newly forged, Sharpened, Meatbugs squashed, plus Swifter and Still lurking in the dark when a release needs them. Each category's icon is an item picture from the player's own install, drawn like the achievement icons.
  • Data: StreamingAssets/Chronicle/chronicle.json, texts as language maps (EN + DE filled, English fallback). First release 0.4.0 "The Smith's Hammer" covers what landed since v0.3.0-alpha.

Technical:

  • New context Chronicle: models, ChronicleParser (pure), file and seen domains, and ChronicleService (ProjectScope, loaded in Bootstrap). The seen rule lives in one place, and the service raises the event ChronicleSeenChanged.
  • Shared pieces taken out of achievements, with the same behaviour: LocalizedText, LocalizedTextParser, StreamingAssetReader, PlayerFileWriter, GameIconView, UiPageArrow.
  • VRAchievementsTab → VRHelpCorePageTab, which loads any Core page through a serialized PrefabType.
  • Prefabs and scenes via UnityMCP: ChroniclePage, ChronicleSeal, Tutorials.prefab (7th tab), logo seals in VR - Player XRI.prefab and MainMenu.unity, GameProfileMenu.prefab, Gothic-UI keys chronicle.*.
  • Docs: Docs/chronicle.md (how to add a release), Docs/vr-help-panels.md, Docs/achievements.md, ADR Docs/adr/2026-12-04-chronicle.md.

Why

Players only learned about changes from GitHub/Discord, in developer language. Wireframe and discussion: in-session design (design skill), approved plan reviewed by architecture-reviewer.

How to test manually

Reset: delete <persistentDataPath>/Chronicle.json to get the seal back. Log category: Chronicle.

Prep

  • EditMode tests green (incl. ChronicleTest, CoreArchitectureTest)
  • G1 and G2 installed and listed in GameSettings.dev.json (the profile menu button needs 2+ profiles)

Game profile menu (Simulator or Flat)

  • No Chronicle.json: the "What's new" button sits under the columns, with a seal at its right edge
  • Click it: the page opens right of the columns (English, LiberationSans, no icons); the seal goes away
  • Page arrows are plain squares (no free arrow picture yet) but still page

Main menu (Simulator)

  • The seal is on the Gothic-Unity logo (after deleting Chronicle.json)
  • Click the logo: controls, hero slots and Help panels show; Help has the 7th tab "Chronicle" with a seal
  • Open it: release 0.4.0 "The Smith's Hammer" with its sections; the seals on the logo and tab go away
  • The loading screen logo has no seal

G1 in game (Simulator)

  • Delete Chronicle.json, start G1: the seal is on the menu logo; open Help → Chronicle and it goes away; it stays gone after a restart
  • Section icons are item pictures (glowing raw blade, hammer, health potion, haste potion, torch)
  • Up/down arrows page the entries; a section continues on the next page under its header
  • Achievements tab, page arrows and toast work as before (refactor)

G2 in game (Simulator)

  • Icons resolve through the G2 item names (ItMi_Hammer, ItPo_Health_01, ItPo_Speed)
  • With the language set to German: tab "Chronik", German entries, "Älter"/"Neuer"
  • Achievements still work

Edge cases

  • A broken Chronicle.json (e.g. {) is kept as .unreadable, the seal shows, and the game starts
  • Adding a newer release at the top of chronicle.json brings the seal back

Headset only (author)

  • Main menu Help panel placement is readable
  • Seal, icons and arrows aren't covered by the in-game menu's on-top background
  • Text sizes: 10 lines per page still fit when entries wrap
  • Profile menu page position (0.6-1.25 m right of centre): too far to the side?
  • Quest build: the Chronicle loads from the APK (StreamingAssetReader)

Test setup

Agents built and compiled it, and ran the EditMode tests (128 green). It has not been run in play mode yet. The steps above are meant for the VR Device Simulator (EnableVRDeviceSimulator = true) or the real headset (Production). There is no DeveloperConfig change.

Known gaps / follow-ups

  • No fallback arrow picture on the profile menu (white squares); needs our own small arrow sprite.
  • Flat has no in-game menu, so Flat sees the Chronicle only on the profile menu.
  • MainMenu.unity (Core) references the VR Tutorials.prefab (existing debt, architecture rule G); VR should place its main-menu panels itself.
  • Wiki Player Guide: mention the Chronicle tab and the "What's new" button.
  • Translations other than EN/DE: community.

AI usage

  • Claude: gathered the first entries from the merged PRs since v0.3.0-alpha. It drew the wireframe, ran the design (plan, ADR, architecture review of the plan), wrote the code, data and docs with sub-agents, built the prefabs, scenes and localization with a sub-agent through UnityMCP, and ran the review below.
  • Human: decided where the Chronicle shows, where the seal goes and how it's stored, no filters, the languages and the categories, and approved the plan.

AI review of ff70dfa

  • architecture-reviewer: fits with concerns, 4 findings (2 now, 2 later)
  • gothic-reviewer: approve with minor changes, 14 points (5 low risks, 5 content, 4 nits) + wiki follow-up
  • First review of this branch. Full reports in the comments.

Author's response

🤖 Generated with Claude Code

https://claude.ai/code/session_013BrTJTMXbQRQULj5o8W9DS

…read releases

Players find what each release brings in the VR help panel (in game and main
menu, tab "Chronicle") and behind a "What's new" button on the game selection
menu. A red seal on the Gothic-Unity logo, the tab and the button marks a
release not opened yet; it goes away after one look. No pop-up.

- Releases, categories (Newly forged, Sharpened, Meatbugs squashed, ...) and
  texts per language in StreamingAssets/Chronicle/chronicle.json, EN + DE
- category icons drawn from the player's install like achievement icons
- shared pieces taken out of achievements: LocalizedText, GameIconView,
  StreamingAssetReader, PlayerFileWriter, LocalizedTextParser, UiPageArrow
- VRAchievementsTab became VRHelpCorePageTab (loads any Core page)
- ADR Docs/adr/2026-12-04-chronicle.md, Docs/chronicle.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BrTJTMXbQRQULj5o8W9DS
@JaXt0r

JaXt0r commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

AI review of ff70dfa

First review of this branch.

architecture-reviewer: fits with concerns, 4 findings (2 now, 2 later)

Architecture review: origin/develop...HEAD (feature/ingame-changelog, ff70dfa), Chronicle

The automatic layer check did not run. .github/architecture-check targets .NET 9 and the only SDK here is 8.0.427 (NETSDK1045). The facts script reports no baseline additions and no asmdef, CLAUDE.md or .claude/ changes. Its one LATERAL hit is not a real violation: ChroniclePage uses Gothic.Services.UI because LocalizationService already sits in a namespace that doesn't match its folder.

1. Verdict: fits with concerns. The code follows the approved plan step by step, and all 8 plan findings are in. The one change I'd make before merging is that a PrefabType value is now saved as a number in a prefab, and the enum's layout makes it easy to break without noticing.

2. Structural summary

  • Shared pieces extracted, same behaviour:
    • LocalizedText (Model).
    • LocalizedTextParser, StreamingAssetReader, PlayerFileWriter (Domain, Domain/Localization/ and Domain/Files/).
    • GameIconView (Adapter helper) and UiPageArrow (Adapter helper, also used by AchievementsPage).
    • Achievements now use all of them; the old copies are deleted.
  • New context Chronicle:
    • 8 small Models.
    • ChronicleParser (pure), ChronicleFileDomain, ChronicleSeenDomain.
    • ChronicleService: ProjectScope singleton, Init() in BootstrapService.InitPhase1, so the Android read happens during loading.
    • The seen rule lives once, in ChronicleSeenData.IsUnseen/MarkSeen. Only the service calls it.
  • One new event, ChronicleSeenChanged: raised only by ChronicleService. ChronicleSeal listens while enabled; ChroniclePage listens to ItemIconReady while open. Both remove their listeners.
  • Adapters:
    • ChroniclePage and ChronicleSectionView: build when the page opens or flips, no Update.
    • ChronicleSeal: no Update, 4 instances.
    • VRAchievementsTab renamed to VRHelpCorePageTab, now with a [SerializeField] PrefabType.
    • GameProfileMenu toggles a nested ChroniclePage.
  • Assets:
    • The seal is placed as an instance override on the logo in MainMenu.unity and VR - Player XRI.prefab. This is on purpose and documented: the loading screen uses the shared logo prefab too.
    • The Core scene and prefabs reference no new VR, Flat or Lab guids.
  • Performance: no per-frame cost. The only LateUpdate is the existing one in VRHelpCorePageTab, which returns at once unless a flag is set, on 2 instances.

3. Findings

[Major, now] Assets/Gothic-VR/Scripts/Adapters/UI/Menus/VRHelpCorePageTab.cs:21 + Models/Caches/PrefabType.cs - first
  serialized PrefabType; Tutorials.prefab stores `_prefabType: 11` (UiAchievementsPage) and `54` (UiChroniclePage)
  (principle 3 / hidden coupling)
  cost: UiAchievementsPage sits mid-enum in the grouped "Ui*" block. Anyone adding e.g. `UiAchievementBadge` next to
    it (the file's grouping invites that) silently shifts the achievements tab to another prefab. The new
    "append at the end" comment sits at the bottom, far from the place where people insert.
  step: give the enum explicit values (at least UiAchievementsPage = 11, UiChroniclePage = 54) or move the
    warning into a <summary> on the enum itself; optionally an EditMode test asserting both ints.
[Minor, now] Assets/Gothic-Core/Scripts/Adapters/UI/Chronicle/ChronicleSeal.cs:20 - static
  `ReflexProjectInstaller.DIContainer?.Resolve<ChronicleService>()` instead of the plan's `[Inject]` + read in
  `Start` (plan finding 4; architecture.md: no new static access where injection works)
  cost: a new static-container example in a reusable adapter that others will copy. `Start()` is now redundant.
  step: `[Inject] private readonly ChronicleService _chronicleService;`, null-guard in Refresh, keep the Start read.
    If injection really can't reach the player-prefab instance, say why in the class comment and drop `Start`.
[Minor, later] Assets/Gothic-Core/Scripts/Adapters/UI/Chronicle/ChroniclePage.cs:142-230 - the line-based
  pagination (headers count `_headerLines`, a section split across pages under its header) is a rule inside an
  adapter (adapters are thin, principle 6)
  cost: the trickiest logic of the feature has no EditMode test, and the 274-line adapter mixes layout with paging.
  step: pure `ChroniclePagination.Paginate(release, linesPerPage, headerLines) -> List<ChroniclePageSlice>` in
    `Domain/Chronicle/`, tested in ChronicleTest; ChroniclePage only renders slice N.
[Minor, later] ChroniclePage.cs:263-268, AchievementsPage.cs:223, AchievementToast.cs:119 - "request the item
  icon if not drawn yet, then draw" now written 3 times (principle 3: one rule, one place)
  cost: a 4th icon user copies it again; a change to the request policy touches 3 adapters.
  step: move the `TryGetIcon == null -> Request` step into `GameIconView.Show` (it already gets `ItemIconService`).

4. Where to look

  • Read closely:
    • /home/jaxt0r/Gothic-workspace/Gothic-Unity/Assets/Gothic-Core/Scripts/Services/Chronicle/ChronicleService.cs
    • /home/jaxt0r/Gothic-workspace/Gothic-Unity/Assets/Gothic-Core/Scripts/Adapters/UI/Chronicle/ChroniclePage.cs
    • /home/jaxt0r/Gothic-workspace/Gothic-Unity/Assets/Gothic-Core/Scripts/Adapters/UI/Chronicle/ChronicleSeal.cs
    • /home/jaxt0r/Gothic-workspace/Gothic-Unity/Assets/Gothic-VR/Scripts/Adapters/UI/Menus/VRHelpCorePageTab.cs
    • /home/jaxt0r/Gothic-workspace/Gothic-Unity/Assets/Gothic-Core/Scripts/Domain/Files/PlayerFileWriter.cs
  • Safe to skim:
    • The Models/Chronicle/* files.
    • The achievements diffs (pure extraction).
    • Constants.cs, LogCat.cs, the Reflex/Bootstrap one-liners and the localization assets.
    • The prefab and scene YAML: the guids check out, and the seal and nested page are as planned.

5. Questions for the author

  • Does the MainMenu.unity diff contain no override that switches Help on, because Help is already active in Tutorials.prefab? Please confirm the main-menu help panel shows all three panels as decided (plan decision 2).
  • Why static resolve in ChronicleSeal rather than [Inject]? Is it a timing problem found in testing on the player prefab?
  • ChronicleSeenChanged is raised in Init() before any seal exists. Is it only defensive, or does a scene-bootstrap seal rely on it?
gothic-reviewer: approve with minor changes, 14 points + wiki follow-up

Verdict: approve with minor changes. I found no blocking bugs. I reviewed the diff statically and ran nothing in Unity. The prefab and scene YAML (ChroniclePage, ChronicleSeal, GameProfileMenu, MainMenu, Tutorials, Player XRI) I only grepped, so the wiring still needs the in-game checks at the end.

Achievements regression check: same behaviour

  • GameIconView is identical to the old AchievementIconView, plus a null-safe placeholder.
  • UiPageArrow is the old CreatePageArrow. The layer comes from the list root, as before. The texture and SetUpright(true) are the same, and the missing-picture warning is kept.
  • PlayerFileWriter is the old write path moved over: temp file, File.Replace, then the move-aside fallback for PlatformNotSupportedException. Same order and same restore-on-failure.
  • StreamingAssetReader is the old ReadStreamingAsset, unchanged.
  • LocalizedText and LocalizedTextParser behave as before: lower-cased keys and an English fallback.
  • AchievementText is gone and AchievementDefinition uses LocalizedText.
  • The PrefabType enum entry was appended at the end, so the numbers serialized in prefabs stay valid. The VRAchievementsTab to VRHelpCorePageTab rename keeps the meta guid. The new _prefabType field defaults to UiAchievementsPage, so the existing achievements tab still loads the right page.
  • Two cosmetic differences remain:
    • The parse error text changed from "title or description is missing" to "the title is missing" or "the description is missing". Nothing depends on the text.
    • Log prefixes for write and keep-aside failures changed from [Achievements] to [PlayerFileWriter]. They still use LogCat.Achievements.

Bugs and risks (all low)

  1. Assets/Gothic-Core/Scripts/Adapters/UI/Chronicle/ChroniclePage.cs, Awake and CreatePageArrow - the page's [Inject] fields include TextureService, ItemIconService and LocalizationService, and Awake dereferences _textureService.ArrowUpMaterial.
    • This page is also instantiated in the game profile menu, before any game is chosen. The fields may not exist or be initialised then (TextureService sets ArrowUpMaterial in its own init). The null material is guarded, but a null _textureService would throw in Awake.
    • A throw there would leave a dead "What's new" button.
    • Fix: null-check _textureService too, or confirm in the editor that the menu opens before game init. If the fallback arrow textures aren't assigned in the prefab, the arrows become plain squares plus a warning.
  2. ChroniclePage.OnEnable - MarkNewestSeen() runs on every enable, so the seal clears even if the player only toggles the "What's new" button open. That matches the ADR ("disappears after one look"). Be aware that the page marks the release seen as soon as it is visible, even if it is hidden behind other help-panel content.
  3. ChroniclePage.Refresh - the layout is rebuilt twice per flip (ForceRebuildLayoutImmediate, then again next frame). It is only on open or flip, so this is fine. The recursion on a flip past the last page terminates.
  4. ChronicleService.ResolveIconItem - it logs a warning once per category and VM, and the result is cached in _iconItems. The cache key is the VM instance, so a game switch invalidates it correctly. Good.
  5. ChronicleSeal.ChronicleService - it resolves from the static ReflexProjectInstaller.DIContainer. That is the PlayerScope container once one exists, otherwise ProjectScope. Resolution works either way because the service is a ProjectScope singleton. If the container is null, the seal is simply off.

Content: Gothic lore check of chronicle.json

  • Correct:
    • Garond's men in the "old castle" (Alte Burg) are Gothic 2 (Valley of Mines).
    • Meatbug (Fleischwanze) is right in both languages.
    • Adanos and Beliar exist in both games.
    • "Nameless hero" is right for both.
    • The icon items ItMiSwordrawhot, ItFo_Potion_Health_01 and ItPo_Health_01, ItFo_Potion_Haste_01 and ItPo_Speed, and ItLsTorchburning fit G1/G2 naming.
    1. Unverified: "Fellan hammers again, and Alwin hears every blow from his sheep pen. (Gothic 2)". Fellan and Alwin are Gothic 2 Khorinis NPCs, and the entry matches the fix/hammer-sound-range merge. I couldn't confirm Alwin's pen as the location from the repo or the Daedalus scripts. Please check it against Content/Story/NPC (SCHAFHIRTE or Alwin) or the world, or soften the wording.
    1. Unverified: "Greg finally puts on those farmer's clothes. (Gothic 2)". Greg is the Gothic 2 pirate captain, which is right. I couldn't confirm the farmer's-clothes detail from the diff, so check it against the actual fix.
    1. "Lightning strikes in both eyes" is unclear to players, who may read it as a gameplay effect rather than a rendering fix for both eyes. Suggest "Lightning is now drawn in both eyes."
    1. ItMi_Hammer, ItMi_Potion... and similar second candidates are guesses. They are harmless because they are only used when the first name is missing.
    1. The "new" entry "Light a torch with the trigger" and the other entries carry no game tag, which fits ADR decision 4, since only game-specific entries are tagged. The German texts read fine.

Style and nits

    1. ChroniclePage.OnItemIconReady uses System.StringComparison inline. Add using System;.
    1. ReflexProjectInstaller.cs - using Gothic.Core.Services.Chronicle; sits before Caches, so the usings are out of alphabetical order. Cosmetic.
    1. ChronicleSeenDomain.Load reads the file directly. PlayerFileWriter has no matching read helper, so the asymmetry is small and acceptable.
    1. A few Tooltips are near the 120-column limit. Check with the formatter.

Wiki follow-up (low)

  • The wiki (../Gothic-Unity.wiki) has no mention of the Chronicle. There is no new ini key, so nothing is missing from the "Supported ini settings" section. Add the help-panel tab and the "What's new" button to the Player Guide, and note that the chronicle file is StreamingAssets/Chronicle/chronicle.json. The seen state is Chronicle.json in persistentDataPath.

Config, DI and save/load

  • ChronicleService is registered in Reflex and initialised in InitPhase1. A second Init re-reads from disk, which is idempotent.
  • There is no DeveloperConfig change.
  • The seen state is deliberately outside the save games, as the ADR decides. The write is atomic.
  • The new localization keys exist in the shared data and in both the en and de tables.

Manual tests

  1. Fresh profile with no Chronicle.json: the red seal shows on the logo, the Chronicle tab and the "What's new" button. After opening the page the seals disappear and persistentDataPath/Chronicle.json holds 0.4.0. A restart shows no seal.
  2. Delete Chronicle.json: the seal returns. Corrupt it: a warning appears and an .unreadable copy is kept.
  3. Game profile menu (needs more than one profile installed): the "What's new" button toggles the page. It is in English, has no item icons, and the arrows work.
  4. In game on G1 and G2 (VR help panel): the category icons resolve per game. Page through the 10-entry "new" section with the arrows. The older and newer buttons work. German appears when the game language is German.
  5. Achievements tab in both games: icons, toast, page arrows and unlock persistence all work as before. Check that the toast and the list line still show the placeholder when there is no icon.
  6. Tab pictures stay on top in the in-game menu: the arrows and the seal are not covered by the on-top background pass.
  7. Android or Quest: the Chronicle file loads from the APK, and achievements definitions still load.
  8. Delete chronicle.json: a warning appears, the page shows empty, and the game starts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant