I link to my Google Photos images in my games: should I not?

Hello everyone!

When I use images in my Twine games (which is basically all the time, my games are pretty much image based), I upload the photos to Google Photos albums, then use “Copy image address” to put them in the game. Will this cause me problems if a lot of people play the games, or if I sell the games or access to them? (At present they are all free on Itch.io, but have the usual “Support this game button”, and I think “Choose your own price” to download the files.)

I’m asking this because since this morning, or last evening, all my games on Itch are not loading the images from Google Photos, showing the little broken image link icon. Yet if you right click on the broken link icon and copy the image address, you can go to the image just fine, or if you get the image link some other way: basically the links are the same, but Itch can’t display them all of a sudden. And this is the same on multiple computers and browsers.
[Update: it isn’t just Itch: the Google Photos links aren’t displaying anymore on games I uploaded to Philome years ago, or when I upload them to a Neocities site just today.]

Thank you for any ideas you can offer!


You may want to put a notice on the title screen “requires an internet connection for images”. I’m sure there are people who download Twine games to play offline. On itch, you could not offer a download, and just have in-browser play only, which means the player is most likely connected.

If your images are important to the game, you might want to provide them locally. If not, maybe create a “no images” mode so the player won’t be seeing broken links everywhere. If I see a broken image link in a game, I usually think it’s a bug rather than a connection problem.

Some, including myself, use browser plugins that restrict tracking from Google. This means that images that are hosted by Google could be blocked as well. There have been several occasions where I have wondered why I couldn’t see pictures and later discovered I was blocking them.

I would recommend to always serve images from the same domain as the page being visited.


If you can see the images if you go directly but not from within Itch then they’re probably trying to prevent hotlinking. So yes, best practices is to upload the images alongside the HTML.

1 Like

If you want people to download your game, it’s better to include any images in an “images” directory inside the ZIP file, along with your HTML file.

You can just refer to them using “images/imageName.jpg”, and the browser will be able to find them using a relative path.

However, that will make it so you can’t see the images when you’re running the game from within Twine. If you’re using the SugarCube story format, then I have some sample code which shows how to get around that URL path problem here.

Hope that helps! :slight_smile:


Well, I was hoping it wasn’t something to prevent “hotlinking” and such, since I have almost a thousand images in one of my main games. That would also make it vastly longer to load if I included the images with the game, would it not?

It will probably take me weeks or months to replace all Google Photo links in my games, if that is what I have to do: I want to be sure I replace them with exactly what will work best and most reliably. By “image based” what I mean is I am making point and click adventures and monster slaying games rather than text adventures, here is a walkthrough of my largest one, without any exploring:

I link to files I have uploaded to archive.org for my audio; should I use that for my images too? Or should I try to use something else for my audio as well? I used Google for my images because it had a better upload and file management system, and the images seemed to load somewhat faster than when linked from archive.

Actually, if a person is playing with local files the images will load faster since it’s not dependent on bandwidth. Probably not such a big deal with images, but I know when I play my browser games online there can be an initial hesitation for the 2-3MB music tracks that irks me artistically in places where I actually tried to time it appropriately.

You’ll also get less grumbling from people who have to very judiciously meter their bandwidth caps. If they see it’s a 20MB upload up front, at least they know, rather than seeing it sip from the internet constantly, which might make some people worry what’s happening if they notice it.

Just checked out your video - wow I see why you have lots of images - that’s pretty neat!

Initial load up is what I’m concerned about. I personally dislike long initial loading screens, whereas each individual image is small enough to load nicely when needed, or just before it is needed if I can find a way to work that out.
I suppose it depends on how Twine treats the images that are included with the game: if the game doesn’t play until they are all loaded, that would be painful. But if it treats it more like linking to another site, not loading an image until it is called for, then it would definitely be the choice option I think.
But in any case I don’t think Twine shows how large an online game is when it is loading it; it would only be when someone was downloading the game off a site onto their own computer.

Thank you! I’m glad you liked the video; too bad it will be probably be unplayable for a time. There are many other places you can go, and even small books you can read.

Because of the way you’re using images, practically like animation, I’d say that’s a major game feature and I’d never leave it to chance whether they will load efficiently on the player’s bandwidth or lack thereof, which you have no control over.

If you’re set on hosting your images on Google due to your preference, then why even ask the question?

One other thing to consider - does Google images have its own bandwidth cap? I had to be aware of that when I was hosting music files from Dropbox. If your game gets popular, it’s possible a lot of free hosting services may throttle you or shut you down and insist you go to a paid tier. You’ve probably seen how sometimes photo hosting sites will take countermeasures for files that are linked more times than they are expecting.

If I try, say, Auldhame on itch.io I get the broken image icon if I’m not logged in to Google, but even if I’m logged in, and go to the image directly, Google gives me a 403 Forbidden error. So I wonder if Google changed default permissions or something recently?

But yeah, it’s probably best to host the images the same place as the html file. With itch this is easy: you just upload a zip with the html and the images.

You still just have an image URL in the Twine, so it will load the same whether the image is on Itch or Google.

They won’t load in the Twine editor, which could be a major problem for you, but @HiEv’s post explains how to fix that.

1 Like

Again, if you include all of the files in a single ZIP file for download, once installed, that local version will always be faster than a version which has any online links. So, if you don’t like long loading screens, that’s a good way to go.

That’s exactly what it does, because the browser plays the game the exact same way, regardless of where the files are located. Unless you specifically code it to act differently when running locally/online, then both situations will work exactly the same, which means the local version will always be faster.

Hope that helps! :slight_smile:

1 Like

You can’t be sure that Google won’t move the images or close off hotlinking (linking outside of the site) the next day. Just put them in a folder with the HTML.

Looks like bundling it is the option for me then! The links will be easier to handle than the Google one’s anyway (for example: “https://lh3.googleusercontent.com/4AHDbOSJwkP6gP_XPsIqJUVNH_ao_KO5GLKLJIpELolssH8kqoEa5GUnmnv9HIMi8DCDCijSELechAxNgxNljdriec_7yNxKtqr8Ewyv6ADV5X-N3eFxpHTDMtsWnilxiEAN2gQbSYLgRGKiR9zlx2BnBLBp7sRG3okSKmZyDERxBy-qi15d_0cPXp-7VggeHvUqx9Xa3YSTcnefgVC0R5MVAaOYhNHwnkm285oBDTCdP6NFfHdzFeNB-LogMJuIMs1DLeP5vE8U-ER_R7aIvBEy5APJyoEeKhI60ncqT89Onx2ywksH5RLkoPqaY7QG9X6gCbNrBthlbfOjUnTy3vzpSZ70SMcASA4eixSICoaUkXPG_AA0zcxEzaXzwSuUN2yRTUe0jP05iiojeV7i0g0l32ZWLQefoBjB3kA36TWXWqgEafwPwTES_NzJmOdBdkefQUuarq1sKQ0-ibVueKnTA4-C-99SZ4Q_VKUX7XB061PkFeLcAI9OnoMegsn5TRVbJGRLP4mBbjp2eJqQk3qLREuhYpcSFdLGcNAsig6l-sDkGolk5wV-_Re3xokDcg61IIJ2zR4jCvXVhwBjR_iJt099qc_5lyglpVlSR6lgkUXBT6ilCrDoQME2IGVHhLX4d4IO_QGlTyml1vX7jwnAN9NuAcT8UpBWJz7Ql-gCSXPbU-uxZ8g=s30-no”).

*rolls up sleeves* Time to replace links!

Thanks for the code HiEv! That will be invaluable.

1 Like

Huzzah! I found the right button and all the Google Photos links are working again!
Of course I’m still going to stop using them in future. And I am still planning on remaking some of my games with better structure and techniques all around. But at least all my games (and several other places I’ve found where I used them extensively) won’t be down until I replace all the several thousand links!

For anyone else who would like to know, I opened each Google Photos album in question, clicked the vertical ellipsis at the top right, selected Options, and the only option there is “Share” (really weird that they would put it there, I’m not even sure it was there when I started this thread, I thought I had looked in Options).

Update: random images, from the same album, are still not working; maybe it takes time? Something to do with cache? Nope, clearing the cache didn’t help. I noticed that it said “creating album” after I told it to share. Does this still say 403 Forbidden?

I can see it with firefox but not with chrome - no error in that case, just a black page.

Here’s a relevant discussion at Google Photos, maybe that helps (although it sounds as if you’ve done the recommended steps there).

It actually did work for me in Chrome, but the image is transparent so it’s practically invisible on the nearly-black background that Chrome seems to be currently using…

1 Like

You are right regarding chrome.Firefox uses a white background but only for the picture.

What concerns me is this comment on the thread:
“The photo added in a shared album is already in publish state and album link is fixed, so that direct link gotten by user in logging out is also in publish and fixed.”

Some of the images are working, but still, if some random ones aren’t working, would that be because the links for them changed for some reason when I made the albums shared? It would still be vastly fewer links to replace, but I would still have to find all of them.

Update: ones that were still broken are back now; of course since I don’t know why they were still broken I therefore don’t know if they are all back. But I am certainly thankful! :sweat_smile: