[Glulx, I7, I6] Is there a way to use GIFs as images in Glulx?

Hello, Wizards!

I know GIFs are not supported atm. I would like to add animated images to some of my future games.
Where should I look?
Anybody willing to help?
Is it a very hard task to accomplish (considering I’m not good ad coding at all)?
Is it an Inform or rather Quixe thing?

Thanks!

It’s a Blorb thing.

In theory it would actually be possible to make a Quixe game display a GIF, since the files are external and you can change the filenames external to the story. (So you can just use a placeholder image when compiling with Inform, and then swap it out after building the release.) But I don’t think there’s any way to do that within a Blorb file, so it won’t work on the non-web-based interpreters.

Within the confines of Blorb, I think the only way to do animation is the old-fashioned way – storing each frame as a separate image and then switching images via a timer. It may not work too well on the more resource-constrained systems, however.

Thanks!

Mmmmh. This means (the timed solution) that if I have, like, 50 images with 3 frames each…

Given the opportunity: it means that the standalone Blorb will not store the images but I would be able to do that (easily) with a i.e. Lectrote bundle, right?

I will try this out.

Thanks!

You can also use Vorple to display directly your GIFs (or even videos!) if you are willing to go that way.

You’ll get all the advantages and drawbacks of Vorple, of course (such as having the game web-only, except if you package it in an standalone Electron app).

1 Like

It really comes down to what interpreters support.

Officially, Glulx delegates image-handling to Glk, and Glk delegates resource-storage to Blorb, and Blorb doesn’t and probably won’t support GIF:

GIF and MP3 are not going to become standard Blorb format types.

In the end, the game just tells the interpreter “hey make this glk function call”, and it’s up to the interpreter and its attached Glk library to find and display the image. Nothing in the Glulx spec stops an interpreter from supporting GIFs…but no interpreter I know of does.

A better bet is animated PNGs. The GIF format was never really meant for videos, and it’s not a very good image format in general (its compression is bad and it’s limited to a very small color palette). I don’t know if any native interpreters currently support APNG, but web-based interpreters like Quixe and Vorple should as long as the user’s browser does.

Alternately, you can go the Kerkerkruip route and just store each frame separately and swap them out within your game’s code. This option will work on all interpreters that support images, even if it’s a bit clumsy to use.

2 Likes

Thanks all!

I think I will try the gif workaround (considering mine is pixelart, so I don’t need many colors) and, in case, the timed sequence.

Vorple is a last chance, as I’m not really into learning new tools. But never say never.

Thanks!