// ENIGMA Space — interactive elements // ===== 12-layer canonical order ===== const layers = [ { num: 0, name: 'Authoring → Compiler', desc: 'Human description → semantic reconstruction → structured dossier → validation → materialization in stores.', detail: 'Biography becomes Identity / Origin Events / History / Relationships / Drives / Desires / Roles / Beliefs / Memory Seeds with provenance. LLM translates, Python validates and writes.' }, { num: 1, name: 'Identity / History', desc: 'origin_events → canonical NPC history → EventMemory / Chronicle / role history / relationship history.', detail: 'The NPC\'s past exists in the game as simulation data, not just as text.' }, { num: 2, name: 'Body → Need', desc: 'Body state, needs, sleep, hunger — and their real consumers.', detail: 'NPC states have causal consequences, not decorative numbers.' }, { num: 3, name: 'Desire → Object → Activity', desc: 'Existing Desire / Activity / Object mechanisms unified into a single circuit.', detail: 'NPC does not just "have a need" — it wants something, has a goal/object, and chooses an activity.' }, { num: 4, name: 'Decision → Action → Outcome', desc: 'CAN ≠ WANT ≠ INTEND ≠ ATTEMPT ≠ SUCCESS. TAKE/USE/MOVE/GIVE/FOLLOW and consequences.', detail: 'NPC decision changes the world; the result returns to state/memory.' }, { num: 5, name: 'Perception → Experience → Memory', desc: 'Perception membrane, personal experience, chronology, event_id, bounded recall, provenance.', detail: 'NPC knows only what it had the opportunity to perceive or learn.' }, { num: 6, name: 'Salience → Consolidation', desc: 'Event significance for a specific NPC → decay → consolidation → compression → deterministic distortion.', detail: 'Memory becomes selective: the important lives longer, the old may compress or distort.' }, { num: 7, name: 'Relationships as History', desc: 'RelationshipEvent → repeated interactions → relationship changes → social consequences.', detail: 'A relationship is a consequence of history, not a standalone magical scalar.' }, { num: 8, name: 'Belief → Expectation → Decision', desc: 'BC-2…BC-7: experience/testimony → belief → conclusion → expectation → decision.', detail: 'NPC acts according to its own picture of the world, not directly according to WORLD TRUTH.' }, { num: 9, name: 'NPC as Interface', desc: 'Targeted recall, biography, provenance, epistemic divergence, investigation loop, grounding, ignorance.', detail: 'The player learns the world\'s complexity through the NPC, not through panels and hidden coefficients.' }, { num: 10, name: 'Self-Interpretation', desc: 'WHAT HAPPENED ≠ WHAT REMEMBERS ≠ WHAT BELIEVES ≠ HOW EXPLAINS.', detail: 'NPC may not understand its own motives, may be wrong, may rationalize, may explain itself differently.' }, { num: 11, name: 'Appraisal / Prediction / Humor', desc: 'Expectation → prediction error → appraisal → individual reactions / humor.', detail: 'Behavior depends not only on the fact of an event, but on how unexpected or significant it is for the NPC.' }, { num: 12, name: 'Deception', desc: 'KNOWLEDGE → INTENTION TO DECEIVE → FALSE CLAIM → NARRATION.', detail: 'NPC can consciously lie; a lie is distinguishable from ignorance, memory error, delusion, or refusal to disclose.' }, ]; const layersGrid = document.getElementById('layersGrid'); if (layersGrid) { layers.forEach(layer => { const card = document.createElement('div'); card.className = 'layer-card'; card.innerHTML = ` LAYER ${String(layer.num).padStart(2, '0')}
${layer.name}
${layer.desc}
${layer.detail}
`; card.addEventListener('click', () => { card.classList.toggle('expanded'); }); layersGrid.appendChild(card); }); } // ===== Causal chain ===== const chainNodes = [ { name: 'EVENT', desc: 'World tick produces a change' }, { name: 'PERCEPTION', desc: 'Membrane filters by clarity/LOS/sound' }, { name: 'ENCODING', desc: 'EventMemory written with perspective' }, { name: 'CONSOLIDATION', desc: 'Salience-weighted decay & compression' }, { name: 'RETRIEVAL', desc: 'Cue-driven, bounded, by-subject' }, { name: 'RECONSTRUCTION', desc: 'Validated narrative with hedging' }, { name: 'BELIEF', desc: 'Crystallized with evidence linkage' }, { name: 'EXPECTATION', desc: 'Per-source prediction' }, { name: 'DECISION', desc: 'Utility reducer with modifiers' }, { name: 'ACTION', desc: 'TAKE/USE/MOVE/GIVE/FOLLOW' }, { name: 'OUTCOME', desc: 'World change persists' }, { name: 'CONSEQUENCE', desc: 'Feeds back to memory & belief' }, ]; const chain = document.getElementById('causalChain'); if (chain) { chainNodes.forEach((node, i) => { const el = document.createElement('div'); el.className = 'chain-node'; el.innerHTML = `${node.name}${node.desc}`; chain.appendChild(el); if (i < chainNodes.length - 1) { const arrow = document.createElement('div'); arrow.className = 'chain-arrow'; arrow.textContent = '→'; chain.appendChild(arrow); } }); } // ===== Smooth scroll for anchor links ===== document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { const target = document.querySelector(this.getAttribute('href')); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // ===== Lazy reveal on scroll ===== const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, { threshold: 0.1 }); document.querySelectorAll('.section').forEach(section => { section.style.opacity = '0'; section.style.transform = 'translateY(20px)'; section.style.transition = 'opacity 0.5s ease, transform 0.5s ease'; observer.observe(section); });