dialogue-systems
Fungsinya
Skill ini memandu desain dan penghubungan dialog game dengan cabang, pilihan, dan status yang diingat. Skill ini ditujukan untuk penulis dan pengembang game yang membuat percakapan NPC atau cabang cerita.
Kapan dipakai
- โSaat Anda mendesain percakapan dengan cabang dan pilihan pemain.
- โSaat pilihan sebelumnya harus mengubah apa yang dikatakan karakter nanti.
- โSaat Anda perlu memilih antara Ink, Yarn Spinner, atau format dialog kustom.
Link skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/dialogue-systems/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin percakapan NPC dengan tiga pilihan, di mana salah satu pilihan mengubah cara NPC berbicara nanti. Alat dialog mana yang sebaiknya saya pakai?โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memodelkan percakapan sebagai graf baris dan pilihan, menambahkan kondisi dan variabel, lalu menyarankan Ink, Yarn Spinner, atau runner kustom sederhana sesuai kebutuhan Anda. Setelah itu agent menghubungkan skrip ke loop game Anda.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Dialogue systems
Model conversations as a graph: nodes hold lines, choices branch the flow,
conditions gate options, and variables remember what the player did. The first
real decision is build vs. buy โ adopt a proven authoring tool (Ink or
Yarn Spinner) or write a small data-driven runner. This skill owns both Ink
and Yarn; the visual-novel and rpg genres consume it.
When to use
- Use to design branching conversations, choice menus, or narrative state (flags, relationship values) that affect later dialogue.
- Use to decide between Ink, Yarn Spinner, and a custom JSON/resource format.
- Use to wire a dialogue script into your game loop (advance line, present choices, run commands, resolve variables).
When not to use: for engine UI (text boxes, portraits, choice buttons), use
godot-ui-control or the engine's UI skill. For persisting narrative variables
across sessions, use save-systems. For data-as-resources in Godot/Unity, see
godot-resources / unity-scriptableobjects.
Core workflow
- Choose the authoring approach.
- Ink โ prose-first, writer-friendly, weave/gather flow; great for dialogue-heavy or CYOA narrative. Integrate via ink runtime / inkle plugins.
- Yarn Spinner โ node-based, explicit
<<commands>>, strong for game-driven dialogue with lots of engine hooks. - Custom runner โ a JSON/resource graph + a small interpreter when you need full control or minimal dependencies. Don't build a language; build a graph.
- Define the node contract. A node yields one of: a line (speaker + text), a set of choices, a command/side-effect, or an end/jump. The runner advances through nodes and hands lines/choices to the UI.
- Separate variables from flow. Keep a variable store (booleans, numbers, strings) the dialogue reads/writes; gate choices with conditions over it.
- Localize from the start. Author with line IDs, not raw strings, so the displayed text comes from a string table keyed by locale.
- Drive it from the game loop. The runner is a state machine:
currentnode โ emit content โ wait for input (continue or choice) โ advance. - Verify by walking branches. Exercise each choice path; confirm conditions, variable writes, and that every branch reaches an end or a valid jump.
Patterns
1. Engine-neutral dialogue graph (data, not code)
{
"start": "guard_intro",
"nodes": {
"guard_intro": {
"speaker": "Guard", "line": "DLG_GUARD_001",
"choices": [
{ "text": "DLG_OPT_BRIBE", "to": "bribe", "if": "gold >= 50",
"set": { "gold": "gold - 50" } },
{ "text": "DLG_OPT_LEAVE", "to": "end" }
]
},
"bribe": {
"speaker": "Guard", "line": "DLG_GUARD_BRIBED",
"set": { "gate_open": true },
"next": "end"
},
"end": { "end": true }
}
}
line/text are string-table IDs (localization), not literal text. if
gates a choice; set mutates the variable store. The gold cost sits on the
choice, so it is paid once per pick even if the bribe node is revisited; the
idempotent gate_open write can live on the node. A string set value is an
expression, so a literal string needs inner quotes: "mood": "'angry'". The full
interpreter that walks this graph is in references/runner.md.
2. Runner step (a state machine over the graph)
# Godot 4.7. The runner holds the current node and a variable store. Every line
# waits for the player: the UI calls choose() or the continue callback.
func goto(id: String) -> void:
current = graph.nodes[id]
apply_set(current.get("set", {}))
if current.get("end", false):
ui.close()
return
if current.has("line"):
ui.show_line(current.get("speaker", ""), localize(current.line))
if current.has("choices"):
var shown = current.choices.filter(func(c): return eval_cond(c.get("if", "")))
ui.show_choices(shown) # only choices whose condition passes
elif current.has("next"):
var next_id: String = current.next
ui.show_continue(func(): goto(next_id)) # advance when the player continues
func choose(choice: Dictionary) -> void: # called when the player picks a choice
apply_set(choice.get("set", {})) # write on the transition (revisit-safe)
goto(choice.to)
3. Ink โ branching with knots, choices, and variables (inkle)
// Ink: '*' = once-only
Pertanyaan umum
Apakah saya harus membuat sistem dialog sendiri?
Skill menyebutkan bahwa keputusan pertama adalah membangun atau membeli, dan menyebut alat yang sudah terbukti sebagai pilihan umum.
Apakah ia mencakup kotak dialog dan tombol?
Tidak. Skill UI engine mencakup itu, sedangkan skill ini mencakup logika percakapan.
Apakah ia menyimpan flag naratif?
Menyimpan flag tersebut antar sesi termasuk skill sistem penyimpanan.
Detail
Deskripsi asli dari pembuat
Build branching dialogue and narrative โ a node/choice graph with conditions, variables, and localization hooks โ and choose between authoring tools Ink and Yarn Spinner or a custom data-driven runner. Engine-neutral. Use when the user mentions dialogue system, branching dialogue, conversation tree, choices, Ink (.ink), Yarn Spinner (.yarn), or NPC dialogue.
Popularitas
- Bintang GitHub
- 6.6k
- Peringkat
- #13795
- Lisensi
- Apache-2.0
- Diperbarui
- 28/10/2026
Komentar
- โฆ
Skill lain dari repositori ini
router
6.6kMembantu agent Anda memilih skill pengembangan game yang tepat untuk setiap permintaan dengan mendeteksi engine Anda dan jenis tugas yang Anda perlukan.
ai-behavior-trees-utility-ai
6.6kMembantu agent Anda membangun behavior tree dan sistem utility AI untuk musuh dan karakter game yang memilih aksi berdasarkan prioritas dan skor.
audio-design
6.6kMengajari agent Anda cara mixing audio game: bus, volume dalam desibel, ducking di bawah dialog, musik adaptif, dan variasi efek suara.
camera-systems
6.6kMembantu agent Anda membangun kamera game yang mengikuti dengan halus, tetap berada di dalam level, dan dapat mengorbit atau melihat sekeliling dalam 3D.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.