yay
- JavaScript 91.2%
- CSS 6.3%
- HTML 1.5%
- Python 1%
| assets | ||
| css | ||
| docs | ||
| js | ||
| scripts | ||
| .htaccess | ||
| app_manifest.json | ||
| index.html | ||
| PATCH_NOTES.md | ||
| README.md | ||
| service-worker.js | ||
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.
Codex operating model
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.
Core simulation
- Entities:
Tarinaiagents 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.
Important mechanics
- 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 suyakuin 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.
Diseases
- 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.
Tools and items
- 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.
File map
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 Tarinai constructor/core state only.
js/tarinai_identity_social.js Agent identity, records, personality, relations, stress/damage wrappers.
js/tarinai_disease_nest.js Diseases, water effects, nest-box entry/exit.
js/tarinai_needs_items.js Needs AI, eating/drinking, item interaction, facing, zunchi behavior.
js/tarinai_social_move_life.js Social interaction, movement, life/death.
js/tarinai_render.js Agent drawing and hit testing.
js/world.js World constructor/core state only.
js/world_view.js Field scale, camera, viewport, tool sizing, time/phase helpers.
js/world_family_social.js Family tree, birth, fights, social conflict entry points.
js/world_combat_effects.js Damage, explosions, water hose, effects, balls, collision outcomes.
js/world_environment.js Obstacles, fences, grass placement, temperature, nearest queries.
js/world_spatial_budget.js Spatial grid, draw list, budgets, compaction, performance helpers.
js/world_ants_system.js Ant updates, nest haul/founding, queen spawning.
js/world_update.js Main world update, weather, out-of-bounds sanitation, pointer info.
js/world_placement_log.js Placement, click handling, log classification/dispatch.
js/world_bootstrap.js Creates global `world` after World mixins load.
js/ui.js UI state/cache references only.
js/ui_log.js Log rendering, push notification controls, sound setting sync.
js/ui_selected.js Selected Tarinai data panel and text formatting.
js/ui_layout_dialogs.js Canvas resize, dialogs, field switching, top buttons.
js/ui_tools.js Tool size badges and tool size cycling.
js/ui_bind.js Event listeners and input binding.
js/ui_charts.js Population/statistics charts.
js/ui_family*.js Family/archive data, async build, layout, paths, render.
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.htmlbefore dependents. - Keep global symbols intentional; this codebase is not ESM.
- Prefer catalog/config/helper extraction over adding large inline blocks to
index.htmlortarinai.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
eventswas removed.environmentnow 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
15.18.0
- イベントUI下部にログ種別別のプッシュ通知設定を追加。ON時は左下最前面に通知表示
- 巣がなくなったアリは空きのある別巣へ所属変更。空き巣がない場合は死亡せず彷徨う
- 女王アリを大きめに表示
- 画像アセットをWebP化し、参照をWebPへ切り替え
- Service Workerによる静的アセットキャッシュを追加し、indexのno-cache指定を解除
効果音差し替え
v15.18.0以降、js/audio.js の samplePaths に sfx_genkotsu_impact などの音IDとファイルパスを追加すると、内蔵の仮SEよりその音源が優先されます。ID一覧は docs/SOUND_IDS.md を参照してください。
15.18.0
- プッシュ通知の保存キーを更新し、初期状態はOFFに戻した。
- 効果音設定は右上の音設定で、操作音・通知音のみデフォルトON、たりないの声はデフォルトOFFに変更。
- 操作音と通知音の内蔵仮SE音量を大幅に増加。
- つまむ操作でたりないデータカードが開く挙動を修正。
- 道具から配置する全オブジェクトで配置音が鳴るよう、placeItem側に配置音を統合。
- イベントUI折り畳み時の高さを圧縮。
15.18.0
- 効果音の仮SE音量を再度引き上げ。
- イベントUI内の効果音設定を廃止し、右上の音設定メニューへ統一。
- イベントログ欄が上下端に達した時、右メニュー全体へスクロールを受け渡すよう修正。
15.18.0 内部システム更新
- バージョン/キャッシュ管理、イベントバス、PerformanceManager、地形dirtyキャッシュ、拡張SpatialGrid、デバッグモードを追加しました。
?debug=1をURLに付けるとFPS/負荷レベル/エンティティ数/イベント履歴を確認できます。- 詳細は
docs/INTERNAL_SYSTEMS.mdを参照してください。
v15.18.0 個体効果アイテム
- 下剤、プロテイン、ンイテロプ、弾薬、怪しい薬を追加。
- たりないデータの「現在のアイテム効果」で、永続効果と残り時間つき効果を確認できます。
v15.18.0 internal maintenance
- Static loading order is centralized in
app_manifest.json. - Run
python3 scripts/generate_app_files.pyafter adding/removing CSS or JS files. - Sound replacement is centralized in
js/sound_pack.js. - Item/disease effect metadata is centralized in
js/effect_registry.js.
v15.19.1
- 効果音のマスター出力、カテゴリ別ゲイン、ID別ゲインを再調整。連続再生で小さくなりにくいよう同時発音上限とWeb Audio出力経路を変更。
- 食べ物の自然消耗を連続減少から半日に2回程度の離散消耗へ変更。衛生統計ペナルティも同じタイミングに抑制。
- 薬系アイテムの地面表示とUIアイコンを錠剤風に変更。
- プロテイン/ンイテロプの外観を山盛りの粉に変更。永続効果中は継続的なオーラ/粒子エフェクトを表示。
- ずんだ汁を緑の水滴外観へ変更。雨と水滴表示は灰色寄りへ変更。
- バージョンとService Workerキャッシュを 15.19.1 に更新。
v15.19.1
- 新アイテム系スプライト/道具アイコンから文字表示を削除。
- 爆竹配置時に爆発音が鳴る問題を修正。
- 巨大薬/矮小薬の設置サイズを視覚的に差別化。
- 水銀/ずんだ汁/水滴を降雨の水滴表現に合わせて再描画。
- プロテイン/ンイテロプの永続演出を粒子表現へ変更。
- 統計タブの「生活」表記残りを「精神」に修正。