Compare commits

...

6 commits

Author SHA1 Message Date
db81a509cf aaa 2026-06-23 11:48:11 +09:00
2e90add2e1 fulfillment 2026-06-23 11:27:55 +09:00
e8f1d1db1e refactor 2026-06-22 02:03:19 +09:00
0a6148c73f many 2026-06-21 22:29:00 +09:00
0b9ff1363b more 2026-06-21 16:26:12 +09:00
37087d08a7 sounds 2026-06-21 14:09:35 +09:00
230 changed files with 21711 additions and 10935 deletions

View file

@ -15,8 +15,13 @@
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
<FilesMatch "service-worker\.js$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
<FilesMatch "\.(css|js|json|png|webp|mp3|wav)$">
Header set Cache-Control "public, max-age=2592000"
Header set Cache-Control "public, max-age=2592000, immutable"
</FilesMatch>
</IfModule>
<IfModule mod_deflate.c>

View file

@ -1,69 +1,248 @@
## 15.9.2 修正
- 巣箱アイコンとゲーム内描画から、枠内の明色・透過っぽく見える装飾を除去。
- アリのHPバーを、たりないと同様にダメージ直後だけ表示する方式へ変更。
- 道具UIに「げんこつ」を追加。添付画像から正義げんこつ部分を切り抜き、上から落下してたりない・アリにダメージと吹っ飛びを与える効果を追加。
- 初期ロード画面と読み込み進捗バーを追加。JS/CSSをdefer化し、CSS/JSのサーバーキャッシュを有効化して再訪問時の通信量を削減。
# Patch notes
## 15.20.16
- Added canonical item visual, food, and disease registries; wired food decay/visual helpers and mystery-drug disease sampling to registry data.
- Generated the tool palette from `TOOL_CATEGORIES` at runtime and removed duplicated category markup from `index.html`.
- Added compact family-tree personality tags, daily personality-change details, and selected-Tarinai rolling recent-change causes for personality, damage, item-effect, disease, and ant-carry changes.
- Added `InputModeManager` for touch-first mobile classification and `WeatherSystem` for weather transitions/rain-water spawning.
- Added central domain events for placement, eating, decay, effects, diseases, damage, death, birth, fights, ants, weather, and rain item drops.
- Moved item-effect modifiers, active summaries, apply/tick behavior callbacks, and food interest class queries into registries.
- Moved explosion-disease base infection chance reads into `DiseaseRegistry` while preserving protein/niterop disease multipliers.
- Moved serving-food nutrition and hunger-relief reads into `FoodRegistry`, including laxative's zero hunger relief.
- Routed direct love/fight/sleep item eating through `EffectRegistry` while preserving the previous bite-specific stress, fear, and sleep-disease chance behavior.
- Routed sleep drug, rain-water item, and water-bowl field visuals through `item_visual_registry.js`; added water-bowl icon-generation support.
- Moved canonical sound gains, sample paths, categories, cooldowns, and ID category mapping out of `audio.js` into `sound_pack.js`.
- Added named ant ecology extension hooks/comments without changing ant balance.
- Bumped cache/version references to `15.20.16`; documented the new source-of-truth rules.
## 15.20.12
- Updated documentation after inspecting the current game surface: field choices, startup flow, tool groups, chart/family/debug surfaces, localStorage settings, and validation fallback when Node is unavailable.
- Removed unused `css/styles.css` shim and no-op `js/ui_family.js` loader entry; refactored duplicate world initialization and allocation-heavy live-count paths.
- Removed the unwanted item-effect speech bubbles listed in `docs/prompt.txt`.
- Reorganized the tool palette into color-coded collapsible groups: operation, food/water/grass, medicine/effects, habitat/living things, hazards/obstacles.
- Changed the tool UI ball icon to a soccer-ball emoji preview.
- Changed time phases: morning 05:00, day 10:00, evening 17:00, night 20:00.
- Increased genkotsu knockback for Tarinai and ants; genkotsu now also blasts zunchi away.
- Genkotsu damage now adds fear/stress and decreases Tarinai openness.
- Rain weather overlay is now diagonal streaks. Fallen rain-water items, zunda juice, and mercury remain horizontal oval item sprites.
- Tightened mobile operation UI visibility to smartphone-class compact touch devices.
- Sleep-disease Tarinai can be moved by ant hauling without snapping back to their sleep anchor.
## 15.20.12 and earlier summary
- Consolidated documentation into dense English files; left `docs/prompt.txt` untouched.
- Restored rain, revised water/zunda/mercury item sprites, added zunchi-slave head zunchi, fight win rate, fight defeat chance, and post-wake lock.
- Earlier patches added parameter items, persistent item effects, WebP assets, sound categories, push notifications, ant systems, family tree UI, performance manager, event bus, manifest generation, CSS split, and large-file JS split.
## Debug patch: panic chain and action reasons
- Removed the friend-only panic chain that made only a best friend follow a panic target.
- Added general nearby panic contagion: any nearby live tarinai in panic can cause another tarinai to panic. Neuroticism, distance, and current stress affect the probability.
- Added / completed visible action reasons for:
- eating all food and effect items
- eating grass, ant corpses, and zunchi
- drinking / touching water
- resting near stone, bed, and nest box
- sunbathing
- zunchi-slave avoidance
- being pinched / dragged
- firecracker blast panic
- explosion-disease blast panic
- falling object / stone / genkotsu impact
- high-speed ball collision
- high-speed tarinai collision
- intimidation, intimidation escape, fights, birth ritual, and thaw surprise
- fence-blocked path give-up
- Added state labels for `sunbath`, `ant_attack`, `ant_intimidate`, and `frozen`.
- Expanded target labels for all current tool/item target types, including medicine/effect items, ant corpses, ant nests, firecrackers, pushpins, signboards, and fences.
- Verification performed:
- `node --check` over every `js/*.js`
- state-label coverage scan: no uncovered tarinai states
- old friend-panic chain scan: zero matches
## 15.9.1 修正
- 草を地面レイヤーとして扱い、既存の草の上にもオブジェクトを配置できるようにしました。草同士・草と障害物の植え付け制限は維持しています。
- けんか餅のゲーム内描画から星印を削除し、×印のみ表示するようにしました。
- ダメージ後に出る「こわい…」吹き出しを削除しました。
- 家系図に「更新」トグルを追加しました。デフォルトはOFFで、ONの間だけ家系図を描画・更新します。
- 死亡した個体のライブIDを再利用しないようにし、友達・敵対関係が別個体へ引き継がれて見える問題を防止しました。死亡時の一時ターゲット参照も掃除します。
- たりないデータUIをカテゴリ別の折り畳み表示に変更しました。
## おしり鋲・冷凍操作変更パッチ
- ずんちどれい化条件の喧嘩勝率を30%以下に変更。
- 衰弱死因判定を厳格化。
- 冷凍手段をクリック式から「つまむで冷凍UIへ運ぶ」方式へ変更。
- 新アイテム「おしり鋲」を追加。刺さるとずんちを溜め、日光浴不可。抜くと溜まったずんちが高速で飛散。
- 高速ずんち衝突時の吹き飛び・パニック理由文を追加。
# Patch Notes
## 15.22.0 統合リファクタ
## Encoding cleanup
- Normalized `index.html` back to UTF-8.
- Replaced mojibake strings with the intended labels.
- Escaped Japanese text in source files to avoid encoding-dependent corruption.
- `snapshot_system.js` を追加し、セーブ/ロードと冷凍で重複していた `clonePlain` / `copyOwnData` / `applyOwnData` / 参照復元 / スナップショット作成・復元を共通化。
- `tarinai_action_state.js` を追加し、`setActionState()` / `enterPanic()` / `beginEating()` により、状態変更・パニック化・食事開始の理由文設定を統合。
- 直接 `state = "panic"` していた処理を `enterPanic()` 経由へ変更。爆竹、爆発病、高速ボール、高速衝突、アリ、画鋲、近傍パニック連鎖、関係者死亡、解凍時の訃報などが対象。
- 直接 `state = "eat"` していた食事処理を `beginEating()` 経由へ変更。
- `physics_helpers.js` を追加し、壁反射・摩擦・回転を `TarinaiPhysics.applyKinematicItemMotion()` に共通化。おしり鋲/画鋲/高速ずんちの移動処理に適用。
- `ITEM_TRAITS``PIN_BEHAVIORS` を追加し、アイテム分類と画鋲/おしり鋲の差分挙動をテーブル化。
- `text_catalog.js` に状態ラベル、対象ラベル、理由文補完を集約。`ui_selected.js` はカタログ参照へ変更。
- `family_graph.js` を追加し、家系グラフの連結成分探索を共通化。同期家系データと描画側に適用。
- `relation_event_system.js` を追加し、関係者死亡の即時反応と冷凍個体への遅延通知を共通化。
- `ui_helpers.js` を追加し、HTMLエスケープ等のUI共通処理を切り出し。
- 構文チェック: 全 `js/*.js` OK。
- 重複確認: `clonePlain` / `copyOwnData` / `applyOwnData``snapshot_system.js` に集約、直接 `state = "panic"` と直接 `state = "eat"` は除去済み。
## Personality specification fixes
- Personality tags and data UI now use Japanese labels from the four-axis personality model.
- Threshold-crossing personality logs are now generated in Japanese and only when visible trait bands change.
- Daily personality caps now track increase and decrease separately per parameter.
- Current personality effects are neutral inside the -0.5 to +0.5 band.
- Direct conversion to the legacy timid personality after damage was removed; cowardly behavior is derived from high neuroticism plus low aggression.
- Corpse/splat contact now increases stress and slowly reduces neuroticism through habituation.
## 15.23.0 safe duplicate integration pass
## Follow-up fixes
- Fixed CSS emoji escapes for tool UI icons. CSS now uses code-point escapes such as `\\1F448` instead of invalid surrogate escapes.
- Hid the detailed four-axis personality rows from the compact tarinai data UI.
- Restored `bestBedFor()` fallback so tarinai can choose hay beds when no usable nest box is available.
- Damage now wakes sleeping tarinai and forces tarinai hidden inside a nest box to leave the box.
- Added a short minimum stay window after entering a nest box to avoid immediate exit loops.
- Renamed the friend relation label from `\\u4ef2\\u826f\\u3057` to `\\u53cb\\u9054` in UI text and related logs.
- `registry_base.js` を追加し、`food_registry.js` / `effect_registry.js` / `disease_registry.js``get` / `has` / `label` / `color` / `debugSnapshot` 系の共通基盤を統合。
- `patch_helpers.js` を追加し、後付けの `World.prototype` パッチを `TarinaiPatcher.patchWorld()` 経由に統合。冷凍・関係者死亡通知で利用。
- `data.js``sleepFurniture` / `draggable` trait と、`isPinType()` / `isSleepFurnitureType()` / `lodgedPinFor()` / `hasLodgedPinEffect()` / `normalizedToolSizeFor()` / `toolSizeScaleFor()` を追加。
- `ui_tools.js``world_view.js` のツールサイズ算出を `normalizedToolSizeFor()` / `toolSizeScaleFor()` に統合。
- `tarinai_action_state.js``currentLodgedPin()` / `currentLodgedPinBehavior()` / `hasLodgedPinEffect()` / `goIdle()` / `startSleeping()` / `seekTarget()` を追加。
- `blockedByOshibyo` 系の重複判定を `hasLodgedPinEffect("blocksZunchi")` に統合。
- 画鋲/おしり鋲の型判定を `isPinType()` に寄せ、描画・配置・つまみ・削除判定の分岐を整理。
- 睡眠家具判定を `isSleepFurnitureType()` に寄せ、ベッド/巣箱の直書き判定を削減。
- 手動アリ近傍探索の一部を `world.nearbyAnts()` に寄せた。
- `pruneExtinctFamilies()``TarinaiFamilyGraph.connectedComponents()` に寄せた。`family_graph.js` 側のデフォルト edge も親子参照を使うようにした。
- `save_system.js` / `freeze_system.js` / `ui_selected.js` のHTMLエスケープを `TarinaiUIHelpers.htmlEscape()` に統合。
- `assets.js` のスプライト/汚れオーバーレイ用キャンバス生成を `TarinaiPhysics.createCachedCanvas()` に寄せた。
- 危険度の高い `render.js` 全体再設計、`Tarinai.update()` の状態機械化、`ants.js` の状態機械化、`items.js` 描画全体のレジストリ化は未実施。
- 確認: 全 `js/*.js``node --check` 通過。
### 15.23.0 追確認
- `service-worker.js` / `app_manifest.json` のスクリプト一覧を `index.html` の実ロード順に同期。新規共通化ファイルもキャッシュ対象に追加。
- アリ運搬中に寝ているたりないの状態変更も `startSleeping()` 経由へ寄せた。
- 最終確認: 全 `js/*.js``service-worker.js``node --check` 通過。
- 最終確認: `blockedByOshibyo``type === "oshibyo"``type === "pushpin"` の直接判定は 0件。`clonePlain` / `copyOwnData` / `applyOwnData` / `isPlainObject``snapshot_system.js` のみ。
## 15.24.0 safe integration / UI escape recursion fix
- Fixed `Maximum call stack size exceeded` caused by `ui_helpers.htmlEscape()` calling the global `escapeHtml()` while `ui_selected.escapeHtml()` called back into `TarinaiUIHelpers.htmlEscape()`.
- Made `TarinaiUIHelpers.htmlEscape()` a pure escaping function and loaded `ui_helpers.js` before `ui_selected.js`.
- Added a guard in `ui_selected.escapeHtml()` so it never delegates to itself.
- Added a data URL favicon link to stop the browser's default `/favicon.ico` 404 request.
- Bumped static asset version to `15.24.0` in `app_manifest.json`, `index.html`, `service-worker.js`, and `js/version.js` to avoid stale cached scripts.
- Reduced target-label duplication: item labels now come from `TOOL_DEFINITIONS` / `toolLabel()`, with `text_catalog.js` holding only non-tool overrides.
- Removed the remaining synchronous family-tree DFS fallback blocks in `ui_family_data.js` and `ui_family_render.js`; both now use `TarinaiFamilyGraph.connectedComponents()`.
- Simplified the remaining manual ant proximity fallback in `tarinai_needs_items.js` to `world.nearbyAnts()`.
- Verification: all `js/*.js` and `service-worker.js` pass `node --check`.
## 15.25.0 save/load UI and pin UI fix
- Fixed `Item.draw()` crash caused by an undefined `isOshibyo` local in the pin drawing branch.
- Reworked the save dialog into a 3x3 slot grid and added per-slot canvas thumbnails.
- Added compressed `TARINAI_SAVE_V2:` hash export/import using browser gzip streams when available; legacy `TARINAI_SAVE_V1:` imports remain supported.
- Replaced browser confirm prompts in save/load/import/delete flows with in-game save dialog confirmation UI.
- Added missing tool UI icons for `pushpin` and `oshibyo` and updated their tooltips.
- Renamed tool categories: 操作, 飲食, 薬, 生活, 危険物. Moved freeze to 操作 and fences to 生活.
- Made the frozen individual panel initially collapsed.
- Made colony mood span the full colony UI width with a compact height.
- Moved push notification cards inside the top of the Event UI.
- Bumped static cache version to `15.25.0`.
## v15.26.0 save/sunbath/signboard/freeze UI patch
- ずんちどれいの食対象を、ずんだ餅・草・水系を除く食べ物全般へ拡張。
- 看板を大型化し、観察/看板ツールでクリック編集、配置直後編集に対応。
- 日光浴の開始処理が呼ばれていなかった問題を修正し、発生確率と継続時間を大幅に増加。
- フィールド内の非地形オブジェクト・たりない・アリをY座標で統合ソートし、下側が前に出る描画順へ調整。
- 冷凍ボタンを操作カテゴリから廃止し、冷凍個体一覧を操作カテゴリ内部へ移動。
- セーブスロットを小型化し、サムネイルをスロット全面背景として表示。
- ハッシュ書き出しをV3コンパクト形式へ変更。イベントログ、エフェクト、吹き出し等の非本体情報は保存対象外。
- α版のため、セーブ/ハッシュ互換性は当面保証しない旨をコードコメントに明記。
## v15.27.0 hash V4 / layer / warning patch
- ハッシュ書き出しを `TARINAI_SAVE_V4:` に更新。V3の密な配列形式から、短い疎配列形式へ変更。
- V4ではゲームプレイ本体に必要な world / tarinai / item / ant / frozen 状態のみを保存し、ログ、イベント表示、エフェクト、吹き出し、サムネイル等は保存対象外。
- アイテム種別・スプライト種別は固定辞書の数値コードで保存し、初期状態で全アイテムを1つずつ置いたケースでも短くなるようにした。
- アイテムは `type,x,y` をヘッダ化し、その他はデフォルト値から変化した値だけを保存する方式へ変更。
- 干草寝床の描画レイヤーを同じY座標の他オブジェクトより少し後ろへ調整。
- ロード/インポート/削除の上書き警告を中央の大きなゲーム内UIとして表示。
- キャッシュ対策としてバージョンを `15.27.0` へ更新。
## v15.28.0 machine / pin placement patch
- おしり鋲を約半分の表示サイズに縮小し、刺さり位置をたりないスプライト右側へ移動。
- 画鋲/おしり鋲の刺さり表示は、たりないのスプライト反転に合わせて左右反転するよう調整。
- 新アイテム「複製機」を追加。消費アイテムツールで複製機をクリックするとスロットにセットし、下側の皿へ無限補充する。
- 新アイテム「大砲」を追加。消費アイテムツールで大砲をクリックするとスロットにセットし、クリック位置で360度向きを変更し、セット品を撃ち出す。
- 大砲弾として飛んだ消費アイテムは、高速時にたりないへ当たるとボール同様に吹き飛ばす。
- 複製機/大砲の道具UIアイコンを追加。
- セーブV4のアイテム種別表・追加キーへ複製機/大砲および機械スロット情報を追加。
- キャッシュ対策としてバージョンを `15.28.0` へ更新。
## v15.29.0 asset / save compression patch
- 全たりないスプライトを 512x468 以下に収まるよう縮小し、WebP を再圧縮。
- `ALPHA_BOUNDS` を現行画像寸法と透過領域から再生成。
- 音声サンプルを軽量 MP3 に置き換え、WAV を配布対象から除外。
- セーブハッシュ内の座標系数値は小数点第一位までに丸めるよう変更。
- コメントは削除せず、JS minify は行っていない。
- キャッシュ対策としてバージョンを `15.29.0` へ更新。
## v15.30.0 save hash v5 compact patch
- ハッシュ書き出しを `TARINAI_SAVE_V5:` に更新。
- V5はトップレベルを短い配列形式にし、world / たりない / item / ant / 冷凍個体をゲームプレイに必要な値だけで再パック。
- たりないの性格・遺伝・関係性・効果タイマー・状態/欲求/アイテム種別を短い配列または数値コード化。
- 初期値・決定論的に再生成できる値・UI/演出専用値はハッシュ保存対象から除外。
- 座標は引き続き小数点第一位まで保存。
- V4/V3/V2/V1の読み込み互換は一応残すが、α版のため今後の互換性保証はしない。
- キャッシュ対策としてバージョンを `15.30.0` へ更新。
## 15.31.0 - Hash V6 compaction
- Added `TARINAI_SAVE_V6:` export format.
- Further shortened hash text while preserving gameplay state.
- Removed individual observation history/name fields from hash exports:
- names
- former names
- parent display names
- personality daily history
- mystery drug history
- recent change records
- per-individual observation records
- Replaced long family keys in hash payload with compact numeric family references.
- Encoded live IDs like `t12` as numeric IDs in hash payload and restored them on load.
- Packed tarinai core gameplay stats into fixed compact rows.
- Kept gameplay-critical data:
- needs/status
- position and movement-relevant values
- personality and genetics
- parent/child links
- relationships
- diseases
- zunchi slave state
- item effects
- oshibyo/zunchi stock
- sunbath/fear/fall gameplay timers
- items, machines, ants, frozen tarinai
- Flattened item base records remains active from V6 export.
- Hash remains ASCII base64url + gzip for copy/paste and editor durability.
## 15.32.0 - Hash V7 base91/name preservation
- Added `TARINAI_SAVE_V7:` hash export.
- V7 uses gzip plus a 91-character printable ASCII transport alphabet instead of base64url.
- V7 keeps individual names in compact hash exports.
- V7 excludes dead tarinai rows from compact hash exports so family graph history does not revive/save dead individuals.
- V7 filters parent/child and relationship links to living or frozen individuals; pending frozen death notices remain gameplay data.
- V7 stores selected numeric tarinai stats as relative deltas from common defaults while preserving the existing compact numeric precision.
- V1-V6 import support remains.
## 15.33.0 - Hash V8 current-only compact save
- Hash exports now use `TARINAI_SAVE_V8:` only. Old hash import compatibility was intentionally removed for the alpha save format.
- Added an untouched-initial-colony sentinel. Initial colonies now export as a compact reset marker plus names instead of full entity/item rows, targeting roughly 100 characters for the initial state depending on generated names.
- Frozen individual save data no longer preserves pending death notices or relationship/memory records.
- Dead family nodes remain omitted from compact hash saves.
- Individual names are preserved in V8 compact saves.
- V8 keeps printable ASCII transport using the 91-character alphabet, with an explicit compressed/uncompressed mode marker.
## Personality cleanup v3
- Current live friend count now changes sociability drift. Family/friend proximity raises sociability more when the tarinai has more current friends, while a lonely tarinai with no current friends can slowly lose sociability.
- Removed the legacy named personality route from constructor, serialization, child inheritance, selected data UI, selected-card overlay, and family-tree titles. The game now uses only birthPersonality/currentPersonality four-axis data.
- Kept empty legacy stubs only for old-save compatibility so older saves cannot revive the pre-four-axis personality model.
## 15.34.0 - Hash V9 binary compact format
## Follow-up fixes v4
- Restored compact personality information in the tarinai data panel: visible tags, birth personality, and current personality.
- Moved the focused-tarinai highlight outside the sprite rotation transform so the ring and label stay upright.
- Shortened ecology cards and added the HP/stress meter placement note: upper meter is HP, lower meter is stress.
- Raised the friendship threshold to 16 affinity and reused the same threshold for friend count, friend behavior, friend UI, and observe highlights.
- Observe mode now highlights friends of the selected tarinai as well as parents, children, and enemies.
- Removed the V8 initial-state-only save sentinel. All states now use the same compact format.
- Export hash format is now `TARINAI_SAVE_V9:` and legacy hash imports are rejected during alpha.
- Replaced JSON-based compact hashes with a dedicated binary packet plus printable ASCII Base94 transport.
- Stopped saving elapsed day count in compact hash; loaded compact hashes restore day as 1.
- Kept custom individual names, while default four-character names made only from `は / う / ぅ / っ` are packed as 2-bit character codes.
- Replaced saved tarinai/item IDs and family keys with array-index references; IDs are regenerated on load.
- Uses default-relative numeric deltas, optional timer tags, boolean bit fields, and 0.1-unit integer coordinates.
- Keeps gameplay-critical tarinai needs, personality, genetics, family links, relationships, item states, machines, ants, and frozen individuals; frozen pending-loss memory remains omitted.
## Ant nest update
- Added a new placeable `ant_nest` object and tool button.
- Added ant sprites cropped from the provided source image: queen, worker variants, and upside-down worker corpse.
- Each ant nest starts with 6 workers, caps at 10 workers, and sends at most 3 workers outside at once.
- Worker ants spawn above their home nest, random-walk, search for tarinai, and drag found tarinai back to the nest. Multiple workers dragging the same tarinai increase carrying speed.
- Dragged tarinai struggle automatically and can kill workers. Dead workers become edible `ant_corpse` items and slightly reduce hygiene.
- If a nest below capacity brings back a tarinai, its worker count increases by 1.
- If a full nest brings back another tarinai, a queen ant appears and creates a new ant nest in an open spot.
- Ant health does not recover.
- Added the requested Irasutoya credit entry.
## Ant nest follow-up v5
- Increased ant movement and hauling constants by 1.5x from the previous slow tuning.
- Kept queen spawning to at most one queen per nest per in-game day, while making spawned queens keep retrying until a new ant nest is built somewhere.
- Reduced the ant nest object radius from 34 to 17.
- Removed the separate ant corpse sprite asset. Ant corpses now render by flipping the worker ant sprite vertically and remain stationary while decaying.
- Added shared ant damage handling for firecracker explosions and dropped-object impacts.
- Kept ant worker HP in the nest worker pool so damaged workers remain damaged after returning to and leaving the nest.
## 15.35.0 - Hash V10 compact packet
- Changed exported hash prefix to `TARINAI-SAVE-V10:` so the full hash text no longer uses `_` in its version marker.
- Excluded `\\`, `*`, `'`, and `_` from the printable ASCII transport alphabet.
- Replaced the V9 generic array/value packet with a V10 field-specific binary packet for common gameplay data.
- Kept gameplay-critical state while reducing overhead for names, world data, tarinai core rows, item rows, ants, and frozen individuals.
- Kept elapsed day count out of the hash; loads restore to day 1.

104
README.md
View file

@ -1,79 +1,51 @@
# Tarinai Colony Observation Game
Single-page, dependency-free browser simulation. Open `index.html`; no build step, package manager, server API, transpiler, or module loader is required. Runtime is plain HTML/CSS/JS loaded by ordered `<script>` tags.
Buildless single-page browser simulation. Open `index.html`; no package manager, transpiler, server API, or module loader is required. Runtime order is explicit `<script defer>` order generated from `app_manifest.json`. Current inspected version: `15.20.16`.
## Codex operating model
## Edit contract
Read only these first: `README.md`, `docs/AI_CONTEXT.md`, `docs/code_map.md`. Then open the smallest implementation file named by the map. Avoid broad grep unless a symbol is not mapped. Keep Japanese UI strings escaped in source (`\uXXXX` in JS, entities in HTML/Markdown/CSS where applicable). After edits run `node --check js/*.js` and verify `index.html` script order.
- Preserve Japanese in-game UI tone and strings.
- Do not edit `docs/prompt.txt`; it is external user material.
- Use `app_manifest.json` as the source of truth for CSS/JS load order and service-worker cache entries.
- Run `python3 scripts/generate_app_files.py` after version or asset-list changes.
- Run `node --check js/*.js service-worker.js` before zipping.
- Verify ZIP integrity with `zip -T`.
## Core simulation
## Documentation map
- Entities: `Tarinai` agents with hunger, sleep/energy, loneliness, stress, health, age, personality, family links, relationships, diseases, favorite flag, target/need AI, transient animation timers.
- World: bounded field with weather, time, lighting, temperature, spatial-grid queries, items, effects, logs, archive/family data, placement and collision rules.
- Observation loop: agents autonomously seek food/water/sleep/social targets, react to zunchi, tools, rain, cold, crowding, relationships, disease, damage, conflict, reproduction, and player input.
- Records: observation log and family tree store births, deaths, parentage, cause-of-death labels, favorite state, and key state changes.
- `docs/ARCHITECTURE.md`: runtime architecture, file ownership, system boundaries.
- `docs/CONTENT_GUIDE.md`: item visuals, UI/field visual parity, audio, bubble text inventory.
- `docs/MAINTENANCE.md`: release process, validation, debugging, cache/version rules.
- `docs/prompt.txt`: untouched user prompt/context archive.
## Important mechanics
## Player-facing surface
- Personality uses four axes: aggression, openness, sociability, and neuroticism. Children inherit from the parents' current four-axis personality average with variation.
- Relationships track affinity/fear/fight outcomes and influence approach, avoidance, intimidation, conflict, co-parent behavior, and UI summaries.
- Death causes are normalized by `js/health.js`: fight, hunger, disease, stress overload, over-poking, firecracker, accident, lifespan. Major damage within 10 seconds can become `<cause> de suyaku` in UI text (`...\u3067\u8870\u5f31`).
- Water-curable diseases force high-priority water seeking. Zunda-curable diseases force high-priority zunda seeking.
- Favorite agents show a star above the sprite and can be toggled from the observation panel.
- Startup uses a loading overlay that eagerly preloads a small sprite set, initializes UI/world state, then defers remaining image work.
- Field choices are cage, garden, and park. `FIELD_TYPES` controls world scale, starting population, initial grass count, and responsive field height.
- The default field is garden. Reset opens the field dialog; cancel keeps the current field.
- Tools are grouped in collapsible categories: operation/observation, food/water/grass, medicine/effects, habitat/living things, hazards/obstacles.
- The top bar owns pause, speed, ecology, sound, credits, and reset controls. Event push toasts live inside the Event card, while sound category toggles live only in the sound menu.
- The colony panel charts population, mental state, environment, and object counts. The family tree is a separate main section with manual/auto refresh and reset controls.
- Mobile operation modes are available only on compact touch-first phone viewports: auto, camera, tool, family.
## Diseases
## Core systems
- Zunchi disease: zunchi-derived contamination; slows movement, increases stress, emits miasma effect, cured by water.
- Sleep disease: caused by sleep drug; stops all behavior and sleeps indefinitely; cured by damage.
- Explosion disease: low-probability result of explosion knockback; explodes after half a day; cured by water or zunda mochi.
- Fight-wound disease: low-probability result after bleeding for five in-game hours; spins and wanders aimlessly; cured by zunda mochi.
- `World`: `js/world.js` plus `js/world_*.js`; time, weather, placement, effects, family records, spatial queries, ants, combat, logging.
- `Tarinai`: `js/tarinai.js` plus `js/tarinai_*.js`; identity, personality, needs, items, disease, movement, social behavior, rendering.
- `Item`: `js/items.js`; lifecycle, scaling, field rendering. Field rendering is the visual source of truth for tool icons.
- `ItemVisualRegistry`: `js/item_visual_registry.js`; canonical item visuals used by field sprites and generated icon previews.
- `EffectRegistry`: `js/effect_registry.js`; item-effect names, modifiers, exclusivity, display metadata, random-effect candidates.
- `DiseaseRegistry`: `js/disease_registry.js`; disease flags, labels, display metadata, cure-rule notes, mystery-drug eligibility.
- `FoodRegistry`: `js/food_registry.js`; serving classes, labels, decay, hygiene penalty, special effect IDs.
- `InputModeManager`: `js/input_mode_manager.js`; mobile/touch classification, gesture capability policy, mode persistence.
- `WeatherSystem`: `js/weather_system.js`; weather state transitions and rain-spawned water items.
- `Audio`: `js/sound_pack.js` owns sound metadata; `js/audio.js` loads samples, applies settings, enforces cooldowns, and runs synthetic fallbacks.
- `Performance`: `js/performance_manager.js`; FPS quality level, ant stride, effect budget, terrain redraw cadence.
## Tools and items
## Current high-risk areas
- Direct tools: observe, delete, poke, pinch, spawn.
- Food/medicine: zunchi, zunda mochi, heko mochi, kenka mochi, water, water bowl, sleep drug, grass.
- Environment/objects: stone, hay bed, nest box, cleaning tool, ball, firecracker, vertical fence, horizontal fence.
- Cleaning removes zunchi/blood/traces while pushing agents and applying water effects. Water bowl is persistent water. Nest box lowers stress nearby and improves sleep quality. Rain increases falling water items.
- Item effects touch `effect_registry`, `tarinai_item_effects`, `tarinai_needs_items`, `items`, and selected-info UI.
- Mobile input must remain hidden on desktop-class devices; `TarinaiInputMode.snapshot().touchFirst` controls body class `touch-mobile-ui`.
- Weather rain overlay is diagonal line streaks. Fallen water items, zunda juice, and mercury share the same horizontal oval item-droplet silhouette; recolor only.
- Tool UI icons must be generated previews of `js/items.js` drawing helpers, never separate designs.
## File map
```text
index.html Static DOM shell; ordered script tags; no long ecology/body text.
css/styles.css Layout, HUD, dialogs, tooltips, responsive rules.
js/data.js Sprite/object assets, metrics, config, field presets.
js/text_catalog.js Escaped Japanese UI catalog: tooltips and ecology cards.
js/math.js Generic math helpers.
js/assets.js Lazy image loading, caches, fallback render images.
js/audio.js WebAudio/sample effects.
js/render.js Background, weather, lighting, HUD, global canvas render.
js/sim_core.js Names, personalities, relationships, effects, spatial grid.
js/health.js Damage memory, death-cause normalization, damage application.
js/items.js Item state, lifecycle, drawing, grass/zunchi/ball/firecracker logic.
js/tarinai.js Agent state, AI, disease state, eating, conflict, reproduction, draw.
js/world.js World update, placement, weather, logs, global interactions.
js/ui.js Input, tool selection, dialogs, observation panel.
js/ui_charts.js Population/statistics charts.
js/ui_family.js Family/archive UI and cause-of-death display.
docs/AI_CONTEXT.md Minimal implementation context for AI edits.
docs/code_map.md Symbol-to-file lookup table.
```
## Edit rules
- Preserve zero-build script order. Add new JS files explicitly in `index.html` before dependents.
- Keep global symbols intentional; this codebase is not ESM.
- Prefer catalog/config/helper extraction over adding large inline blocks to `index.html` or `tarinai.js`.
- Do not reintroduce removed compatibility files (`sim.js`, `ui_exports.js`) or broad JS/CSS caching for active code.
- For public uploads, delete old server files before replacing the directory, then upload the full new ZIP contents.
## v15 notes
- Colony chart tab `events` was removed. `environment` now reports security, hygiene, and happiness.
- Selected Tarinai UI includes per-individual records attached by structured observation events.
- Observation highlights selected relatives and major social relations: parent, child, friend, enemy.
- Explosions impart velocity to nearby zunchi items; cursor contact reduces stress and emits dense heart effects.
## v4 \u8ffd\u52a0\u4fee\u6b63
- \u5de3\u7bb1\u5165\u9000\u5ba4\u3092\u5c02\u7528\u72b6\u614b\u5316\u3057\u3001\u900f\u660e\u5316\u30fb\u5f53\u305f\u308a\u5224\u5b9a\u6d88\u6ec5\u30fb\u500b\u4f53\u6570\u53cd\u6620\u30fb\u9000\u51fa\u5fa9\u5e30\u3092\u5b89\u5b9a\u5316\u3002
- \u7761\u7720\u6642\u306e\u512a\u5148\u9806\u4f4d\u3092\u300c\u5de3\u7bb1 \u2192 \u5e72\u3057\u8349\u30d9\u30c3\u30c9 \u2192 \u305d\u306e\u5834\u300d\u306b\u5909\u66f4\u3002
- \u305f\u308a\u306a\u3044\u30c7\u30fc\u30bfUI\u306e\u53cb\u9054/\u6575\u5bfe\u3092\u5168\u4ef6\u30c1\u30c3\u30d7\u8868\u793a\u306b\u3057\u3001\u30af\u30ea\u30c3\u30af\u3067\u500b\u4f53\u3078\u79fb\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u5909\u66f4\u3002

81
app_manifest.json Normal file
View file

@ -0,0 +1,81 @@
{
"version": "15.35.0",
"css": [
"css/base.css",
"css/layout.css",
"css/panel.css",
"css/components.css",
"css/mobile.css"
],
"js": [
"js/version.js",
"js/event_bus.js",
"js/performance_manager.js",
"js/registry_base.js",
"js/disease_registry.js",
"js/effect_registry.js",
"js/sound_pack.js",
"js/data.js",
"js/item_visual_registry.js",
"js/food_registry.js",
"js/input_mode_manager.js",
"js/math.js",
"js/need_behavior_system.js",
"js/physics_helpers.js",
"js/assets.js",
"js/audio.js",
"js/render.js",
"js/sim_core.js",
"js/items.js",
"js/ants.js",
"js/health.js",
"js/tarinai.js",
"js/tarinai_identity_social.js",
"js/tarinai_action_state.js",
"js/tarinai_disease_nest.js",
"js/tarinai_item_effects.js",
"js/tarinai_needs_items.js",
"js/tarinai_social_move_life.js",
"js/tarinai_render.js",
"js/world.js",
"js/world_view.js",
"js/family_graph.js",
"js/world_family_social.js",
"js/world_combat_effects.js",
"js/world_environment.js",
"js/world_spatial_budget.js",
"js/world_ants_system.js",
"js/weather_system.js",
"js/world_update.js",
"js/world_placement_log.js",
"js/world_bootstrap.js",
"js/text_catalog.js",
"js/ui.js",
"js/ui_log.js",
"js/ui_helpers.js",
"js/ui_selected.js",
"js/snapshot_system.js",
"js/save_system.js",
"js/patch_helpers.js",
"js/freeze_system.js",
"js/relation_event_system.js",
"js/ui_layout_dialogs.js",
"js/ui_tools.js",
"js/ui_bind.js",
"js/ui_charts.js",
"js/ui_family_data.js",
"js/ui_family_async.js",
"js/ui_family_layout.js",
"js/ui_family_paths.js",
"js/ui_family_render.js",
"js/main.js",
"js/debug_tools.js"
],
"assetGlobs": [
"assets/ui/*.webp",
"assets/objects/*.webp",
"assets/sprites/*.webp",
"assets/sounds/*.mp3"
],
"notes": "Source of truth for static loading order; generated files are index.html script/link tags and service-worker.js cache list."
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
assets/objects/oshibyo.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/objects/pushpin.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/objects/zunchi.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
assets/ui/tool_ammo.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show more