yay
  • JavaScript 91.2%
  • CSS 6.3%
  • HTML 1.5%
  • Python 1%
Find a file
2026-07-15 14:44:29 +09:00
.achievement_data p 2026-07-15 14:44:29 +09:00
assets h 2026-06-30 10:57:06 +09:00
css p 2026-07-15 14:44:29 +09:00
js p 2026-07-15 14:44:29 +09:00
scripts p 2026-07-15 14:44:29 +09:00
.gitignore hmm 2026-06-24 17:39:44 +09:00
.htaccess p 2026-07-15 14:44:29 +09:00
achievement_api.php p 2026-07-15 14:44:29 +09:00
AI_MAP.md p 2026-07-15 14:44:29 +09:00
app_manifest.json p 2026-07-15 14:44:29 +09:00
BUILD_NOTE.txt p 2026-07-15 14:44:29 +09:00
favicon.ico hhmm 2026-06-25 17:43:24 +09:00
FILES.json p 2026-07-15 14:44:29 +09:00
GAME_FEATURES.md p 2026-07-15 14:44:29 +09:00
index.html p 2026-07-15 14:44:29 +09:00
README.md p 2026-07-15 14:44:29 +09:00
service-worker.js p 2026-07-15 14:44:29 +09:00

tarinai_

AI-first entrypoint for a static browser simulation/game. Keep this file small; read deeper docs only when needed.

Read Strategy

  • Start here for architecture, script order constraints, and where to look next.
  • For game mechanics, UI, items, and tarinai behavior, read GAME_FEATURES.md.
  • For subsystem work, read AI_MAP.md plus only the matching files.
  • For exact file inventory, run powershell -NoProfile -ExecutionPolicy Bypass -File scripts/ai_inventory.ps1 -All or narrow it: powershell -NoProfile -ExecutionPolicy Bypass -File scripts/ai_inventory.ps1 ui. Python equivalent: python scripts/ai_inventory.py --all.
  • For machine-readable routing, read FILES.json.
  • Avoid loading all assets into context; asset filenames are mostly self-describing and grouped by glob.

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.56.
  • 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.
  • Generated/static app shell: app_manifest.json, service-worker.js, FILES.json, and js/version.js must stay version-aligned.

File Routing

  • index.html: DOM shell, CSS/JS load order, panels/dialogs/canvas.
  • css/*.css: base/layout/panel/components/mobile styling.
  • js/domain_ids.js, js/item_type_catalog.js, js/data.js, js/ground_types.js: stable domain ids, current item-type save catalog, core config, field/ground definitions.
  • js/world*.js: world state, view, update phases, tools, placement, combat, environment, family/social, ants.
  • js/tarinai*.js: creature state, needs, actions, behavior, social life, item effects, update pipeline, rendering.
  • js/item*.js, js/structures*.js: item registry/runtime/lifecycle/dynamic behavior/rendering plus structures.
  • js/simulation*.js, js/system_order.js, js/sim_core.js: concrete update systems and phase ordering.
  • js/ui*.js, js/text_catalog.js, js/command_dispatcher.js: DOM UI, input, selected panel, logs, charts, family tree, tools, labels.
  • js/save*.js, js/snapshot_system.js, js/restore_coordinator.js, js/history_system.js: persistence and history.
  • js/physics*.js, js/mechanical_system.js, js/constraint_system.js, js/collision_footprint_system.js: geometry, mechanics, constraints, collisions.
  • assets/sprites/tarinai_*.webp: creature state sprites.
  • assets/ui/tool_*: tool palette icons; other assets/ui/* are app/help icons.
  • assets/objects/*: field object images.
  • assets/sounds/*: voice and SFX samples.
  • scripts/*: generators, regression checks, and AI inventory.

Conventions

  • *_pipeline = ordered runner/facade.
  • *_step_* = pipeline stage wrapper.
  • *_system = domain service or compatibility facade.
  • *_runtime = stable runtime-facing facade.
  • *_registry = definition lookup/normalization.
  • Many split files preserve regression contracts; do not collapse them casually.

Checks

  • Syntax: node --check js/*.js
  • Regression: python scripts/regression_check.py
  • 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.56)

  • Fifty-one 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, 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.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 adds two more achievements, persistent fight progress, stricter robot-only evaluation, revised thresholds, and unlocked-card rate bars.
  • 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 v2 arrays, with transparent reading/migration of the prior verbose format, and is protected by Apache rules.
  • 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 fifty-one 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.