yay
- JavaScript 91.2%
- CSS 6.3%
- HTML 1.5%
- Python 1%
| assets | ||
| css | ||
| docs | ||
| js | ||
| .htaccess | ||
| index.html | ||
| PATCH_NOTES.md | ||
| README.md | ||
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 Agent state, AI, disease state, eating, conflict, reproduction, draw.
js/world.js World update, placement, weather, logs, global interactions.
js/ui.js Input, tool selection, dialogs, observation panel.
js/ui_charts.js Population/statistics charts.
js/ui_family.js Family/archive UI and cause-of-death display.
docs/AI_CONTEXT.md Minimal implementation context for AI edits.
docs/code_map.md Symbol-to-file lookup table.
Edit rules
- Preserve zero-build script order. Add new JS files explicitly in
index.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