diff --git a/AI_MAP.md b/AI_MAP.md index 820acb1..db0401f 100644 --- a/AI_MAP.md +++ b/AI_MAP.md @@ -6,7 +6,6 @@ Purpose: static Japanese browser simulation/game. Optimize context by reading th - Entrypoint: `index.html` defines the app shell, canvas, dialogs, right panels, and exact script order. - Runtime style: plain browser JS, global IIFEs, exports on `window`, no bundler/module loader. -- Version/cache: `app_manifest.json`, `js/version.js`, generated `service-worker.js`, and `index.html` query params share `39.16.78`. - Main loop: `js/main.js` initializes assets/audio/world/UI/save, then drives update/render. - Performance/display settings: `js/perf_profiler.js` owns manual visual settings and profiler buckets; display tiers affect rendering/visuals, not simulation-quality branches. - Update order: `js/system_order.js` calls phase facades from `js/simulation_systems.js`. @@ -84,7 +83,6 @@ This section records current boundaries only. Version-by-version cleanup history ## Current Feature Routing -- Achievement system: `js/achievements.js`, `achievement_api.php`, `js/save_schema.js`, `js/save_codec.js`, `js/snapshot_system.js`, and achievement audit scripts. Current save schema is `49`; current app/cache version is `39.16.78`. - Achievement UI: `index.html` achievement dialog, `css/components.css` achievement rows/toast styles, and `js/achievements.js` DOM rendering. - Achievement spell payload: `TarinaiAchievements.exportSpellState()`, `snapshot.g.s`, `save_system.js` spell export inclusion, and `save_codec.js` achievement metadata readers/writers. - Logic board: `js/circuit_board_system.js`, `js/signal_system.js`, signal-related item definitions/metadata, and the generated circuit editor markup/styles. @@ -92,14 +90,23 @@ This section records current boundaries only. Version-by-version cleanup history - Reset presets: `js/world_reset_presets.js`; UI reset selection is in `js/ui_layout_dialogs.js`; social archive reset/fallback routing touches `js/world_family_social.js`. - Physics tool icons and previews: `js/ui_tools.js`, `js/render.js`, `js/placement_preview_system.js`, `js/physics_shape_editor_system.js`, and `js/item_tool_metadata.js`. -## Cleanup Candidate Audit - resolved +## Cleanup Candidate Audit - rechecked 2026-07-18 -The previous cleanup candidate queue has been applied or adjusted. Current state: +Do not delete these yet. This is a current worktree audit of unused, duplicated, stale, or low-meaning processes that should be reviewed before any removal or refactor. -- Version/docs routing was aligned to `39.16.78`; `js/version.js` build identity now matches the app version, and `README.md` no longer points at an older cache-query script URL. -- One-version and overlapping audit scripts from the candidate list were removed; the broad audit suite remains `scripts/achievement_audit.js`, `scripts/playstyle_achievement_audit.js`, `scripts/achievement_integration_audit.py`, `scripts/achievement_server_state_audit.py`, and `scripts/regression_check.py`. -- Shared scalar/object/clone/hash/text helpers now live on `TarinaiCoreHelpers` in `js/deterministic_helpers.js`; action, behavior, structure, snapshot, save, geometry, physics, seesaw, placement-preview, circuit, and signal code route repeated helper logic through that shared surface or through `TarinaiGeometry`. -- UI HTML escaping is owned by `js/ui_helpers.js`; consumers bind explicitly to `TarinaiUIHelpers.htmlEscape`, and `index.html` loads `ui_helpers.js` before the consumers that need it. -- `js/achievements.js` uses `renderIfDialogOpen()` for progress refreshes instead of repeating the hidden-dialog check at each event recorder. -- `js/world_placement_log.js` uses shared close/backdrop binding for editor dialogs; deeper editor extraction can still be done as feature work, but the repeated close process from the cleanup list is removed. -- `FILES.json` now includes JavaScript audit scripts and newer core bootstrap files (`domain_ids`, deterministic helpers, item registries/definitions) in machine routing. +### Stale Current-State Docs And Labels + +- `BUILD_NOTE.txt` header still says schema 51 / payload v6, while `js/save_schema.js`, `js/achievements.js`, and `scripts/achievement_save_v6_audit.js` indicate schema 53 / payload v8. + +### Audit Script Candidates + +- `scripts/achievement_save_v6_audit.js` is named for v6 but asserts current schema 53 and achievement v8. Rename or fold into `scripts/achievement_audit.js` / `scripts/regression_check.py`. +- The many single-purpose `*_regression_audit.js` scripts appear to overlap the broad `scripts/regression_check.py` and achievement audits. Review for consolidation before deleting: `achievement_audio_tooltip_regression_audit.js`, `colony_crisis_regression_audit.js`, `effect_runtime_regression_audit.js`, `history_binary_regression_audit.js`, `long_session_runtime_regression_audit.js`, `non_tarinai_performance_regression_audit.js`, `object_render_cursor_regression_audit.js`, `offscreen_motion_performance_regression_audit.js`, `pathfinding_regression_audit.js`, `performance_5to7_regression_audit.js`, `performance_architecture_regression_audit.js`, `performance_cleanup_regression_audit.js`, `population_recovery_regression_audit.js`, `render_stack_regression_audit.js`, `reproduction_memory_sprite_regression_audit.js`, `reproduction_regression_audit.js`, `self_zunchi_regression_audit.js`, `social_interaction_regression_audit.js`, `tooltip_nail_colony_focus_regression_audit.js`, and `ui_grass_limits_regression_audit.py`. +- The invariant `node --check js/*.js` is weak on this Windows/PowerShell workspace because wildcard expansion does not behave like POSIX shells. Prefer a script-backed check or explicit file enumeration. + +### Duplicated Helper/Glue Processes + +- `const num = global.TarinaiCoreHelpers?.finiteOr || ...` is repeated in `js/geometry_helpers.js`, `js/mechanical_system.js`, `js/physics_projection_system.js`, `js/physics_world_system.js`, `js/placement_preview_system.js`, `js/seesaw_system.js`, and `js/signal_system.js`. Consider a load-order-safe local import pattern or just use `TarinaiCoreHelpers.finiteOr` directly where safe. +- `const clamp = global.TarinaiCoreHelpers?.clampNumber || ...` is repeated in `js/circuit_board_system.js`, `js/physics_world_system.js`, `js/seesaw_system.js`, and `js/signal_system.js`. +- Dialog close/backdrop wiring is partly consolidated in `js/world_placement_log.js`, but `js/world_placement_log.js` signal editor and `js/circuit_board_system.js` still manually wire cancel/close/backdrop handlers. Candidate for a small shared modal-close helper after checking editor-specific behavior. +- `finiteOrNull` in `js/snapshot_system.js` and `finiteNumberOrNull` in `js/save_codec.js` are nearly identical null-preserving numeric helpers. They are persistence-local today, but can be centralized if the save/snapshot boundary remains clear. diff --git a/BUILD_NOTE.txt b/BUILD_NOTE.txt index a5d7199..06df610 100644 --- a/BUILD_NOTE.txt +++ b/BUILD_NOTE.txt @@ -1,282 +1 @@ -tarinai_compact_save_stage4 -- Save schema 33 omits standard item amounts and stores only an optional non-standard block base plus per-item differences. -- Relationship targets are sorted and delta-encoded within each Tarinai row. -- World seeds use a canonical 64-bit hexadecimal identity and occupy exactly 8 bytes in the binary save. -- The binary header contains one schema byte; its high bit signals whether a string table follows. Empty string tables and the duplicate snapshot version are omitted. -- Deflate state is folded into the low bit of the frame-length varuint, eliminating the separate compression byte. -- 15-bit text conversion uses arithmetic Unicode range mapping instead of a 32768-character string and reverse Map. -- Binary schema 51 is the current save format; schemas 49 and 50 remain readable. Achievement payload v6 stores 72 unlock bits and persistent statistician progress while v5 remains importable. -- Version: 39.16.109 -- CompressionStream and DecompressionStream are drained concurrently to avoid browser backpressure stalls. - -- Load confirmation uses the in-game dialog; fan wind is realtime; zunchi tool preview opacity, carried plushie depth, and blanket grass rules were corrected. - -- Passive spring: removed time-driven oscillation; force now depends on extension/compression and relative endpoint velocity. -- Signal effects use the exported TarinaiEffect constructor. -- Pressure-switch placement/editor overlays display the configured detection radius. - -- v39.16.105: removed redundant physics normalization, dirty-marking, compaction, pickup, and collision bookkeeping; unified one-way-fence and bounce corrections while retaining debug diagnostics and defensive recovery paths. - -- Earlier mechanism pass: stronger passive spring, persistent detector ranges, robot-cleaner signal power, and electric shock effect. - -- v39.16.105: fixed the undefined bodyFor reference in mechanical one-way-fence contact handling by using the canonical body velocity helper. - -- v39.16.105: link rendering no longer depends on midpoint spatial visibility; bounce fences launch Tarinai without shock damage; passive springs are more under-damped and elastic. - -- v39.16.105: population chart includes per-bucket births/deaths; rotators accept signed motor speed; champion personality bonuses inherit through descendants; champion-pair mate weighting is moderately reduced. -- v39.16.105: colony population chart records births/deaths, rotators accept negative motor speed, champion personality boosts inherit through descendants, champion-pair mating is slightly reduced, and one-way fence previews/pathfinding honor the passable direction. - -- v39.16.105: one-way fences allow Tarinai forward crossing in swept collision; chart legend dots toggle series; wire tools attach to Tarinai/ants; energized living endpoints panic and take damage; selected data reports electrocution. - -- v39.16.105: added direct food/medicine giving by placement or pinched drop, with a give overlay, stronger food-gift personality change, and heart bursts; removed unused collision reasons and duplicate constraint projection dirty checks. - -- v39.16.105: localized the direct-feeding personality reason, normalized electrocution deaths to the Japanese electrocution label, added detector-controlled gate fences, made chart legend labels fully clickable, and escaped non-ASCII runtime source. - -- v39.16.105: hid pinch overlays for rope/rod/spring/wire connection items and added detector time schedules with a dual-thumb range control, overnight ranges, and persistent copy/save state. - -- v39.16.105: shortened detector copy, removed the time-range explanatory hint, cascaded connection-item removal when any endpoint disappears, and repaired detached plushies so they return to a living owner or disappear with a missing owner. - -- v39.16.105: excluded transient splat effects from all connection endpoint selection and renamed the user-facing feeding need from the formal feeding term to the appetite label. -- v39.16.105: added toilet-seeking before normal defecation; renamed rain shelter to parasol; added sunny +3.5C and unsheltered rain -3.5C felt-temperature corrections; parasols neutralize both and block sunbathing. Pet food, first aid, and sedative remain included. - -- v39.16.105: replaced toilet-seeking with walkable toilet sand that immediately removes poop spawned on its surface; added a parasol ground shadow and explicit hot-sun/cold-rain temperature-seeking targets; fixed null candidate temperatures being interpreted as 0C. - -- v39.16.105: aligned parasol placement overlay with its shade, made toilet sand absorb rain water, expanded Happy/Athletic/War presets, simplified Athletic rotators, and reserved their full rotation envelope from fences. - -- v39.16.105: added a few bounce fences to War, reduced ordinary-fence restitution, restored ball collisions for visible sleeping Tarinai, moved nest-box tooltips closer, allowed movable-item placement overlap, and fixed delete-tool target lookup. - -- v39.16.105: unified in-world tooltip spacing, added the Hair Trigger preset, and replaced physics-category line-like tool icons with distinct semantic silhouettes. - -- v39.16.105: moved snap-mode switching to a dedicated operation control with Free/20px/40px/60px cycling, removed F/G from size badges, allowed valid placement against the field top edge, and standardized preset descriptions with Japanese full stops. - -- v39.16.105: unified biological/environmental conditions into the detector, removed the standalone sensor and relay types with no save migration, folded temperature/limits, moved secondary controls into the header menu, preserved tool mode while browsing tarinai data, and added five-second mobile selection tips. - -- v39.16.105: detector numeric sliders match the time-control presentation; colony settings are unified; display settings are inline; meter colors, snap control, range-delete icon, and ant chart defaults are revised. - -- v39.16.105: restored the compact sticky operation palette, added exact-match panel search, reorganized colony settings/stats, and refreshed range-delete and mechanism icons. -- v39.16.105: moved partial panel search to the header with previous/next navigation and tooltip text indexing; localized snap mode labels; simplified bounce-fence and reciprocator icons; matched expanded colony settings to the chart background. - -39.16.105: Added local achievements and optional self-hosted shared unlock percentage API. - -39.16.105: Expanded achievements to ten conditions, added local/shared reset, rapid-event windows, generation streaks, and special collision tracking. - -39.16.105: Expanded achievements to fifteen conditions, changed rapid deaths to 50 in 10 seconds, moved conditions into game tooltips, added toast-to-button absorption, and added colony disease/happiness, cumulative hand feeding, ritual ignition, and laxative-starvation achievements. - -39.16.105: Audited all achievements; fixed impossible slave generation tracking, persisted generation runs, queued simultaneous unlock toasts, hardened launched-zunchi stop detection, and preserved laxative-at-death timing. - -39.16.105: Added seven play-style achievements for passive observation, fifty world placements, detector automation, rope/rod/spring coverage, a five-minute death-free 25-Tarinai colony, 25 live ants, and 30 cumulative ant kills; persisted world-scoped timers and placement progress. - -39.16.105: Revised achievement naming and disclosure UI, replaced achievement tooltips with inline post-unlock descriptions and horizontal shared-rate bars, merged detector automation plus link coverage into 機械化産業, changed placement and ant-kill goals to persistent totals of 100, and made direct-feeding progress reset with the field. - -39.16.105: Added 大いなる母 and 喧嘩両成敗, renamed five achievements, revised five revealed descriptions, and added a debug-only all-achievements button. - -39.16.105: Corrected the zunchi-slave fight-record threshold text to 30%; fixed wire placement totals, danger-kill attribution for 喧嘩両成敗, partial legacy link migration, strict player-ID validation, post-unlock storage writes, and debug-only unlock isolation from shared statistics. - -39.16.105: Added additive client-to-server full-state synchronization for automatic aggregate recovery after server-side achievement data loss. - -39.16.105: Expanded achievements from 27 to 43 with history, cleanup, care, ecology, temperature, weather, medicine, combat, and ant-experiment conditions; persisted the required reset-scoped metadata in a new incompatible save schema; made nest-box and pipe occupants weather-protected; and added false-positive guards for time-zero markers and stale ant damage attribution. - -39.16.105: Reorganized achievements into four collapsible categories, removed achievement tooltips, surfaced pre-unlock disclosures in the achievement UI, and replaced native browser confirmations with a shared in-game dialog. - - -39.16.105: Renamed the four achievement categories to 生態/実験/建築/その他, moved unlocked achievements to the top of their own categories, disclosed four additional conditions before unlock, raised 大いなる母 to 3333 births, and moved achievement unlock toasts to the upper-left. - -39.16.105: Added 真・たりない観察, 悠久の歴史, 五体満足, and 零体満足; disclosed 悠久の歴史 before unlock; reduced achievement overhead by skipping closed-dialog list rebuilds, caching category mappings, debouncing pending sync, and retaining periodic full recovery sync. - -39.16.105: Added 町のお医者さん and 割とふわふわ; changed ベビーブーム to 30 births per minute and 管理された楽園 to one uninterrupted happy in-game day from play day 6; repaired shared つつく targeting, damage, plushie fling, and hover overlay; corrected manual rotator/reciprocator push direction; tightened tool/limit typography; reduced periodic achievement scans; and changed server aggregate writes to compact v2 JSON with legacy-state migration. -39.16.105: Added 混沌ヲ希求スル者 and 潔癖症; made fight progress persistent; revised ミニマリスト, おくすり手帳全埋め, and 清掃業者; and made achievement-rate bars visible on unlocked cards. - -39.16.105: Compactly embeds unlocked achievements and persistent achievement progress in exported spell saves; spell loads merge achievements without erasing local progress and resync restored unlocks to the server. - -39.16.105: Replaced JSON-string achievement metadata in spell/save binaries with a sparse binary schema; achievement unlock masks are raw bits, progress is bit-packed, timestamps use minute deltas, and old v39.16.105 spells remain readable. -39.16.105: Added persistent sniper, megalopolis, and love-mochi fertility achievements; changed chaos progress to fight-mochi-influenced fights only; extended compact spell progress without migrating obsolete generic fight counts; omitted completed achievement counters from spell metadata; and tightened population-limit labels/layout. - -39.16.105: Expanded achievements from 54 to 59 with single-digit FPS, 24-hour continuous play, five toilet-sand placements, park-ground editing, and four ground changes per second; revised safety, observation, and empty-click conditions; moved the two observation achievements to the bottom of その他; and expanded binary achievement masks to eight bytes while retaining schemas 41–43. - -39.16.105: Fixed achievement progress typography and tab-switch observation continuity; added アリ観察 and 命のバトン; persisted sticky-bomb pass counts; aligned sauna/enemy-ant conditions; removed obsolete spell compatibility; current exports use schema 45 and achievement payload v4. - -## v39.16.105 -- Added 毎日たりない観察 and 抵抗器じゃない. -- Daily streak state is carried by achievement payload v5 and binary schema 46. -- Achievement aggregate JSON migrates compact v2/verbose input to compact v3 automatically under the API file lock. - -## v39.16.105 -- Re-audited the not-yet-deployed shared achievement server with generated randomized unlock data instead of a fixed production sample. -- Shared summaries are read-only; only POST session/unlock/sync/reset calls register or update players, and GET mutations are rejected. -- State writes now use a separate lock file plus atomic same-directory replacement, preserving the previous state across interrupted writes. -- Invalid or structurally unknown JSON returns `storage_corrupt` without overwriting the source file. -- `completionistEligible: false` now prevents `true_tarinai_observer` from being re-added by the same sync payload. -- The randomized server audit covers 32 v2/verbose migrations and 72 concurrent player syncs with exact semantic comparison. - -## v39.16.105 -- Added seesaw cooperative play and friendship growth. -- Added circuit-board editor with positioned input/output terminals and AND/OR/NOT gates. -- Added electrical control for fan, stove, dry ice, and duplicator. -- Added connectable-item and circuit-terminal highlights while wiring. -- Save snapshot/schema: 38/47. - -## v39.16.105 -- Circuit board editor now uses a grid canvas with direct gate placement and cursor-drawn wiring. -- Legacy circuit layouts are intentionally not converted. -- Colony state evaluates every two in-game hours; growing populations cannot be classified as Weakened. -- Seesaw action selection, fixed orientation, and placement preview were corrected. - -## v39.16.105 -- Seesaw leisure can start at a lower boredom threshold, and a waiting rider raises the second rider's action priority. -- Active paired play is shown as 「シーソーをしている。」 in selected Tarinai data. -- Seesaws render in the low/back item layer instead of covering Tarinai sprites. -- AND/OR gate input pins and gate outputs are snapped to the same 40px circuit-editor grid used by cursor wiring. - -## v39.16.105 -- Circuit-board internal wiring now uses straight grid segments with explicit branch junctions and unlimited fan-out per terminal. -- Removed OR and added a one-input/one-output rectifier; internal logic parts rotate in 90-degree steps. -- Circuit-board external terminal counts and positions are editable; the board footprint and default terminal spacing were expanded. -- Detector numeric conditions now use a dual-thumb minimum/maximum range plus direct numeric inputs. -- Seesaw riders render slightly above the seat surface. -- Save snapshot/schema: 39/48. Older saves are intentionally unsupported. - - -## v39.16.105 -- The default circuit-board grid is now 10x6, one quarter of the previous editor area, with a correspondingly smaller world footprint. -- Circuit-board width and height are editable; the board world size follows the grid dimensions. -- Input/output terminal count is limited by board height, and every external terminal can be dragged independently onto the left, right, top, or bottom edge. -- Branch junctions can be moved directly; all connected straight segments follow the junction. -- NOT and rectifier bodies are visually smaller while their pins remain on grid intersections. -- Existing external wires follow terminal positions after a board resize or terminal move. -- Seesaw action reasons now use play-specific wording instead of inheriting unrelated fulfillment reasons such as bed demand. -- Save snapshot/schema: 40/49. Older saves are intentionally unsupported. - - -## v39.16.105 -- Circuit-board external terminals are now placed directly with IN/OUT terminal tools; the +/- terminal-count controls were removed. -- Disconnected external terminals are dimmed in the circuit-board editor; connected terminals retain their signal colors and cannot be deleted until their world wire is removed. -- Placement previews no longer use the generic ellipse fallback: circle items use circles, obstacle/mechanical items use their collision footprints, and special items use dedicated shapes. -- Detector, wire, insulated wire, and circuit board moved from the Physics palette section to a new Electrical section. -- Clicking a detector dual-range track outside either thumb teleports the nearer thumb to the clicked value. -- Save snapshot/schema remains 40/49; the persisted circuit-board v4 structure is unchanged. - - -## v39.16.105 -- Circuit-board default grid is 10x10 and both dimensions can grow to 20x20; the world footprint scales proportionally in both axes. -- AND gate body height is two grid cells. Compact one-input parts can be placed one grid row from the top/bottom edges when their rotated pins remain in bounds. -- Placement previews prefer shared occupancy/collision footprints; the dedicated seesaw preview was removed and circuit boards use their rectangular board footprint. -- Internal combinational feedback loops are explicitly detected and forced OFF; a NOT self-loop is unstable and does not provide power. -- Save snapshot/schema remains 40/49; the persisted circuit-board v4 structure is unchanged. - - -## v39.16.105 -- Circuit-board editing shows placement ghosts for pending internal parts and terminals. -- Q/E rotates pending internal parts by 90 degrees before placement. -- The ON constant source is documented in the editor. -- Wire and insulated-wire palette silhouettes render correctly in the Electrical category. -- Save snapshot/schema remains 40/49. - - -## v39.16.105 -- Removed the circuit-board OFF constant source. -- Added the achievement 「情報化産業」 for transmitting an active signal directly from one circuit board output to another circuit board input through wire or insulated wire. -- Extended the 8-byte achievement mask to use its final bit, supporting all 64 current achievements. -- Save snapshot/schema remains 40/49. - - -## v39.16.105 -- Fixed 「あぁ^~ たまらねぇぜ」: burst zunchi no longer treat their spawn overlap with the owner as a collision. -- A burst zunchi now becomes eligible only after it has cleared the owner once; a later fatal return collision unlocks the achievement, including routes that reflect and accelerate on a bounce fence. -- Preserved the existing nonfatal, stopped, and player-held disqualification behavior. -- Fixed ミニマリスト placement-origin metadata so it remains saveable after 無計画都市 has already unlocked. -- Fixed サウナ水風呂 to measure 15 seconds from genuine entry into a hot state instead of refreshing the hot timestamp on every hot evaluation. -- Fixed 抵抗器じゃない so a Tarinai killed by the qualifying shock still counts before death clears its live state. -- Achievement reset now clears reset-scoped hidden per-Tarinai and per-item progress, including care counts, sauna state, held duration, fight-mochi metadata, sticky-bomb pass count, and quick-delete timestamps. -- Undo/Redo and valid ground changes now reset 監視カメラ observation progress as world interventions. -- Added route-level and secondary regression coverage for these achievement paths. Ambiguous achievement semantics identified by the renewed audit remain unchanged pending explicit specification. - -39.16.105: Applied confirmed achievement semantics: birth-status slave/king appearances count; dynasty achievements require direct parent-child qualifying lineage; Overprotective treatment counts only actual beneficial health recovery; Unplanned City counts deletion operations rather than removed objects; Surveillance Camera requires 3 uninterrupted game days and resets on gameplay interventions; wire-shock partial progress remains nonpersistent; Pest Control counts only player-caused ant deaths. - - -## v39.16.105 -- Optimized Tarinai social-neighbor scans with squared-distance filtering, nearest-N partial selection, pair-deduplicated symmetric work, cached personality profiles, and shared disease spread logic. -- Added personality-derived crowd comfort bounds. Overcrowded Tarinai flee toward less crowded space with the specified behavior text; undercrowded Tarinai become stressed and approach the nearest living Tarinai with the specified loneliness text. - - -## v39.16.105 -- Replaced Undo/Redo object snapshots and recursive patch history with the existing synchronous binary save codec payload. -- Exposed binary snapshot encode/decode helpers from TarinaiSaveCodec for internal history reuse without Base32768 text conversion or asynchronous compression. -- Replaced JSON.stringify-based duplicate detection with a compact dual 32-bit fingerprint over the encoded history bytes. -- Unified Undo and Redo stack movement through a shared history transition path while preserving synchronous behavior and the 48-entry limit. -- Added binary-history regression coverage for storage shape, duplicate suppression, Undo restoration, and Redo restoration. - - -## v39.16.105 -- Render stack optimization: static visible stacks are cached by static spatial generation and camera region, while dynamic stacks reuse previous-frame order before insertion sorting and are merged linearly. -- Link rendering now uses dedicated AABB spatial cells instead of per-frame full type-bucket fallback scans. -- Carried plushies render at owner-relative positions without mutating simulation coordinates during rendering. -- Fixed render culling radii are cached on eligible static entities. -- Render-layer sort keys are computed once per stack insertion. - - -## v39.16.105 -- Reduced fixed render cost by skipping the fallback full-screen gradient whenever the transformed field fully covers the viewport. -- Cached full-screen fallback gradients and rebuilt atmospheric full-screen lighting at 8 Hz instead of constructing multiple full-screen gradients every frame. -- Reused dynamic render-layer entries, sort maps, and previous-order ID arrays to reduce per-frame garbage collection as population grows. - - -## v39.16.105 -- Removed social crowd-retreat selection and the overcrowded colony-state distance scan. -- Removed the unconditional three-second full terrain-cache invalidation; cached terrain now refreshes only from real terrain changes, with splat fading invalidating local chunks. -- Throttled structure dependency safety sweeps, staggered item/ant compaction, and stopped timer-only item bucket rebuilds. -- Deferred periodic statistics UI refreshes and collapsed population statistics into a single pass. -- Ordinary item additions/removals no longer invalidate the full terrain cache unless cached terrain items actually changed. - -## v39.16.105 -- Large-save restore uses an adaptive non-damaging settling phase for dense loaded populations, preventing synthetic body-overlap and obstacle-correction impulses from cascading into impact deaths. -- Duplicator loading takes priority over direct feeding when a Tarinai overlaps the machine. -- Save schema 50 explicitly stores elapsed completed days; total simulation time is restored monotonically and seasons/climate derive from elapsed days. Schema 49 spells remain readable. - - -## v39.16.105 -- Moved the ずんちどれい and たりない王 population-chart toggles to immediately after 死亡数. -- Removed the 12-second periodic Tarinai runtime-cache full sweep that caused large-population performance regressions. -- Runtime relationship/cache cleanup is now scheduled only after accumulated deaths reach max(20, floor(living population * 15%)), then runs once during the next Tarinai compaction and resets its counter. - - -## v39.16.105 -- Added eight playstyle-survey achievements: 数こそ力, 少数精鋭, 踩屎感, 快適な寝床, 石に枕す, 季節を越えて, 推し, and 統計学者. -- 数こそ力 unlocks at 100 living Tarinai. 少数精鋭 requires 1-25 living Tarinai continuously for five game days and discloses its condition/progress before unlock. -- 統計学者 counts 30 statistics-tab or chart-series visibility button presses in persistent achievement state, so field resets do not clear its progress. -- Achievement spell payload v6 and binary save schema 51 expand the unlock mask from 64 to 72 achievements while retaining v5/schema 49-50 read compatibility. -- Updated the Item lifecycle pipeline regression to validate local bucket/spatial invalidation when passive serving-food decay actually changes its visual footprint. - - -## v39.16.105 -- Removed previous-order render Maps and custom insertion sorting; dynamic visible lists now use native Array.sort after culling. -- Removed the shared route cache while retaining actor-local route throttling. -- Disabled detailed performance counters in normal play; diagnostics remain available only in explicit debug/perf mode. -- Isolated obstacle-query cache invalidation to routing-obstacle generations instead of generic spatial movement. -- Replaced per-frame full Tarinai spatial-grid rebuilds with cell-crossing incremental updates. -- Added sustained hysteresis to automatic performance-profile transitions to prevent rapid quality oscillation. -- Death-reference cleanup now executes in bounded per-frame chunks after the existing adaptive death threshold. - -## v39.16.105 -- Fixed dense-population birth regression caused by incremental Tarinai spatial-grid bucket ordering interacting with an early 20-candidate contact cutoff. Contact interactions now consider the complete already-fetched local candidate set while retaining only the nearest bounded interaction list. -- Moved the "季節を越えて" achievement from the ecology category to "その他". -39.16.105: UI input/limits/zoom refinements, infection chance reduced to one-third, 75 achievements, grass spatial/hot-path optimization, summer flat temperature bonus removed. - -- v39.16.105: restricted in-world item tooltips to sleep furniture; delete tool now removes lodged pins after pinch-equivalent detach effects; raised confusion/breeding colony-state thresholds; clicking a Tarinai scrolls the right panel to Tarinai Data. - - -## v39.16.107 -- Long-session runtime caches now expire independently of deaths; recurring fight resolution no longer creates permanent time-bucket keys. -- Visual effects OFF now gates effect creation/update/drawing, including rain, while ON keeps the existing visual budgets unchanged and uses broader effect pooling plus allocation-free update traversal. -- Hidden family trees no longer run full graph normalization/pruning from simulation maintenance; pending cleanup is handled when the family view is opened. - -## v39.16.106 -- Renamed the achievement 「メメント・モリ」 to 「多数の死は統計上の数字でしかない」. -- Replaced push-only log kinds with six shared event categories: 生命 / 危険 / 交流 / 生活 / 環境 / 観察. Category toggles now filter both the event UI and push notifications. -- Prevented family-tree layout work before first use and while the family section is inactive; tab switches reuse family caches, cancel offscreen in-progress layout work, use one activation event, and throttle scroll-driven tab detection to animation frames. -- Manual Tarinai addition now resets 監視カメラ observation progress as a player intervention. - - -## v39.16.109 -- Repaired family-tree activation after lazy-render cancellation and added blank-view recovery rendering. -- Robot cleaners keep obstructed cleanup targets and route around nest boxes/fences instead of permanently excluding nearby zunchi. -- Added the achievement 「マッドサイエンティスト」 for administering mystery drug to 10 distinct Tarinai. +Current build metadata is defined in js/version.js and app_manifest.json. diff --git a/FILES.json b/FILES.json index 80f5ee5..08ffb02 100644 --- a/FILES.json +++ b/FILES.json @@ -1,6 +1,6 @@ { "purpose": "Token-efficient machine-readable routing for tarinai_. Use scripts/ai_inventory.py for exact current file expansion.", - "version": "39.16.109", + "version": "39.16.137", "entrypoints": { "app": "index.html", "runtime": "js/main.js", diff --git a/GAME_FEATURES.md b/GAME_FEATURES.md index 89ef423..0b440d3 100644 --- a/GAME_FEATURES.md +++ b/GAME_FEATURES.md @@ -75,26 +75,19 @@ Manual save and restore use browser storage. Reset returns to field selection an Display settings control effects, shadows, drawing detail, and quality choices for crowded scenes. Crowded fields are an intended part of the sandbox, so the game uses spatial lookup, scheduling, cached drawing, and incremental maintenance systems to keep large colonies and many objects playable. -## Achievement system (v39.16.78) -- Sixty-four achievements track reproduction, natural status changes, generation runs, rapid population events, special deaths, colony conditions, individual care, autonomous ecology, history usage, cleanup, rapid deletion, temperature transitions, weather shelter, medicine-category completion, combat reversals, circuit-board signaling, and ant-related play styles. -- Locked rows reveal only the configured condition allowlist; all others show `???`. There are no achievement tooltips. 大いなる母, めっちゃたりない観察, 敵の敵は味方, 混沌ヲ希求スル者, and 豊穣ヲ希求スル者 include local progress percentages, and unlocked achievements are sorted first inside each category. +## Achievement system +- Seventy-six achievements track reproduction, natural status changes, generation runs, rapid population events, special deaths, colony conditions, individual care, autonomous ecology, history usage, cleanup, rapid deletion, temperature transitions, weather shelter, medicine-category completion, combat reversals, circuit-board signaling, and ant-related play styles. +- Locked rows reveal only the configured condition allowlist; all others show `???`. There are no achievement tooltips. 母なる大地, めっちゃたりない観察, 敵の敵は味方, 混沌ヲ希求スル者, and 豊穣ヲ希求スル者 include local progress percentages, and unlocked achievements are sorted first inside each category. - Each achievement row behaves as a horizontal bar chart. Its background fill visualizes the optional global completion percentage from 0–100%, and the global achiever count is displayed beside it. - `物でいっぱい` requires 100 cumulative player placements across field resets. `害虫駆除` requires 100 cumulative ant kills across field resets. -- `餌やりじいさん` requires 33 direct feedings in one field; resetting the field resets this progress. +- `餌やりじいさん` requires 33 cumulative direct feedings; field resets do not reset this progress. - `機械化産業` replaces the former detector-automation and link-craftsman achievements and unlocks only when both requirements are met. -- v39.16.56 adds 混沌ヲ希求スル者 and 潔癖症, raises 清掃業者 to 200, starts ミニマリスト from day 6, excludes chain/crown from おくすり手帳全埋め, and keeps shared-rate bars visible after unlock. -- v39.16.54 added 真・たりない観察, 悠久の歴史, 五体満足, and 零体満足. v39.16.55 added 町のお医者さん for 50 effective first-aid recoveries and 割とふわふわ for flinging a plushie with つつく. ベビーブーム now requires 30 births in one minute; 管理された楽園 starts tracking from play day 6 and requires one uninterrupted happy in-game day. -- Local unlocks and persistent totals live in browser storage. Field-scoped direct-feeding, cleaner, self-sufficiency, enemy-ant, generation, observation, safety, and per-entity/item progress follow current-format saves where applicable. Nest-box and pipe occupants block rain/weather effects and count as sheltered for 雨宿り完了. +- Local unlocks and persistent totals live in browser storage. Direct-feeding, Undo, and Redo totals persist across field resets. Cleaner, self-sufficiency, enemy-ant, generation, observation, safety, and per-entity/item progress remain field-scoped where their conditions require it. Nest-box and pipe occupants block rain/weather effects and count as sheltered for 雨宿り完了. - Achievement evaluation is primarily event-driven; periodic world scans skip completed or irrelevant conditions. The server writes compact v3 achievement aggregate JSON while migrating older aggregate formats on read. -- v39.16.78 fixes achievement edge paths found by a renewed 64-condition audit: Minimalist placement metadata survives unrelated unlocks, Sauna/Cold-Plunge uses true hot-entry timing, lethal qualifying wire shocks count before death cleanup, reset clears hidden reset-scoped progress, and Undo/Redo/ground changes interrupt passive observation. Ambiguous semantics are intentionally unchanged pending specification. -### Achievement spell persistence (v39.16.78) +### Achievement spell persistence - Exported spells compactly include non-debug achievement unlocks, unlock times, and persistent progress. - Loading a spell merges achievements and keeps the greater progress instead of erasing local achievement data. - Restored unlocks are queued for the existing server recovery synchronization. Save slots remain world-only. -- Spell achievement metadata uses a sparse binary encoding: raw unlock bits, bit-packed persistent progress, minute-delta unlock timestamps, and sparse per-entity state. Binary save schema 51 is current; schemas 49 and 50 remain readable. Achievement payload v6 stores 72 unlock bits and statistician progress, while legacy payload v5 remains importable. -- v39.16.60: Added 狙撃手, メガロポリス, and 豊穣ヲ希求スル者; restricted 混沌ヲ希求スル者 to fight-mochi-influenced fights; extended compact achievement spell progress and omitted counters for already-unlocked achievements. -- v39.16.62: Added five achievements for low FPS, uninterrupted 24-hour play, toilet-sand placement, park-ground editing, and rapid ground changes. 寿命 deaths are excluded from 安全第一 failures, empty-field clicks replace pause-button clicks for 何やってるの?, and the two long observation achievements are last in その他. - -- v39.16.63: Added アリ観察 and 命のバトン; stabilized progress-row typography; continuous-play observation no longer resets on tab changes; corrected sauna wording and enemy-ant streak reset behavior; obsolete spell formats are rejected. +- Spell achievement metadata uses sparse binary encoding for unlock bits, persistent progress, minute-delta unlock timestamps, and sparse per-entity state. The current save and achievement payload formats are defined by `js/save_schema.js` and `js/achievements.js`. diff --git a/README.md b/README.md index ea6631c..c9ab1b4 100644 --- a/README.md +++ b/README.md @@ -13,19 +13,6 @@ AI-first entrypoint for a static browser simulation/game. Keep this file small; ## Runtime Shape -- v39.16.37 changes: biological and environmental conditions are unified into the detector; the standalone sensor and relay are removed; temperature and limits are folded; ecology, sound, display settings, and credits are in the header menu; reset remains outside in red; tarinai-data navigation preserves the active tool; mobile tool descriptions appear at the top for five seconds. Snap mode remains Free/20px/40px/60px, top-edge placement is fixed, and preset descriptions end with punctuation. -- v39.16.38 changes: detector numeric controls use value-labelled sliders like the time control; colony temperature and limits share one Colony settings fold; display settings use an inline menu matching sound settings; HP/stress meter colors are fixed; the snap control follows Clear with a faint grid icon; area-delete has a new icon; the Ant chart series is renamed and hidden initially. -- v39.16.55 changes: expanded the achievement set to 49 with 町のお医者さん and 割とふわふわ; changed ベビーブーム to 30 births per minute and 管理された楽園 to one happy in-game day from play day 6; restored shared poke targeting/highlights and plushie fling; corrected manual rotator/reciprocator push direction; tightened tool/limit UI; reduced periodic achievement scans; and introduced compact achievement aggregate storage. -- v39.16.52 changes: reorganized achievements into collapsible categories, removed achievement tooltips, and moved confirmation flows into the game UI. Previous v39.16.51 changes: expanded the achievement set to 43 with sixteen play-style and special-action conditions; added persistent Undo/Redo and quick-delete counters, field-local cleaner/automation-free ecology progress, individual care/temperature/fight tracking, complete medicine-category collection, protected rain shelter in nest boxes and pipes, and stricter ant-kill attribution. -- v39.16.49 changes: added additive full-state synchronization so shared achievement aggregates can be rebuilt as players return after server data loss. -- v39.16.48 changes: corrected the zunchi-slave threshold text to 30%; repaired wire placement counting, danger-kill attribution, partial legacy link migration, UUID validation, and debug-only achievement isolation. -- v39.16.47 changes: Two achievements are added (大いなる母 and 喧嘩両成敗); five names and five revealed descriptions are revised; `?debug=1` exposes an all-achievements button. -- v39.16.46 changes: achievement names and presentation are revised; conditions are revealed only after unlock; shared completion rates render as horizontal background bars; automation and link coverage merge into 機械化産業; placement and ant-kill targets are persistent totals of 100; direct feeding resets with the field. -- v39.16.45 changes: seven play-style achievements add passive observation, cumulative placement, detector automation, link-tool coverage, safe large-colony operation, ant population, and ant elimination measurements. World-scoped timers and placement counts persist in current-format saves. -- No bundler; `index.html` loads ordered global-IIFE scripts with `?v=39.16.78`. -- v39.16.31 changes: all in-world tooltips use the closer offset; Hair Trigger adds a central bounce-fence ball enclosure with Tarinai and pet-food duplicators outside; physics tools use distinct icons. -- v39.16.29 changes: parasol placement preview now uses the exact shade center and footprint; toilet sand absorbs rain-created water drops. Happy adds parasols, water balloons, and toilet sand beneath each duplicator; Athletic uses fence-safe single-bar rotators and water balloons; War adds rotating fans. -- v39.16.19 changes: food and medicine can be given directly by placement or pinched drop, with a dedicated overlay, food heart bursts, and stronger personality effects; unused collision reasons and duplicate constraint projection dirty checks were removed. - Mutable runtime lives on `window`; primary entities are `World`, `Tarinai`, items, structures, ants, family graph, weather, and save snapshots. - Update loop: `main.js` creates the world/UI loop; `World.update` delegates to `TarinaiSystemOrder.update`; `system_order.js` runs named phases. - UI loop: pointer/tool/UI intents go through `command_dispatcher.js`; canvas drawing is in render modules; side panels are `ui_*.js`. @@ -65,48 +52,10 @@ AI-first entrypoint for a static browser simulation/game. Keep this file small; - Inventory sanity: `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/ai_inventory.ps1 -All` -### v39.16.16 -Colony birth/death chart lines, reverse rotators, champion-trait inheritance, reduced champion-pair mating, and directional one-way-fence routing. - - -- v39.16.39 changes: restored the compact sticky operation palette, added exact-match right-panel search, reorganized colony settings, and refreshed tool icons. - - -## Achievement system (v39.16.78) -- Sixty-four local achievements cover biological events, special deaths, colony conditions, individual care, passive ecology, Undo/Redo behavior, rapid deletion, cleaner use, temperature transitions, medicine-category completion, weather shelter, combat reversals, circuit-board signaling, and ant-related play styles. -- Locked entries show the configured pre-unlock disclosure directly in the row; all other locked entries show `???`. 大いなる母, めっちゃたりない観察, and 敵の敵は味方 show local progress percentages. Unlocked entries appear first within each category. -- Each entry is a horizontal completion-rate bar whose background fill reflects the optional shared global unlock percentage; the shared achiever count appears beside the percentage. -- v39.16.64 adds 毎日たりない観察(7 calendar days) and 抵抗器じゃない(7 distinct tarinai shocked by one energized bare wire). v39.16.54 added 真・たりない観察, 悠久の歴史, 五体満足, and 零体満足. v39.16.55 added 町のお医者さん for 50 effective first-aid recoveries and 割とふわふわ for flinging a plushie with つつく; both are event-driven and 町のお医者さん is disclosed before unlock. v39.16.56 added two achievements, persistent fight progress, stricter robot-only evaluation, revised thresholds, and unlocked-card rate bars. v39.16.60 adds three achievements and restricts the chaos counter to fight-mochi-influenced fights. -- Persistent totals include 物でいっぱい, 害虫駆除, 大いなる母(3333体), 無計画都市, やっぱなし, and やっぱあり. Field-local progress includes 餌やりじいさん, 清掃業者, 自給自足, and 敵の敵は味方; applicable field-local metadata follows current-format saves. -- `自動化の第一歩` and `リンク職人` are retired and replaced by `機械化産業`, which requires both detector-driven activation and rope/rod/spring coverage. Existing players with both retired achievements migrate automatically. -- Optional same-origin PHP API aggregates anonymous player counts and global unlock percentages. Raw aggregate data is stored under `.achievement_data/state.json` in compact v3 positional arrays. Compact v2 and the prior verbose object are accepted only as migration inputs and are automatically rewritten under a separate server lock with atomic file replacement on the next API read. UUIDs are binary/base64url encoded, achievement IDs are indexed, timestamps are delta-coded, and repeated game versions use a dictionary. -- On startup, shared-stat refresh, achievement-screen opening, and every five minutes, the client sends its complete non-debug unlock set with original local timestamps. Ordinary unlock bursts send only unsynchronized records after a short debounce. The server adds only missing records, so a lost `state.json` is rebuilt incrementally as players return without overwriting surviving records. - ### Shared achievement percentage deployment - Upload `achievement_api.php` and the hidden `.achievement_data` directory with the game. - PHP must be enabled, and `.achievement_data` must be writable by the PHP process. - On a static-only host, local unlocks still work; the global percentage is shown as unavailable. - Set `window.TARINAI_ACHIEVEMENT_API` before `achievements.js` to use a different same-origin endpoint. -- The current release tracks sixty-four achievement IDs, supports per-player reset, and accepts additive bulk synchronization for automatic recovery after aggregate-data loss. A separate backup remains necessary to recover players who never return. +- The current release tracks 76 achievement IDs, supports per-player reset, and accepts additive bulk synchronization for automatic recovery after aggregate-data loss. A separate backup remains necessary to recover players who never return. - `python3 scripts/achievement_server_state_audit.py` creates deterministic randomized achievement histories at runtime; it does not require or modify a production `state.json`. -- v39.16.60 changes: achievement metadata in spells is now encoded as sparse binary data instead of embedded JSON; unlock masks, progress, timestamps, per-entity counters, and placement metadata are compactly packed and spell data is accepted only from the current format. -- v39.16.60: Added 狙撃手, メガロポリス, and 豊穣ヲ希求スル者; restricted 混沌ヲ希求スル者 to fight-mochi-influenced fights; extended compact achievement spell progress and omitted counters for already-unlocked achievements. -- v39.16.62: Added スペックがたりない, 寝ろ, 砂場, そこ公共空間だよ?, and 破格の工事費用; 寿命 deaths no longer reset 安全第一; 何やってるの? now uses empty-field clicks; and save schema 44 expands the achievement mask while decoding schemas 41–43. - -- v39.16.63: Fixed achievement progress text weight and continuous-play tab switching; added アリ観察 and 命のバトン; corrected サウナ水風呂 and 敵の敵は味方 condition mismatches; save/spell data accepts only schema 45 and achievement payload v4. -- v39.16.64: Added 毎日たりない観察 and 抵抗器じゃない; introduced calendar-day streak persistence; and migrated server aggregate JSON to compact v3 positional data automatically on read. -- v39.16.65: Hardened pre-deployment server migration with read-only summaries, POST-only mutations, corruption-safe decoding, atomic writes under a separate lock, completionist eligibility filtering, and seeded randomized/concurrent migration audits. - -- v39.16.66: Added two-user seesaw play, an editable AND/OR/NOT circuit board with positioned terminals, signal control for fan/stove/dry ice/duplicator, and wire-target highlighting. - -- v39.16.67: Replaced the circuit-board dropdown editor with direct grid placement and cursor-drawn wiring; changed colony-state evaluation to every two in-game hours and excluded growing populations from Weakened; fixed seesaw action selection, fixed its orientation, and matched the placement overlay to its shape. -- v39.16.69: Reworked circuit-board wiring into straight grid segments with branches and multi-connect terminals; removed OR and added a rectifier; made internal parts rotatable and external terminal count/positions editable; expanded board terminal spacing; changed detector numeric conditions to min/max dual sliders with number inputs; and raised seesaw riders slightly above the seats. -- v39.16.68: Fixed seesaw participation so idle/bored Tarinai can initiate play and a waiting rider strongly recruits a partner; selected data reports active play as 「シーソーをしている。」; moved seesaws behind sprite layers; and aligned all two-input circuit gate pins to the 40px wiring grid. -- v39.16.70: Reduced the default circuit-board footprint to one quarter of the previous area; made grid width/height editable; made external terminals movable on all four edges with a height-dependent count limit; made branch junctions movable; reduced NOT/rectifier body sizes; and corrected seesaw action-reason text. - -- v39.16.71: Replaced circuit-board terminal +/- controls with direct IN/OUT terminal placement and erasing, dimmed terminals without external world wires, removed generic elliptical placement previews, added an Electrical tool category for detector/wires/circuit board, and made detector range-track clicks move the nearest thumb. - -- v39.16.72: Circuit boards now default to 10x10 with a 20x20 maximum, AND uses a two-cell height, compact gates can sit closer to top/bottom edges, placement previews follow occupancy footprints more directly, and unstable internal logic loops are explicitly forced OFF. -- v39.16.73: Circuit-board editing now shows placement ghosts for internal parts and terminals, Q/E rotates the pending internal part by 90 degrees, ON constant sources are explained in the editor, and wire/insulated-wire palette silhouettes render correctly after the Electrical category move. -- v39.16.78: Fixed 「あぁ^~ たまらねぇぜ」 so burst zunchi ignore their spawn overlap with the owner, arm only after clearing the owner once, and unlock on a later fatal return collision including bounce-fence reflections. The renewed achievement audit also fixes ミニマリスト save metadata, サウナ水風呂 hot-entry timing, lethal wire-shock counting, reset-scoped hidden progress cleanup, and 監視カメラ intervention gaps for Undo/Redo and ground changes. -- v39.16.76: Removed the circuit-board OFF constant part and added the 「情報化産業」 achievement for carrying an active signal directly from one circuit board to another over wire or insulated wire. diff --git a/achievement_api.php b/achievement_api.php index 3b7a2c8..cedb961 100644 --- a/achievement_api.php +++ b/achievement_api.php @@ -10,6 +10,7 @@ const ACHIEVEMENT_IDS = [ 'natural_zunchi_slave', 'natural_tarinai_king', 'self_zunchi_death', + 'zunchi_collision_death', 'natural_zunchi_slave_5_generations', 'natural_tarinai_king_3_generations', 'death_50_in_10_seconds', @@ -188,7 +189,7 @@ function normalize_state(mixed $value): array { ]; } foreach ($value['u'] as $achievementId => $flat) { - if (!is_string($achievementId) || (!in_array($achievementId, ACHIEVEMENT_IDS, true) && !in_array($achievementId, ['signal_automation_first', 'link_craftsman'], true)) || !is_array($flat)) continue; + if (!is_string($achievementId) || !in_array($achievementId, ACHIEVEMENT_IDS, true) || !is_array($flat)) continue; $records = []; $count = count($flat); for ($i = 0; $i + 1 < $count; $i += 2) { @@ -210,7 +211,7 @@ function normalize_state(mixed $value): array { } $rawUnlocks = isset($value['unlocks']) && is_array($value['unlocks']) ? $value['unlocks'] : []; foreach ($rawUnlocks as $achievementId => $records) { - if (!is_string($achievementId) || (!in_array($achievementId, ACHIEVEMENT_IDS, true) && !in_array($achievementId, ['signal_automation_first', 'link_craftsman'], true)) || !is_array($records)) continue; + if (!is_string($achievementId) || !in_array($achievementId, ACHIEVEMENT_IDS, true) || !is_array($records)) continue; foreach ($records as $id => $timestamp) { $normalizedId = strtolower((string)$id); if (!isset($players[$normalizedId])) continue; @@ -219,20 +220,6 @@ function normalize_state(mixed $value): array { } } - $legacySignal = isset($unlocks['signal_automation_first']) && is_array($unlocks['signal_automation_first']) - ? $unlocks['signal_automation_first'] : []; - $legacyLinks = isset($unlocks['link_craftsman']) && is_array($unlocks['link_craftsman']) - ? $unlocks['link_craftsman'] : []; - if ($legacySignal && $legacyLinks) { - if (!isset($unlocks['mechanized_industry']) || !is_array($unlocks['mechanized_industry'])) { - $unlocks['mechanized_industry'] = []; - } - foreach ($legacySignal as $playerId => $signalTime) { - if (!isset($legacyLinks[$playerId])) continue; - $unlocks['mechanized_industry'][$playerId] = max((int)$signalTime, (int)$legacyLinks[$playerId]); - } - } - unset($unlocks['signal_automation_first'], $unlocks['link_craftsman']); return ['players' => $players, 'unlocks' => $unlocks]; } diff --git a/app_manifest.json b/app_manifest.json index 3dd37b6..67dee34 100644 --- a/app_manifest.json +++ b/app_manifest.json @@ -1,5 +1,5 @@ { - "version": "39.16.109", + "version": "39.16.137", "css": [ "css/base.css", "css/layout.css", @@ -58,6 +58,7 @@ "js/item_dynamic_duplicator_system.js", "js/item_dynamic_pin_system.js", "js/item_dynamic_zunchi_system.js", + "js/item_environment_hazard_system.js", "js/item_dynamic_system.js", "js/item_lifecycle_decay_system.js", "js/item_lifecycle_growth_system.js", @@ -69,6 +70,7 @@ "js/item_lifecycle_pipeline.js", "js/item_runtime.js", "js/structure_lifecycle.js", + "js/memorial_bell_system.js", "js/item_render_helpers.js", "js/item_render_runtime.js", "js/burn_motion_util.js", diff --git a/assets/sounds/bicycle_bell.mp3 b/assets/sounds/bicycle_bell.mp3 new file mode 100644 index 0000000..6fef91a Binary files /dev/null and b/assets/sounds/bicycle_bell.mp3 differ diff --git a/css/base.css b/css/base.css index 91b9d49..1fbdde1 100644 --- a/css/base.css +++ b/css/base.css @@ -91,6 +91,11 @@ h1 { white-space: nowrap; } + +.speed-select-native { display: none; } +.speed-menu { position: relative; display: inline-block; } +.speed-menu-btn { min-width: 92px; text-align: center; white-space: nowrap; } + .top-actions { display: flex; gap: 6px; diff --git a/css/components.css b/css/components.css index a9ad7fb..75daf0a 100644 --- a/css/components.css +++ b/css/components.css @@ -27,6 +27,9 @@ gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; + position: relative; + z-index: 4; + isolation: isolate; } .favorite-toggle { border: 1px solid rgba(128, 102, 56, 0.32); @@ -34,8 +37,15 @@ background: rgba(255, 248, 221, 0.92); color: #5a4630; font-weight: 700; - padding: 5px 10px; + padding: 7px 12px; cursor: pointer; + position: relative; + z-index: 5; + display: block; + width: 100%; + box-sizing: border-box; + pointer-events: auto; + touch-action: manipulation; } .favorite-toggle.active { background: rgba(255, 229, 122, 0.95); @@ -681,6 +691,10 @@ gap: 5px; } .top-menu-panel.hidden { display: none; } +.speed-menu-panel { width: 116px; min-width: 116px; } +.speed-menu-panel .top-menu-item { text-align: center; } +.speed-menu-panel .top-menu-item.active, +.speed-menu-panel .top-menu-item[aria-checked="true"] { background: rgba(224,242,201,.92); } .top-menu-item { width: 100%; min-height: 38px; diff --git a/css/layout.css b/css/layout.css index c05d30a..d0f4064 100644 --- a/css/layout.css +++ b/css/layout.css @@ -25,6 +25,7 @@ .tool[data-tool="delete"] { --tool-icon-zoom: 1.42; } .tool[data-tool="area_delete"] { --tool-icon-zoom: 1; } .tool[data-tool="pinch"].tool-emoji-icon::before { font-size: 22px; } +.tool[data-tool="bell"].tool-emoji-icon::before { font-size: 21px; z-index: 1; } .tool[data-tool="area_delete"].tool-emoji-icon::before { font-size: 31px; line-height: 1; @@ -125,6 +126,7 @@ box-shadow: 0 1px 4px rgba(42,36,29,0.16); pointer-events: auto; cursor: pointer; + z-index: 4; } .chart-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 3px 0 8px; } .chart-tabs button { border: 1px solid var(--line); background: rgba(255,255,255,0.62); border-radius: 999px; padding: 5px 4px; font-size: 11px; cursor: pointer; } @@ -353,3 +355,7 @@ meter { border-color: rgba(38,132,190,0.56); box-shadow: inset 0 0 0 1px rgba(84,176,226,0.20), 0 8px 20px rgba(59,133,177,0.10); } + +.chart-range-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -2px 0 7px; } +.chart-range-tabs button { border: 1px solid var(--line); background: rgba(255,255,255,0.48); border-radius: 8px; padding: 4px 4px; font-size: 10px; cursor: pointer; color: var(--muted); } +.chart-range-tabs button.active { background: rgba(239,255,222,0.92); border-color: rgba(103,178,44,0.42); color: var(--text); font-weight: 700; } diff --git a/css/panel.css b/css/panel.css index 766acea..762f2c2 100644 --- a/css/panel.css +++ b/css/panel.css @@ -119,6 +119,14 @@ body::before { pointer-events: none; } + +.family-death-time { + display: block; + margin-top: 1px; + font-size: 10px; + line-height: 1.15; + color: rgba(93, 72, 61, 0.76); +} .family-genetic-stats { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -260,8 +268,8 @@ body::before { .lineage-family-tree .tree-node { position: absolute; width: 150px; - height: 104px; - min-height: 104px; + height: 112px; + min-height: 112px; box-sizing: border-box; align-items: flex-start; background: linear-gradient(180deg, #fffdf8, #f8f1e5); @@ -280,6 +288,29 @@ body::before { .lineage-family-tree .tree-node[data-family-tarinai-id]:hover { transform: none; } +.lineage-family-tree.family-hover-active .tree-node.family-hover-dim { + opacity: 0.28; + filter: saturate(0.58); + transition: opacity .12s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease; +} +.lineage-family-tree.family-hover-active .tree-node.family-hover-focus, +.lineage-family-tree.family-hover-active .tree-node.family-hover-parent, +.lineage-family-tree.family-hover-active .tree-node.family-hover-child { + opacity: 1; + filter: none; +} +.lineage-family-tree.family-hover-active .tree-node.family-hover-focus { + border-color: rgba(124, 165, 66, 0.78); + box-shadow: 0 0 0 3px rgba(124, 165, 66, 0.16), 0 5px 13px rgba(64,48,32,0.10); +} +.lineage-family-tree.family-hover-active .tree-node.family-hover-parent { + border-color: rgba(80, 132, 198, 0.72); + box-shadow: 0 0 0 2px rgba(80, 132, 198, 0.14); +} +.lineage-family-tree.family-hover-active .tree-node.family-hover-child { + border-color: rgba(87, 170, 91, 0.72); + box-shadow: 0 0 0 2px rgba(87, 170, 91, 0.14); +} .lineage-family-tree .tree-node .family-portrait { right: 4px; top: 4px; @@ -319,7 +350,7 @@ body::before { /* Restored from the original ZIP: fixed colony graph/legend sizing. */ .colony-card { overflow: visible; min-height: 0; flex: 0 0 auto; } .colony-stats { - grid-template-columns: repeat(2, 1fr); + grid-template-columns: 1fr; margin-bottom: 8px; } .colony-chart { @@ -442,3 +473,12 @@ body::before { line-height: 9px !important; font-size: 6.8px !important; } + +.colony-chart { position: relative; } +.colony-chart-tooltip { position: fixed; z-index: 10020; pointer-events: none; min-width: 112px; max-width: 210px; padding: 7px 8px; border-radius: 9px; border: 1px solid rgba(80,65,48,0.18); background: rgba(255,252,245,0.98); color: #4d443a; box-shadow: 0 4px 14px rgba(64,48,30,0.16); font-size: 10px; line-height: 1.45; transform: none; } +.colony-chart-tooltip.hidden { display: none; } +.colony-chart-tooltip strong { display: block; margin-bottom: 3px; font-size: 10.5px; } +.colony-chart-tooltip-row { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; } +.colony-chart-hover-point { position: absolute; z-index: 5; width: 8px; height: 8px; border: 2px solid #5d8ee6; border-radius: 50%; background: rgba(255,255,255,0.96); box-shadow: 0 0 0 2px rgba(255,255,255,0.7); pointer-events: none; transform: translate(-50%, -50%); } +.colony-chart-hover-point.hidden { display: none; } + diff --git a/index.html b/index.html index 8e2e0bc..6c3a7ec 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,14 @@