Background:
After writing a text-adventure for a 10 yr old, it went over pretty well, but as soon as I added simple 2D images, it got more traction. Why not raise the bar with animated GIFS (or APNG or webp) which is still far smaller than MP4.
Unfortunately, TADS3 does not support animated simple graphics. Looking through the docs, the author said supporting animated GIFs was subject to IP issues – but those patents expired over 20 years ago and all web browsers support animated GIFs (royalty free). I gather that doc was written before 2005. (Yes, it says MNG is supported but that format never got traction and no modern browser supports it, so for all practical purposes, it is a non-starter.)
I tried simple GIFs and animated GIFs with the existing TADS3 and neither GIF nor animated GIF display. JPG works. Even PNG does not, although the doc says all 3 should work.
Can anyone provide insight into what has been done to support these other formats (including APNG and webp which both support animation)? If nobody has touched these, I am happy to take a whack at it but do not want to rehash what someone else has already done. Thanks!
I’ve never dug into that part of TADS. I wonder if the idea could be accomplished by a banner window which changes a sequence of images via RealTimeFuse.
I wonder if putting them in a Parchment version of a TADS 3 game might work, assuming the system won’t get in the way of you just including a thing vanilla TADS interpreters don’t support.
I could take a look at writing a patch to add GIF support if that would help. It would mean you’d have to be able to recompile the terp yourself, though.
I think adding support should be fairly trivial, from a perusal of the relevant code. The main reason it isn’t supported appears to be that it relies on and enumerated list of allowed types and GIF isn’t in it.
That would be great! I downloaded tads-sources and tried to build tads3, but the makefile.vc5 fails with an error in VS2005. So, non-starter for me. After reading the doc, I wonder if the version that works with it is VC++6 which is from the 90s and I do not have it any more.
What interpreter are you using now? I sat down to write a patch but it looks like FrobTADS supports this out of box. The library doesn’t have any specific logic for handling types, it’s all just for capability-probing in game code. That is, if you’re writing a conditional to decide which of two versions of a resource to present. Which presumably you don’t care about. But given a game like (and an animated GIF in ./res/room.gif):
#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>
WebResourceResFile
vpath = static new RexPattern('/res/')
;
startRoom: Room 'Room' "This is a test room. <img src='res/room.gif'>";
+me: Person;
versionInfo: GameID;
gameMain: GameMainDef initialPlayerChar = me;
…that just works, at least with FrobTADS.
So my first recommendation would be to try FrobTADS if you’re not already using it. Or if you are, maybe I’m misunderstanding what you’re trying to do or how you’re trying to do it.
Huh, didn’t realize it wasn’t available for Windows.
Hm. So when you run it from the workbench I guess it uses a bespoke browser as the client? With FrobTADS you run the client (frob), but it just creates a lightweight local web server that you can point any browser at.
I think the problem you’re running into isn’t in HTML Tads per se, just on the client. Unless the T3 VM code in FrobTADS is radically different that the windows version. But I don’t have a Windows machine that I can directly test on, sorry.
HTMLtads is the bespoke browser on Windows. You can run it independently, not just with the workbench. The TADS execution engine is written such that if it sees you are running in a shell or running in a system that does not support images, it will ignore that information.
That sounds like you’re making your game for the WebUI…? Which, yes, should allow all multimedia features that the client browser supports. But that is separate from what QTads or the “regular” HTML TADS Windows interpreter support.
Qtads is qt? Iirc, a qimage loads formats available in the supplied image plugins. Whose DLLs you can copy in from the runtime. Might be different now though.
Ah, I think I was just confused on the nomenclature. I’m not using the WebUI (or, obviously, HTML TADS) for my WIP, just “vanilla” T3. I was apparently conflating WebUI and HTML TADS; I was thinking that “WebUI” was the transport mechanism and “HTML TADS” was the set of language extensions to T3 that are used over it. Like HTTP being the transport for HTML in a regular web browser.
That said, is there a canonical repository for the HTML TADS source? Having volunteered to add GIF support I’m still willing to take a look at it, for the same reasons: it’s probably not that big of an undertaking to add another image format to something that already supports some.
Supplement: The git repo and tads313 zip file are both missing ALL of the win32 files. There are 7 of them. Really, impossible to build anything without it. Does anyone know how to reach Mike Roberts?
Huh. So it sounds like the proposed modification (adding a new feature, specifically support for an additional image format) would be a violation of the HTML TADS license? Yikes.
@ucode81, you mention that MNG is supported but call it a non-starter. Have you tried just converting an animated gif into an MNG? Imagemagick is available on Windows and its convert utility will do this.
This TADS Runner repo is GPL licensed. It’s generally only used by Glk apps though, and there’s more work to do to get multimedia working in Glk. But eventually other image formats could feasibly be supported.
Yeah, TADS is unfortunately open-source (as in you can look at the source code) but not free software (you can’t modify it and distribute your own version). Gargoyle got permission to include a certain part of the runner, and since Gargoyle is free (GPL), that means anyone else has permission to extract that part from Gargoyle and use it under the terms of the GPL—Dannii linked to a repo where someone did exactly that. But HTML TADS isn’t included in that certain part, because Gargoyle only does Glk output[1] rather than the full suite of HTML TADS features, so HTML TADS is still non-free.
This isn’t meant as a dig at TADS or its community—until pretty recently, Inform 7 wasn’t even open-source, let alone free! But it saddens me when development systems are no longer actively developed or maintained, and the license doesn’t allow the community to fork them and take over (like we’ve done with Dialog). Take it more as a “this is why other people browsing the Development Systems forum might want to consider releasing their own projects under a free software license of their choice, hint hint”.
Plus a few extensions that aren’t relevant here. ↩︎