Skip to content

Commit 0ac7428

Browse files
committed
design changes
1 parent 67aeae3 commit 0ac7428

12 files changed

Lines changed: 1363 additions & 255 deletions

File tree

‎.github/hooks/impeccable.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"hooks": {
4+
"postToolUse": [
5+
{
6+
"type": "command",
7+
"matcher": "edit|create|apply_patch",
8+
"bash": "[ ! -f \"$(git rev-parse --show-toplevel)/.github/skills/impeccable/scripts/impeccable\" ] || \"$(git rev-parse --show-toplevel)/.github/skills/impeccable/scripts/impeccable\" hook",
9+
"timeoutSec": 5
10+
}
11+
]
12+
}
13+
}

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ patched/C4Patcher.exe
1010

1111
.env
1212
.serena/
13+
.claude
14+
.github/agents
15+
.impeccable

‎DESIGN.md‎

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

‎PRODUCT.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Product
2+
3+
<!-- impeccable:product-schema 1 -->
4+
5+
## Platform
6+
7+
web
8+
9+
## Users
10+
11+
Returning Caesar IV players, mostly owners of the Steam release, who want the game's dead online mode back. On the website they register a governor, download and run C4Patcher.exe on the Windows machine with the game, then come back to check the Caesar's Challenge and Empire leaderboards, governor profiles, and their uploaded cities.
12+
13+
## Product Purpose
14+
15+
Caesar IV Online restores the game's original online mode by replacing the defunct official backend with a gateway that speaks the MySQL protocol the game's ODBC client expects. The website is where players sign up, get connected, and see results. Success means a player goes from owning the game to appearing on a leaderboard without manual file surgery, and keeps returning to compare their cities.
16+
17+
## Positioning
18+
19+
It brings back the game's own built-in online buttons, screens and scoring rather than adding a third-party layer: the game talks to this server as if it were the original, and the site is the destination the in-game Website, Create New and Lost Password buttons open.
20+
21+
## Operating Context
22+
23+
- One public instance is the canonical community server; self-hosting via Docker or the Go binary is supported but secondary.
24+
- Players move between the website and Caesar IV on Windows: register on the site, download the patcher or manual files, close the game, patch, launch, play online scenarios.
25+
- Caesar's Challenge rotates one season per calendar year (UTC), each with its own line-up drawn from scenarios with a reachable population goal.
26+
- Pages: home, /challenge, /empire, /governor, /city, /register, /signin, /account (setup and connection token).
27+
28+
## Capabilities and Constraints
29+
30+
- Static vanilla HTML/CSS/JS embedded in the Go binary (gateway/internal/web/static); no framework or build step today.
31+
- Accounts with registration (can be closed per server), sign-in, and per-account NewConstants.txt connection tokens; reissuing a token invalidates the old file.
32+
- No password reset exists.
33+
- Setup targets the 32-bit Windows game: C4Patcher.exe, or manual install of the MariaDB 32-bit ODBC 3.1.22 driver, registry aliases, and patched data files.
34+
- The game uploads a city's buildings but not its roads; city maps and counts omit roads.
35+
- Alt+Tab during a Caesar's Challenge scenario ends the online session unless the patcher's fix is applied.
36+
37+
## Brand Commitments
38+
39+
- Name: Caesar IV Online.
40+
- Binding: the UI uses Caesar IV's own art (dialog, panel, marble, laurel, scroll, frame, ornament sprites, logo, scenario and map images, building help icons, button sounds) and keeps that in-game look.
41+
- Observed but not confirmed as binding: the Roman-administration voice in copy ("governor", "rolls of Rome", "province").
42+
43+
## Evidence on Hand
44+
45+
- Scenario overviews, goals, preview and map images: gateway/internal/web/static/scenarios.json, static/img/scenarios, static/img/maps.
46+
- Building icons: static/img/buildings.
47+
- Background write-up: https://xetera.dev/article/bringing-back-caesar-iv-online
48+
- Patcher releases with build attestations on the GitHub releases page.
49+
- Live leaderboard, governor and city data from the server's API.
50+
- No testimonials, player counts, or press exist; do not invent them.
51+
52+
## Product Principles
53+
54+
- The game is the product; the site serves getting into it and seeing what happened in it.
55+
- Setup must be followable by a non-technical player, with a manual path for when the patcher can't be used.
56+
- Show real recorded results only, and state plainly when data is missing or not sent by the game.
57+
- Stay faithful to Caesar IV's own look and mechanics rather than reinterpreting them.

‎gateway/cmd/c4gateway/main.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ func serve(args []string) error {
107107
fs.StringVar(&site.PublicURL, "public-url", envOr("C4GW_PUBLIC_URL", "http://127.0.0.1:8080"), "the website's address as players see it (governor links in NewConstants.txt)")
108108
fs.StringVar(&site.UmamiScript, "umami-script", envOr("C4GW_UMAMI_SCRIPT", ""), "URL of an Umami tracker script to load on the website, empty to disable")
109109
fs.StringVar(&site.UmamiWebsiteID, "umami-website-id", envOr("C4GW_UMAMI_WEBSITE_ID", ""), "Umami website ID for -umami-script")
110+
fs.StringVar(&site.StaticDir, "static-dir", envOr("C4GW_STATIC_DIR", ""), "serve the website from this directory (internal/web/static) instead of the built-in copy, re-read on every request")
110111
fs.BoolVar(&site.Registration, "registration", envOr("C4GW_REGISTRATION", "1") != "0", "let anyone create an account on the website")
111112
secret := envOr("C4GW_WEB_SECRET", "")
112113
site.Secret = []byte(secret)

0 commit comments

Comments
 (0)