Uploading a Twine game to itch.io with passage images

Hi all,

I’m trying to upload my Twine game (HTML file with supporting game images)

The HTML file uploads fine, but I’ve also uploaded the game images as uploads (Graphical assets)

Once these were saved and uploaded, I ran the game on twitch.io in the browser and it did not include the images.

Any help in assisting me on this would be hugely appreciated.

Thanks all

1 Like

I think when I have done this, I put everything in a ZIP file. Itch.io sorts it out as long as the HTML file is index.html.

2 Likes

As @The_Pixie stated, you must package your game and media assets in a zip file. The itch website will look for index.html in the top layer of your zip when “Run Game” is clicked.

In your game, your media must be called by relative urls to their location in the zip or a sub folder. (You can leave them in the same folder as index.html but if you have a lot of files in a big game that becomes disorganized. I make one “media” folder for images and sounds.)

Screen Shot 2023-11-26 at 1.09.27 PM

So for this project, I’m zipping index.html and the media folder together, and uploading that to itch then specifying it’s played in the browser. Within the game, since I have media in a sub-folder, it is called inside Twine as existing at media/Ethernight Club.mp3. If you make multiple folders for say “images” and “sounds” you’d call images/tree.jpg or sounds/groovymusic.mp3 as necessary and include them all in the zip as well.

I also rename the default zip name from “Archive.zip” to the game name or a permanent acronym that I upload like “GameName.zip” and keep that consistent so when I re-upload to update, itch replaces that file instead of creating a new one with a different name.

Screen Shot 2023-11-26 at 1.22.34 PM

Higher level process: I store the media folder(s) and the published index.html file in a subdirectory called “Publish” and when I update the game just publish the index.html by clicking to rename it as that, then re-zip if uploading. Often your media will remain the same so you don’t have to keep creating that folder, and can just swap updated media in it. You can play the game locally from the index.html in the publish folder that has the folders in place including all the media in your browser without uploading to itch, or to update online, re-zip/rename/upload.

When I work, the “elements” folder is collected media I’m potentially using in the game but hasn’t been edited or processed or included yet, full versions of music I’m clipping sections out of, and notes and anything else; the “Unused” folder is where I drop stuff that’s deleted from the game or has been changed, like if I change the music tempo or update an image I’ll drop the old version in Unused to refer back to if I change my mind.

Screen Shot 2023-11-26 at 1.45.03 PM

2 Likes

The Publishing Twine Games on Itch.io page of the official Twine Cookbook also has instructions for uploading a project that includes external media (eg. audio, image, video) files.

2 Likes

You guys are the best, followed these instructions and they worked a treat.
I consider myself well-schooled.

Cheers

2 Likes

Also of interest if wanting it to play in browser there:

ZIP file requirements

There are a couple of requirements for ZIP files in place to prevent abuse and to ensure a suitable experience for people running your project in their browser:

  • The ZIP file should not contain more than 1,000 individual files after extraction.
  • The maximum length of a file name including path should not be greater than 240 characters long.
  • The size of all the extracted content should not be greater than 500MB.
  • The size any single extracted file should not be greater than 200MB.
  • The filenames are case sensitive and should be encoded as UTF-8

They’re pretty generous and you only need to work with them if you have an enormous game.

File size limit: 1 GB. Contact us if you need more space

They have a whole page of information where that “ZIP file requirements” came from:

Upload a ZIP file containing your game. There must be an index.html file in the ZIP . Or upload a .html file that contains your entire game. Learn more

1 Like

I have seen devs imbed media into an html file. Is that an easy feat?

Yes it was for me in the end.