{"slug": "how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0", "title": "How nice it is to talk — BeeDialogue lands in BeeEngine 2.11.0", "summary": "Antonio, a 53-year-old independent developer, released BeeEngine 2.11.0, adding BeeDialogue, a dialogue-tree plugin for his open-source 2D HTML5 Canvas engine. The plugin handles speakers, lines, branching choices and straight-line advances, attaches through the engine's plugin contract without monkey-patching the loop or update/render methods, and has no tick or DOM listeners of its own — scenes call handleInput and draw directly. It supports optional localization via BeeLocale, emits change events for start, node, choice, advance and end, and can serialize tree state through toJSON/fromJSON for saving.", "body_md": "Hi. I'm Antonio. I'm 53. I build things out of pure passion.\n\nI don't talk much. But when I do… **BeeDialogue** comes out.\n\nBeeEngine is a small 2D HTML5 Canvas engine I keep shaping in the open. Physics, scenes, sprites, tiles, audio buses, an inventory plugin, a locale plugin. Useful pieces. Quiet pieces.\n\nWhat was missing for story-shaped games was obvious: a place for NPCs to say something without me inventing a new `if` tree every weekend.\n\nSo **v2.11.0** adds **BeeDialogue**.\n\nNot a chatbot. Not a voice synthesizer. A dialogue *tree*: speakers, lines, branching choices, straight-line advances. The kind of thing you wire to a blue rectangle that pretends to be a guide on a bridge.\n\nBeeEngine has a plugin contract I take seriously. The core does not import plugins. A plugin attaches itself.\n\n``` js\nimport { BeeEngine } from 'beeengine';\nimport { BeeDialogue, BeeLocale } from 'beeengine/plugins';\n\nconst game = new BeeEngine('c', 800, 480);\nconst locale = new BeeLocale({ /* strings… */, engine: game });\n\nconst dialogue = new BeeDialogue({ engine: game, locale, cancelKey: 'Escape' });\n// attach() registers it as 'dialogue' — detach() unregisters\n```\n\nNo monkey-patch of `loop()`. No hijacking of `update` / `render`. BeeDialogue has **no tick of its own** and no DOM listeners. Your scene calls the verbs:\n\n`handleInput(input)` from `scene.update`\n`draw(ctx)` from `scene.draw` (screen space, after the camera)\nThe motor stays a motor. The plugin stays a plugin. I sleep better.\n\nYou `load` a tree once. Nodes can be an array (easier to skim) or a map. Literal `text` / `speaker` work. Or `textKey` / `speakerKey` if you pass an optional **BeeLocale** (constructor, `setLocale`, or `engine.plugin('locale')`).\n\n```\ndialogue.load({\n  start: 'intro',\n  nodes: [\n    {\n      id: 'intro',\n      speakerKey: 'guide',\n      textKey: 'hi',\n      choices: [\n        { textKey: 'ask_map', next: 'map', data: { topic: 'map' } },\n        { textKey: 'bye', next: null, data: { topic: 'bye' } }\n      ]\n    },\n    { id: 'map', speakerKey: 'guide', textKey: 'map', next: 'tip' },\n    { id: 'tip', speakerKey: 'guide', textKey: 'tip' }\n  ]\n});\n```\n\nRules that saved me from myself:\n\n`choices` → `advance()` follows `next` (or ends).`choose(index)`.` false` and warns. Good. I need warnings more than cleverness.`start()` while already open does a clean restart (`end` with reason `restart`, then `start` again).\nBeeDialogue is not `BeeText.drawHUD`. It draws a simple panel when you ask.\n\n``` js\nconst scene = {\n  update(_dt, input) {\n    if (input.wasPressed('KeyE') && !dialogue.isOpen()) dialogue.start();\n    dialogue.handleInput(input); // Space / Enter advances or confirms; arrows move the highlight\n  },\n  draw(ctx) {\n    dialogue.draw(ctx, { x: 40, width: ctx.canvas.width - 80 });\n  }\n};\n```\n\n`onChange` reports `start`, `node`, `choice`, `advance`, and `end` (with a `reason`: `finished`, `cancel`, `restart`, `reload`, `missing-node`…). Enough to feed a future quest plugin without hard-wiring anything today.\n\nAnd yes — `toJSON` / `fromJSON` save the tree and where you stood, so you can tuck the DTO into `BeeSave` next to inventory slots. Definitions stay yours; restore reopens on the saved node and emits `node` (not a fake second `start`).\n\nThe demo is `examples/dialogue.html`. Press **E**.\n\nThe English string does **not** say “E to talk”.\n\nIt says **“E to interact”**.\n\nBecause BeeDialogue does not talk. It does not clear its throat. It does not do regional accents. It advances nodes. The joke writes itself, and I left it in the locale table on purpose (`talk: 'E to interact'`). Press **L** if you want Italian. The guide still will not speak aloud. She will, however, mention a village east of a bridge, which is already more social than most of my week.\n\nI like small contracts:\n\n| Piece | Job | \n|---|---|\n| BeeLocale | `t(key)` — pure read | \n| BeeInventory | stacks, use, equip — no draw loop | \n| BeeDialogue | tree state — you draw and feed input | \n\nTogether they feel like a tiny RPG toolkit without pretending to be one. Next ideas on the shelf (one at a time): Quest, Post FX, scene Transition, action remapping… Lights, Spine, Net later. Those touch more surface area. Dialogue was the polite guest who hangs its coat on `attach` and leaves with `detach`.\n\n`beeengine` `examples/dialogue.html`\n`node scripts/test-beedialogue.mjs`\n`import { BeeDialogue } from 'beeengine/plugins'`\nIf you break it, tell me how. If you use it in a jam game with three lines of dialogue and a torch tip, tell me that too. Short messages welcome — I don't talk much.\n\nBut when I do… you already know what comes out.\n\n— Antonio", "url": "https://wpnews.pro/news/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0", "canonical_source": "https://dev.to/antonioprosperi2svg/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2110-cad", "published_at": "2026-11-01 11:03:43+00:00", "updated_at": "2026-11-01 11:22:15.622456+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Antonio", "BeeEngine", "BeeDialogue", "BeeLocale", "BeeInventory", "BeeSave"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0", "markdown": "https://wpnews.pro/news/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0.md", "text": "https://wpnews.pro/news/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0.txt", "jsonld": "https://wpnews.pro/news/how-nice-it-is-to-talk-beedialogue-lands-in-beeengine-2-11-0.jsonld"}}