0 votes
by (150 points)
I want to publish a (mainly) text based game, and I think I like the Twine platform.

But one of the features I would like to have, is that my game is able to update itself.

What I want is that the user opens the file of the game, and then the game looks up my server and checks whether there is an update.

If there is, it offers the user to update. If the user accepts, it then proceeds to fetch the javascript and html of the new version.

I think these mechanism will be "outside" of Twine, since they are basically a piece of code that goes to my server and then serves the user with the latest version of the game.

This, for now, ignores any additional resources such as images or video.

Has anyone done something similar with a Twine story?

I have a bit of experience with the method for purely online content, but I have not tried to do this on something that ends up stored and running on the users machine. I suspect there has to be some security issues to address as well.

Is there a way, within Twine, to let it use online resources to self-update game contents?

I hope to use Harlowe and complement that with javascript and css as needed.

1 Answer

+1 vote
by (63.1k points)
Assuming you aren't just hosting a web version, in which case this would be redundant, you'll probably need to use some type of shell or launcher, which you could theoretically build in NW.js or Electron or similar, by opening a window that contains code that checks for updates and let's the user launch the game proper. There are other ways to build launchers too, but I'm not familiar enough to help there.

You'd need to solve a few more hurdles though, like setting up an actual server system and backend for this. I think those specifics go beyond this Q&A, though.

Assuming your server is just sending and receiving JSONP or something, you can probably can skate around most security issues. The download itself will probably need to be user initiated, and setting up the right default file path might be difficult, though I'm not 100% sure as I've never tried it.
by (150 points)
Yes, this seems likely. Thank you for pointing me in the right direction! :)
...