Skip to content

Add interactive new-player tutorial (static, at /tutorial) - #54

Open
whitecouncil-alt wants to merge 3 commits into
MUME:masterfrom
whitecouncil-alt:feat/tutorial-static
Open

Add interactive new-player tutorial (static, at /tutorial)#54
whitecouncil-alt wants to merge 3 commits into
MUME:masterfrom
whitecouncil-alt:feat/tutorial-static

Conversation

@whitecouncil-alt

@whitecouncil-alt whitecouncil-alt commented Sep 8, 2026

Copy link
Copy Markdown

Adds a self-contained interactive new-player tutorial at /tutorial.

It walks a brand-new player through their first hour — character creation, movement, the live map and description panels, and staying alive — opening with a short cinematic MUME logo intro.

  • Served statically from docs/public/tutorial/ (no backend needed); deploys with the site.
  • All 17 lessons are baked into the page. The in-browser editor we used to build it is hidden in this static build.
  • Intended as the destination for the Play page's "first time" path (the Play chooser proposal). Once this is in, that button can point at /tutorial instead of the temporary preview URL.
  • Easy to replace/refresh later by swapping the file.

Preview: docs.mume.org/pr-<n>/tutorial/

Summary by Sourcery

Add a static, interactive new-player tutorial at /tutorial to guide first-time players through the essentials of MUME.

New Features:

  • Add a self-contained interactive tutorial at /tutorial that introduces new players to MUME’s world, commands, movement, character creation, survival, communication, and progression.
  • Include a cinematic MUME logo introduction, responsive terminal-style interface, interactive lesson progression, command practice, live map and room-description previews, and a printable command sheet.

Enhancements:

  • Package all tutorial content and functionality in a static page that requires no backend at runtime.
  • Support reduced-motion preferences and mobile layouts while preserving tutorial navigation and command references.

Deployment:

  • Deploy the tutorial as static site content under docs/public/tutorial/.

A self-contained walkthrough of a new player's first hour (character creation,
movement, the map/description panels, staying alive), with a cinematic MUME logo
intro. Served statically from docs/public/tutorial/ at /tutorial — no backend.
Content is baked in; the in-browser editor is hidden for the static build.
Intended as the destination for the Play page's 'first time' path (see the
Play chooser PR). Easily replaced later.
@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a static /tutorial experience under docs/public/tutorial/, combining a cinematic intro with a terminal-like, interactive 17-lesson onboarding flow, simulated map/description panels, command-sheet support, and a hidden browser editor for maintaining or publishing lesson content.

Flow diagram for the tutorial lesson engine

flowchart TD
    A[Load /tutorial] --> B[boot]
    B --> C{Published content available?}
    C -->|Yes| D[Use fetched lessons]
    C -->|No| E[Use local draft or DEFAULT]
    D --> F[restart]
    E --> F
    F --> G[showLesson]
    G --> H{Lesson has practice command?}
    H -->|No| I[Advance on Enter]
    H -->|Yes| J[Validate typed command]
    J -->|Incorrect| K[Show hint]
    K --> J
    J -->|Correct| L{Example response exists?}
    L -->|Yes| M[Show example and await Enter]
    M --> I
    L -->|No| I
    I --> N{More lessons?}
    N -->|Yes| G
    N -->|No| O[showEnd]
    O --> P[Character creation handover]
Loading

File-Level Changes

Change Details Files
Add a static, self-contained tutorial page that simulates a MUME terminal and guides new players through 17 data-driven lessons.
  • Render lesson content, command teaching, practice validation, examples, progress, skipping, restart, and character-creation handoff entirely in the browser.
  • Load default lesson data from the page while supporting published, shared, and locally saved content sources.
  • Provide responsive terminal styling, cinematic logo intro, reduced-motion handling, and mobile layouts.
  • Include a simulated MMapper map and description view during the relevant lesson, plus an iframe-based printable command sheet.
  • Store tutorial edits locally and expose a hidden editor with lesson CRUD, import/export, sharing, publishing, and version restore controls.
docs/public/tutorial/index.html
Add externalized lesson content and static tutorial assets for deployment with the documentation site.
  • Package the tutorial's 17 lessons as JSON content.
  • Provide the logo, map, description, and font assets referenced by the static page.
docs/public/tutorial/assets/content.json
docs/public/tutorial/assets/mume_logo.jpg
docs/public/tutorial/assets/map.png
docs/public/tutorial/assets/desc.png
docs/public/tutorial/fonts/kelt.woff2
docs/public/tutorial/fonts/kelt-bold.woff2
docs/public/tutorial/fonts/Merriweather-Regular.woff2
docs/public/tutorial/fonts/Merriweather-Italic.woff2

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 4 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/public/tutorial/index.html" line_range="154" />
<code_context>
+  }
+
+  /* ===================== cinematic layer (preview only) ===================== */
+  @font-face{font-family:'Kelt';src:url('fonts/kelt.woff2') format('woff2');font-weight:400;font-display:swap}
+  @font-face{font-family:'Kelt';src:url('fonts/kelt-bold.woff2') format('woff2');font-weight:700;font-display:swap}
+  @font-face{font-family:'Merriweather';src:url('fonts/Merriweather-Regular.woff2') format('woff2');font-weight:400;font-display:swap}
</code_context>
<issue_to_address>
**issue (broader_impact):** The page references `fonts/*.woff2`, `assets/mume_logo.jpg`, `assets/map.png`, and `assets/desc.png`, but none of those files exist in the repository. The cinematic intro therefore shows a broken or empty logo, the map and description panels show broken images, and the custom fonts never load.

**Suggested fix:** Add the referenced font and image files under `docs/public/tutorial/`, or change the references to assets that are actually deployed.
</issue_to_address>

### Comment 2
<location path="docs/public/tutorial/index.html" line_range="199" />
<code_context>
+
+<div id="title" aria-hidden="true">
+  <div class="logowrap">
+    <img class="logo" src="assets/mume_logo.jpg" alt="MUME — Multi-Users in Middle-earth">
+    <div class="stripe"></div>
+    <div class="sheen"></div>
</code_context>
<issue_to_address>
**issue (bug_risk):** When the page is opened at the promised `/tutorial` URL without a trailing slash, relative references such as `assets/mume_logo.jpg` and `api/content` resolve from the site root rather than `/tutorial/`. The tutorial then loses its assets and requests the wrong API paths.

**Triggers:** When the web server serves `/tutorial` directly without first redirecting it to `/tutorial/`.

**Suggested fix:** Use `/tutorial/assets/...` and `/tutorial/api/...` paths, or add and verify a redirect from `/tutorial` to `/tutorial/.`
</issue_to_address>

### Comment 3
<location path="docs/public/tutorial/index.html" line_range="270" />
<code_context>
+        "MUME is a MUD: a Multi-User Dungeon. It is a game world made of text, played by hundreds of people at the same time.",
+        "There are no graphics. The game describes a room, and you type what you want to do. That is the whole loop.",
+        "Nothing is on a timer while you read. Take as long as you like."
+      ],
+      "teach": [],
+      "practice": null
</code_context>
<issue_to_address>
**nitpick:** The second lesson renders the sentence “You will being your journey”, which is grammatically incorrect and presents unfinished tutorial copy to new players.

**Suggested fix:** Change “You will being your journey” to “You will begin your journey”.

```suggestion
        "As a new player, you'll start on the side of men, hobbits, dwarves and elves. You will begin your journey near the Tower Hills as a new character with only the most basic of equipment. That is normal. Everyone starts there."
```
</issue_to_address>

### Comment 4
<location path="docs/public/tutorial/index.html" line_range="598" />
<code_context>
+      "title": "Dying is not the end",
+      "body": [
+        "You will die. Everybody dies, often, and it is a normal part of the game rather than a failure.",
+        "When you die you wake up in the Halls of Mandos. From here you 'pray <city>\" (ie, \"pray Bree\") to return to one of the towns around Middle-Earth. Your equipment stays behind on your corpse and you can go back for it, or ask someone to help you recover it.",
+        "You do not lose your character and you do not start again."
+      ],
</code_context>
<issue_to_address>
**nitpick:** The death lesson renders an unmatched quote in `pray <city>

**Triggers:** When the player reaches the death lesson.

**Suggested fix:** Fix the content string so the command example has balanced quotation marks, for example `pray <city>` or `"pray <city>"`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and this adds a large interactive page with an editor that stores drafts locally and can publish or create shareable tutorial content through API calls. A faulty version or publication can outlive a revert, but the affected content is bounded and can be restored or republished rather than causing irreversible data loss or access changes.

Blocking findings: docs/public/tutorial/index.html:154, docs/public/tutorial/index.html:199


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

}

/* ===================== cinematic layer (preview only) ===================== */
@font-face{font-family:'Kelt';src:url('fonts/kelt.woff2') format('woff2');font-weight:400;font-display:swap}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): The page references fonts/*.woff2, assets/mume_logo.jpg, assets/map.png, and assets/desc.png, but none of those files exist in the repository. The cinematic intro therefore shows a broken or empty logo, the map and description panels show broken images, and the custom fonts never load.

Suggested fix: Add the referenced font and image files under docs/public/tutorial/, or change the references to assets that are actually deployed.


<div id="title" aria-hidden="true">
<div class="logowrap">
<img class="logo" src="assets/mume_logo.jpg" alt="MUME — Multi-Users in Middle-earth">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): When the page is opened at the promised /tutorial URL without a trailing slash, relative references such as assets/mume_logo.jpg and api/content resolve from the site root rather than /tutorial/. The tutorial then loses its assets and requests the wrong API paths.

Triggers: When the web server serves /tutorial directly without first redirecting it to /tutorial/.

Suggested fix: Use /tutorial/assets/... and /tutorial/api/... paths, or add and verify a redirect from /tutorial to /tutorial/.

Comment thread docs/public/tutorial/index.html Outdated
Comment thread docs/public/tutorial/index.html Outdated
- Fix 'You will being your journey' -> 'begin your journey'
- Balance the quotes in the death lesson's "pray <city>" example
- boot() no longer fetches api/content (no backend on the static site);
  it renders the built-in tutorial directly, so no 404 on load
- Remove unused assets/content.json (stale duplicate of the inline copy;
  not referenced by the page)
@whitecouncil-alt

Copy link
Copy Markdown
Author

Thanks for the review — all addressed in the latest push:

  • "You will being your journey" → fixed to "begin your journey".
  • Unmatched quote in the death lesson → now balanced: "pray <city>" (e.g. "pray Bree").
  • Wrong API paths / backend calls → this is a static page with no backend, so boot() no longer fetches api/content (that request was 404ing and only working via a silent fallback). It now renders the built-in tutorial directly, with no network requests on load. The remaining api/* calls live inside the editor functions, which are hidden/unreachable in this build.
  • Missing font/image files → these actually are committed on the branch (assets/mume_logo.jpg, map.png, desc.png, and the five fonts/*.woff2) — I think the binaries just didn't show in the diff. The paths are intentionally relative so they resolve under the PR-preview base path (/pr-N/tutorial/); absolute /tutorial/... paths would break the previews. Linked as /tutorial/ (with trailing slash), Pages serves the directory index and the relative assets resolve.

Also removed an unused assets/content.json that was a stale duplicate of the inline copy.

Per Nils: in MUME 'fill' fills a lantern with oil; a water skin is
refilled with 'pour'. Command reference now reads 'pour fountain skin'
(syntax: pour source destination), matching the Pour helpfile.
whitecouncil-alt added a commit to whitecouncil-alt/mume.github.io that referenced this pull request Sep 9, 2026
./tutorial/ only exists once the static-tutorial PR (MUME#54) lands, so it 404s
until then. Link to the working tutorial app in the meantime (same target
the Play chooser uses). Flip both to on-site /tutorial/ once MUME#54 merges.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be redone to be a Vue component to better fit into the Vitepress site? Also many of these assets already exist and should be re-used rather than duplicated.

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.

2 participants