Skip to content

Tutorial: Refactor NPC (Arun) to shared scene#2229

Merged
manuq merged 1 commit into
mainfrom
wjt/tutorial-refactor-npc-arun-to-shared-scene
May 20, 2026
Merged

Tutorial: Refactor NPC (Arun) to shared scene#2229
manuq merged 1 commit into
mainfrom
wjt/tutorial-refactor-npc-arun-to-shared-scene

Conversation

@wjt
Copy link
Copy Markdown
Member

@wjt wjt commented May 20, 2026

Previously each instance of the NPC guide (1-2 per scene of the
tutorial) was an instance of
scenes/game_elements/characters/npcs/townie.tscn, configured with the
same seed, and then further customised to vary his behaviour per-scene.

His behaviours across all the scenes are simple: you can talk to him,
and in response to some external event he walks along a path.

Add a scene and script that contain TalkBehavior, PathWalkBehavior, and
a small number of properties and a method to customise what he says and
where he walks.

Adjust all the tutorial scenes to use this common scene, reducing a lot
of duplication.

Fix the interact marker position to be above his head. This wasn't worth
doing 8 times across 6 scenes but is worth doing for one instance of
him!

Take this opportunity to fix some folder names and scene filenames, and
relocate the ruined house to a shared folder.

I also couldn't resist adding a way to grapple back to the starting
island so you can loop round again and collect any buttons you may have
missed.

@wjt wjt requested a review from a team as a code owner May 20, 2026 10:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Test build no longer available.

@wjt
Copy link
Copy Markdown
Member Author

wjt commented May 20, 2026

I also couldn't resist adding a way to grapple back to the starting island so you can loop round again and collect any buttons you may have missed.

@saspiers Try this: https://play.threadbare.game/branches/endlessm/wjt/tutorial-refactor-npc-arun-to-shared-scene/#res://scenes/quests/lore_quests/quest_000/6_grappling/tutorial_grappling.tscn

Previously each instance of the NPC guide (1-2 per scene of the
tutorial) was an instance of
scenes/game_elements/characters/npcs/townie.tscn, configured with the
same seed, and then further customised to vary his behaviour per-scene.

His behaviours across all the scenes are simple: you can talk to him,
and in response to some external event he walks along a path.

Add a scene and script that contain TalkBehavior, PathWalkBehavior, and
a small number of properties and a method to customise what he says and
where he walks.

Adjust all the tutorial scenes to use this common scene, reducing a lot
of duplication.

Fix the interact marker position to be above his head. This wasn't worth
doing 8 times across 6 scenes but is worth doing for one instance of
him!

Take this opportunity to fix some folder names and scene filenames, and
relocate the ruined house to a shared folder.

I also couldn't resist adding a way to grapple back to the starting
island so you can loop round again and collect any buttons you may have
missed.
@wjt wjt force-pushed the wjt/tutorial-refactor-npc-arun-to-shared-scene branch from 68ff4bf to 87540bb Compare May 20, 2026 10:25
Copy link
Copy Markdown
Collaborator

@manuq manuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I love that Arun now can recognize if you picked all the buttons or not.

Comment on lines +33 to +35
dialogue = dialogue
dialogue_title = dialogue_title
path = path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@manuq manuq merged commit dabff01 into main May 20, 2026
7 checks passed
@manuq manuq deleted the wjt/tutorial-refactor-npc-arun-to-shared-scene branch May 20, 2026 14:19
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