Skip to content

A clean, fast narrative scripting language for branching dialogue and interactive stories. Designed for writers & devs — simple syntax, instant parsing, seamless integration.

License

Notifications You must be signed in to change notification settings

snowfrogdev/bobbin

Repository files navigation

Bobbin Logo

Bobbin

A clean, readable scripting language for branching dialogue and interactive stories.
Built for game developers. Ships with first-class Godot support.

CI Release Godot 4.3+ Ask DeepWiki

WARNING: Bobbin is in early development... You should expect:

  • Some features may be missing or incomplete
  • Documentation is sparse
  • There may be breaking changes between releases
  • The API is not yet stable

Example

extern player_name
save met_merchant = false
temp discount = 0

Welcome to the Brass Lantern, {player_name}!

- Browse wares
    set met_merchant = true
    The merchant spreads out their goods.
    - Buy healing potion (10 gold)
        temp price = 10
        set discount = 2
        You hand over {price} gold coins.
        Here's a little something extra for a first-time customer.
    - Just looking
        No problem, take your time.
    Come back anytime!

- Ask about rumors
    The merchant leans in close...
    Heard there's treasure in the old ruins.

Farewell, {player_name}. Your discount: {discount} gold.

Features

  • Writer-friendly syntax — No boilerplate, just dialogue and choices
  • Smart variable scopingsave persists across sessions, temp lives for the scene, extern reads from your game
  • Nested branching — Unlimited nesting depth with automatic gather points
  • String interpolation — Embed variables directly in dialogue with {variable}
  • Rich error messages — Rust-quality diagnostics that point to exactly what went wrong
  • Fast & lightweight — Rust-powered runtime, instant parsing
  • Cross-platform — Linux, Windows, macOS, and WASM (web exports)

Godot

Installation

  1. Download the latest release from GitHub Releases
  2. Extract the addons/ folder into your Godot project root
  3. Enable the plugin in Project → Project Settings → Plugins

Quick Start

# Create runtime with extern variables
var host_state = { "player_name": "Ada" }
var runtime = BobbinRuntime.from_string_with_host(script_content, host_state)

# Main dialogue loop
while runtime.has_more():
    runtime.advance()
    print(runtime.current_line())

    if runtime.is_waiting_for_choice():
        var choices = runtime.current_choices()
        for i in choices.size():
            print("  %d. %s" % [i + 1, choices[i]])
        runtime.select_choice(0)  # Pick first choice

What's Next

  • Conditional content display
  • Character/speaker management
  • Localization support
  • Event triggering/callbacks
  • Language Server Protocol (LSP) support for Godot and VSCode

Contributing

See CONTRIBUTING.md for development setup and guidelines.

About

A clean, fast narrative scripting language for branching dialogue and interactive stories. Designed for writers & devs — simple syntax, instant parsing, seamless integration.

Resources

License

Contributing

Stars

Watchers

Forks