Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v1b3x0r/mds

Repository files navigation

MDS — JSON That Talks Back

npm version license types CI API Stability

NPCs that hold grudges. Ghosts that get lonely. JSON files with anxiety.


What Just Happened?

You write this:

{
  "essence": "Lonely ghost",
  "dialogue": {
    "intro": [{ "lang": { "en": "Why am I alone?" } }]
  }
}

Result:

  • Ghost spawns ✅
  • Ghost speaks its dialogue ✅
  • Ghost gets lonelier over time ✅
  • Ghost eventually fades away

You wrote zero code.


Wait, It Speaks?

Yeah. In any language you want.

{
  "dialogue": {
    "intro": [{
      "lang": {
        "en": "You see me, but do you remember me?",
        "th": "เธอเห็นฉัน... แต่เธอจำฉันได้ไหม?",
        "ja": "見えているのか…それとも、思い出しているのか?"
      }
    }]
  }
}

It auto-detects browser language. Falls back to English. No translation library needed.


Wait, It Remembers?

{
  "emotion": {
    "transitions": [
      {
        "trigger": "player.attack",
        "to": "anger",
        "intensity": 0.9
      }
    ]
  },
  "dialogue": {
    "onPlayerAttack": [{
      "lang": { "en": "So you strike your own shadow?" }
    }]
  }
}

What happens:

  1. Player attacks
  2. Entity gets angry (emotion.valence = -0.54)
  3. Entity says the dialogue
  4. Entity remembers being attacked

Forever.


Pick Your Adventure

I Want To... Go Here
🎮 Game NPCs that remember I'm evil Gaming
🏠 Smart home that learns my habits Smart Home
🏫 Simulate ecosystems for school Education
🎨 Art that has emotions Art
📖 Stories where choices matter Storytelling
🔬 Research with reproducible data Research
💻 Code examples (for devs) Advanced

Start here: 3-Minute Overview


Install

npm install @v1b3x0r/mds-core

Or CDN (no install):

<script type="module">
  import { World } from 'https://esm.sh/@v1b3x0r/mds-core'
</script>

Before/After

Normal Code (500 lines)

if (player.near(npc)) {
  if (npc.remembers(player)) {
    if (player.attackedBefore) {
      npc.mood = "angry"
      npc.say(getAngryDialogue(npc.language))
    }
  }
}

Next chapter? NPC forgot everything.

MDS (12 lines of JSON)

{
  "essence": "NPC who remembers violence",
  "emotion": {
    "transitions": [
      { "trigger": "player.attack", "to": "anger" }
    ]
  },
  "dialogue": {
    "onPlayerClose": [{
      "lang": { "en": "I remember what you did." }
    }]
  }
}

Next chapter? NPC still remembers. Forever.


Real Example

See heroblind.mdm — a fully functional entity with:

  • ✅ Multilingual dialogue (EN, TH, JA, ES, ZH)
  • ✅ Emotion triggers (anger, curiosity, fear)
  • ✅ Self-monologue (internal thoughts)
  • ✅ Event-driven responses
  • ✅ Memory of interactions

277 lines of JSON. Zero code.


Who This Is For

Ages 12+ | Minecraft players | Students | Artists | Game devs | Researchers

You don't need to code. Just describe what something IS, and behavior emerges.


Features You Get for Free

When you describe an entity, you automatically get:

🧠 Memory

  • Entities remember interactions
  • Memories decay over time (Ebbinghaus curve)
  • Important events stick longer

💚 Emotion

  • PAD model (Pleasure, Arousal, Dominance)
  • Emotional contagion (entities affect each other)
  • Trigger-based transitions

💬 Dialogue

  • Multilingual support (any language)
  • Event-driven phrases
  • Auto-detects user language

🎓 Learning

  • Entities learn from rewards
  • Skills improve with practice
  • Q-learning built-in

🌍 Physics

  • Entities move based on similarity
  • Info-physics (meaning creates gravity)
  • Environmental effects

💾 Save/Load

  • Full world state serialization
  • Memories survive page refresh
  • Deterministic replay

Links


"I wanted NPCs that remember I quicksaved before killing them. Now they do."

Made in Chiang Mai, Thailand 🇹🇭 | MIT License