# 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 ## おしり鋲・冷凍操作変更パッチ - ずんちどれい化条件の喧嘩勝率を30%以下に変更。 - 衰弱死因判定を厳格化。 - 冷凍手段をクリック式から「つまむで冷凍UIへ運ぶ」方式へ変更。 - 新アイテム「おしり鋲」を追加。刺さるとずんちを溜め、日光浴不可。抜くと溜まったずんちが高速で飛散。 - 高速ずんち衝突時の吹き飛び・パニック理由文を追加。 ## 15.22.0 統合リファクタ - `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"` は除去済み。 ## 15.23.0 safe duplicate integration pass - `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. ## 15.34.0 - Hash V9 binary compact format - 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. ## 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.