Skip to content

Dialog and Quest framework - #198

Merged
Adubbz merged 3 commits into
TheMoonPeople:masterfrom
SirFancyBacon:ui-dialog-framework
Oct 19, 2026
Merged

Adubbz merged 3 commits into
TheMoonPeople:masterfrom
SirFancyBacon:ui-dialog-framework

Conversation

@SirFancyBacon

@SirFancyBacon SirFancyBacon commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

A Dialog and quest framework to allow for easier native implementations of custom menus, Dialog trees, custom shop menus, item rewards.

Summary

Adds a menu to villager conversations, a quest system built on it, and two pieces of content that use them.

  • Dialog framework (Dialog::). A villager that a quest adds choices to opens on a menu: Talk, the added choices, Never mind. It is drawn in the game's own speech bubble, and Talk hands back to the retail conversation unchanged. Villagers with nothing added are untouched.
  • Quest framework (Quest::). Quests are state machines (stages, rules, conditions, NPC choices) written as C++ modules in port/src/quests/. Progress is saved as quests.json beside each save and the autosave, reset on a new game and deleted with its save.
  • Custom shops. A quest can open the retail shop screen with its own goods, prices and lines, with the speaking villager behind the counter. Retail shops are untouched; buying prices are laid over for the visit only.
  • Item received. A quest can play the town's own "Toan gets an item" scene.
  • Mayor's supplies. The Norune Mayor no longer restocks Tasty Water, Bread, Repair Powder, Escape Powder and Antidote Drink by himself. It is now "Do you have any supplies?" in his menu, on the same terms: after the first trip into Divine Beast Cave, until Gaffer's Buggy is built.
  • Carl's Slingshot, an example sidequest. It opens once Xiao has joined: Gina won't return Carl's slingshot, the player goes back and forth between the two, and Carl ends up giving the Bone Slingshot to Xiao.

Notes for reviewers

  • Retail behaviour change: the Mayor's automatic restock now happens only through his menu choice.
  • New PORT_OVERRIDEs: EdTalkModeInit, EdTalkMode, EdNowTalkChara, EdNowTalkCharaInfoID, PlayerAllItemCheck, GetItemShopList, ItemShopGetPacFileName, ItemShopGetImgFileName, ClsMes::GetTextLineDataTop.
  • UI::Label::KeepGameRandom added, so text the port lays out does not advance the game's random numbers.
  • Debug switch: DC_DIALOG_TEST=1 adds a "Who are you?" choice showing a villager's map, villager and message numbers, and traces quest shops to stderr.
  • Docs: docs/DIALOG_FRAMEWORK.md and docs/QUEST_FRAMEWORK.md.

Testing

  • Unit tests: dialog_framework_test, quest_framework_test, custom_shop_test.
  • In game: conversation menu and speech bubble, Mayor's supplies, custom shop with the Mayor behind the counter and his own lines.
  • In game: Carl's Slingshot from start to finish, including the item-received scene.
  • In game: speech bubbles over the speaking villager; choice menu without the greeting line.

Known issues

  • The mouse does not work in the conversation menu; It doesn't in vanilla either...
  • Quest lines in other languages are AI generated.

@Adubbz
Adubbz merged commit 6ec3b80 into TheMoonPeople:master Oct 19, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants