Skip to content

Add scripts to make a pruned “StoryQuest Kit” bundle - #2576

Open
wjt wants to merge 1 commit into
mainfrom
wjt/sqckck
Open

Add scripts to make a pruned “StoryQuest Kit” bundle#2576
wjt wants to merge 1 commit into
mainfrom
wjt/sqckck

Conversation

@wjt

@wjt wjt commented Jul 21, 2026

Copy link
Copy Markdown
Member

Rather than having Core: Threadbare participants start from a fork of
the entire repo, we want to try giving participants a stripped-down copy
of the project - specifically with all LoreQuests and other StoryQuests
removed. The goals are manifold:

  • Reduce the cognitive burden of navigating a large project.

  • Reduce the need to take special steps to deep link to a StoryQuest for
    testing: the team's StoryQuest should be launched from the title
    screen.

  • Reduce the number and size of the files in the project, saving
    electrons and helping with performance in Backstitch.

  • Move us towards a model where rather than expecting that all
    storyquests will be merged upstream (requiring learners to take
    special care to only modify files in their folder, increasing
    complexity; and hitting human scalability cliffs in the form of there
    only being two full-time maintainers of the game reviewing StoryQuest
    submissions) we instead treat them more as stand-alone games. For the
    ones we choose to merge upstream, we can do the necessary work to
    confine them to their own folder at that point; and you could imagine
    adding a way to launch a separately-downloaded .pck for a StoryQuest.

As well as removing the lore_quests and story_quests folders, we also
have to remove the world_map folder (i.e. Fray's End and connected
scenes) because these scenes now link directly to LoreQuests.

I also decided to remove the non-CC0 Tiny Swords free pack, which we
have special permission to redistribute but which is not used outside of
one StoryQuest. This significantly reduces the number of files in the
project, which is helpful for Backstitch.

Having removed these files, we adjust the project settings so that the
quest launched from the title screen is the NO_EDIT template, and the
scene to return to when a quest is completed or abandoned is Dev
Archipelago.

In Dev Archipelago, add the Template Elder so that the NO_EDIT template
can be accessed. Add the StoryQuest Elder too, because otherwise the
team's SQ can't be played once completed or abandoned without erasing
the game state, but remove him in normal versions. Add an alternative
broken version of the bridge back to Fray's End which blocks access to
that teleporter. Reconfigure that teleporter to point to the home scene
rather than explicitly to Fray's End so that if it is reached it is a
no-op.

One approach would be to have learners modify the NO_EDIT template
in-place, in which case we would want to rename all those files and
delete the bootstrap tool. For now I just updated the StoryQuest
bootstrap tool to change the initial quest to the newly-duplicated one.

I checked for references into these folders from elsewhere in the game
as follows:

git grep -E \
    '(lore_quests|story_quests|world_map|tiny-swords-non-cc0|uid://cufkthb25mpxy)' \
    ':!scenes/quests/lore_quests' \
    ':!scenes/quests/story_quests' \
    ':!scenes/world_map' \
    ':!assets/third_party/tiny-swords-non-cc0'

In a perfect world there would be no output from this command. There are
some lingering references: for example, the elders' dialogue references
the paths to various quest.tres resources. However there are (as far
as I can tell) no references that will cause a scene or resource to fail
to load. (This command is imperfect because, for example, teleporters
refer to other scenes by their UID stored as a string; that's why Fray's
End's uid is in the command above.)

Creating the bundle is implemented with 2-3 scripts:

  1. A GDScript script which deletes files and adjusts project settings,
    which is most easily done using Godot's own APIs (and reuses some
    preexisting logic).

  2. A shell script which drives the GDScript script, then does some
    additional stuff (downloading the backstitch launcher, running Git
    commands) which is more easily accomplished in shell.

  3. A GitHub Actions workflow which drives the shell script and uploads
    the artifact.

I couldn't resist calling the script StoryQuest Construction Kit
Construction Kit (SQCKCK for short) but this is a placeholder name!

Resolves #2563

@wjt

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/sqckck/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@wjt

wjt commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

The point of committing the pruned build to Git is:

  1. If we keep that commit somewhere, then if we do want to import a quest built from this kit into the upstream repo, it will be much easier to diff!
  2. I want to keep open the option of using Git to make a StoryQuest. What I have in mind is that our magic repo-forking script would not base the new repo off the upstream main branch but off a branch containing the latest storyquest kit. This new repo would be detached from endlessm/threadbare (implementation TBD) so would operate as its own separate universe.

@wjt
wjt force-pushed the wjt/sqckck branch 5 times, most recently from 3a78d37 to 3aba2ab Compare July 29, 2026 20:33
@wjt wjt changed the title Add scripts to make a pruned “StoryQuest Kit” bundle [2/2] Add scripts to make a pruned “StoryQuest Kit” bundle Jul 29, 2026
@wjt
wjt changed the base branch from main to wjt/toggleabletilemaplayer-don-t-store-target-if-it-is-self July 29, 2026 20:33
@wjt wjt changed the title [2/2] Add scripts to make a pruned “StoryQuest Kit” bundle Add scripts to make a pruned “StoryQuest Kit” bundle Jul 29, 2026
@wjt
wjt force-pushed the wjt/sqckck branch 2 times, most recently from 92f0a6d to d9bf30a Compare July 29, 2026 20:36
Comment thread .github/workflows/make-storyquest-kit.yml Outdated
Base automatically changed from wjt/toggleabletilemaplayer-don-t-store-target-if-it-is-self to main July 29, 2026 20:40
@wjt wjt changed the title Add scripts to make a pruned “StoryQuest Kit” bundle [1/1] Add scripts to make a pruned “StoryQuest Kit” bundle Jul 29, 2026
@wjt wjt changed the title [1/1] Add scripts to make a pruned “StoryQuest Kit” bundle Add scripts to make a pruned “StoryQuest Kit” bundle Jul 29, 2026
@jgbourque

Copy link
Copy Markdown
Contributor

Just tried out the new StoryQuest Kit and it worked really well with Backstitch. I was able to create all my own files for an SQ using the "create SQ from template" script and there were no hiccups or delays in syncing those changes or any of the small changes I made afterwards in my testing.

@wjt wjt left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some notes to self.

[node name="Elders" type="Node2D" parent="OnTheGround" unique_id=452918502]
y_sort_enabled = true

[node name="SQ" type="Node2D" parent="OnTheGround/Elders" unique_id=2119212521]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adding 2 more elders to that first island makes it more confusing. Maybe I need to redesign the level more. I am tempted though to keep it as-is and then iterate in a subsequent PR

Comment thread tools/sqckck.gd
Comment on lines +24 to +31
func rm_rf(path: String) -> void:
# You can only delete empty folders, so using DirAccess.remove() means
# traversing the whole folder tree and deleting each leaf before its parent
# folder. But you can trash a non-empty folder in a single step!
var global_path := ProjectSettings.globalize_path(path)
var ret := OS.move_to_trash(global_path)
if ret != OK:
push_error("Failed to trash ", global_path, ": ", error_string(ret))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Could also do this in the shell script, might be easier...

Rather than having Core: Threadbare participants start from a fork of
the entire repo, we want to try giving participants a stripped-down copy
of the project - specifically with all LoreQuests and other StoryQuests
removed. The goals are manifold:

- Reduce the cognitive burden of navigating a large project.

- Reduce the need to take special steps to deep link to a StoryQuest for
  testing: the team's StoryQuest should be launched from the title
  screen.

- Reduce the number and size of the files in the project, saving
  electrons and helping with performance in Backstitch.

- Move us towards a model where rather than expecting that all
  storyquests will be merged upstream (requiring learners to take
  special care to only modify files in their folder, increasing
  complexity; and hitting human scalability cliffs in the form of there
  only being two full-time maintainers of the game reviewing StoryQuest
  submissions) we instead treat them more as stand-alone games. For the
  ones we choose to merge upstream, we can do the necessary work to
  confine them to their own folder at that point; and you could imagine
  adding a way to launch a separately-downloaded .pck for a StoryQuest.

As well as removing the lore_quests and story_quests folders, we also
have to remove the world_map folder (i.e. Fray's End and connected
scenes) because these scenes now link directly to LoreQuests.

I also decided to remove the non-CC0 Tiny Swords free pack, which we
have special permission to redistribute but which is not used outside of
one StoryQuest. This significantly reduces the number of files in the
project, which is helpful for Backstitch.

Having removed these files, we adjust the project settings so that the
quest launched from the title screen is the NO_EDIT template, and the
scene to return to when a quest is completed or abandoned is Dev
Archipelago.

In Dev Archipelago, add the Template Elder so that the NO_EDIT template
can be accessed. Add the StoryQuest Elder too, because otherwise the
team's SQ can't be played once completed or abandoned without erasing
the game state, but remove him in normal versions. Add an alternative
broken version of the bridge back to Fray's End which blocks access to
that teleporter. Reconfigure that teleporter to point to the home scene
rather than explicitly to Fray's End so that if it is reached it is a
no-op.

One approach would be to have learners modify the NO_EDIT template
in-place, in which case we would want to rename all those files and
delete the bootstrap tool. For now I just updated the StoryQuest
bootstrap tool to change the initial quest to the newly-duplicated one.

I checked for references into these folders from elsewhere in the game
as follows:

    git grep -E \
        '(lore_quests|story_quests|world_map|tiny-swords-non-cc0|uid://cufkthb25mpxy)' \
        ':!scenes/quests/lore_quests' \
        ':!scenes/quests/story_quests' \
        ':!scenes/world_map' \
        ':!assets/third_party/tiny-swords-non-cc0'

In a perfect world there would be no output from this command. There are
some lingering references: for example, the elders' dialogue references
the paths to various `quest.tres` resources. However there are (as far
as I can tell) no references that will cause a scene or resource to fail
to load. (This command is imperfect because, for example, teleporters
refer to other scenes by their UID stored as a string; that's why Fray's
End's uid is in the command above.)

Creating the bundle is implemented with 2-3 scripts:

1. A GDScript script which deletes files and adjusts project settings,
   which is most easily done using Godot's own APIs (and reuses some
   preexisting logic).

2. A shell script which drives the GDScript script, then does some
   additional stuff (downloading the backstitch launcher, running Git
   commands) which is more easily accomplished in shell.

3. A GitHub Actions workflow which drives the shell script and uploads
   the artifact.

I couldn't resist calling the script StoryQuest Construction Kit
Construction Kit (SQCKCK for short) but this is a placeholder name!

Resolves #2563
@wjt
wjt marked this pull request as ready for review July 31, 2026 17:01
@wjt
wjt requested a review from a team as a code owner July 31, 2026 17:01
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.

Create smaller project bundle for StoryQuest creation

2 participants