AlterU AlterU Part 3 · 数据原语 Part 3 · Data Primitives
大纲Outline
能力 · 数据原语 4 件套

让游戏记住玩家、
让玩家互相看见

🏆

排行榜

一行代码接(useGameScore)· 每游戏独立榜 · 点行跳作者 profile

Pattern:在游戏首屏角落放一个 冠军 pill(22px 头像 + 金王冠)——划到这屏就能看到 #1 是谁,瞬间感受到"有人在玩"。

💾

云存档

session_id 锚定 · 返回最近 6 用户的存档(不是你一人的)

意外发现:这个 API 同时就是"作品 wall / 跨用户 feed"的天然数据源——一个 hook 两件事,所有 cross-user wall 都走它。

📊

事件 + 统计

触发事件 · 拉聚合统计(day_click_count / day_user_count / continuous_days)

:每日机制不能 lastTapDay===today || stats.*——平台 stats 跨 UTC midnight 不重置 → OR 永真 → 玩家被永久锁。已踩 2 次。

🔔

跨用户 notify(重点)

动别人内容 → 推作者一条通知(外显 = 平台头像 + 文本 + 图)

3 铁律
✓ self-guard(不给自己发)
✓ 24h dedupe(同动作同对方 24h 1 次)
✓ 作者上限(单日 ≤ 5)

Capability · 4 data primitives

Make the game remember
and players see each other.

🏆

Leaderboard

One hook to wire up (useGameScore). One board per game. Tap a row → that user's profile.

Pattern: put a champion pill (22px avatar + gold crown) on the home screen. Swiping into the game instantly reveals "#1 is @xxx" — proof someone is here.

💾

Cloud save

session_id-keyed. Returns the last 6 users' saves, not just yours.

Quiet superpower: this single API is the native data source for any cross-user wall. One hook, two jobs — every Wall in AlterU runs on it.

📊

Events + stats

Trigger events, fetch aggregates (day_click_count / day_user_count / continuous_days).

Trap: daily-once rules cannot be lastTapDay===today || stats.* — platform stats don't reset at UTC midnight, the OR is always true, players get permanently locked out. Already shipped twice.

🔔

Cross-user notify (key)

Touched someone's content → push them a note (platform avatar + text + image).

3 hard rules:
✓ self-guard (no notify to yourself)
✓ 24h dedupe (same action + same target → once)
✓ author cap (≤ 5 per day per recipient)

备忘 · 按 S 关闭Notes · S to close

关键深度点:云存档 API 一物两用——它既是"我的存档"也是"看别人最近做了什么",这是 AlterU 所有 cross-user wall(Daily Arcana / Pulp Hour / Hour Capsule)的基础设施。

Notify 是把单机变社交的最小可行机制——不是聊天、不是评论、不是好友——就是一条"有人动了你的东西"。它是 feed 时代的多巴胺触发器。

设计任何新游戏,day-one 就问:这游戏的 notify 是什么

Deep point: the cloud save API is dual-purpose — it's both "my save" and "what other people just shipped." That's the substrate under every cross-user Wall (Daily Arcana / Pulp Hour / Hour Capsule).

Notify is the smallest viable mechanic for turning a single-player game into a social one. Not chat, not comments, not friends — just "someone touched your thing." Day-one rule: every new game has to answer "what's the notify?"

17 / 41