Animation

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 30193
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Animation

Post by Ice Cream Jonsey »

If I remember right there's an alternative to the animated GIF in Hugo. Unfortunately, my browsing and searching has not revealed what that is.

I guess this is a question for Kent, but one I think that other people might be interested in -- Kent, did you do the animations in Future Boy! using AVI files, or is there a graphic format which can replace GIF? I think PNG?
the dark and gritty...Ice Cream Jonsey!

Cryptonomic
Posts: 55
Joined: Wed May 05, 2004 4:35 am
Location: Chicago, IL
Contact:

Post by Cryptonomic »

I used an AVI in my original Zork tutorial and the current one has an MPG for animation. So I know those work.

To the best of my knowledge, PNG does not animate. MNG is no longer supported (that I am aware of) which was the "official" adaptation of PNG to support animation. But everyone dropped it because it was way too cumbersome to implement. Then aPNG ("Animated PNG") started coming along. That is the current contender, but it makes a hash of the PNG specification.

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

The FB animations are AVI, yeah. Hugo officially supports AVI and MPEG-1, but the more correct answer is that it goes through the platform's media kit to play. So on Windows, DirectX (i.e., DirectShow) is responsible, on Mac it's QuickTime, on BeOS it's the Media Kit. What this means is that technically it would be feasible to play any format that the media subsystem can play (i.e., .mov on Mac, .wmv on Windows).

MPEG-1 is a pain to encode, isn't that great quality-wise or size-wise, but is playable by everything so it was easy to include.

The trick with AVI is choosing the codec to use, since AVI is just a container format and doesn't specify encoding. I opted for Cinepak, which is old as the hills but ships by default for all of those systems and is fairly low in terms of its CPU demands (since another of FB's goals was to target lowest-end machines). On a very slow (~350 MHz) machine I noticed some framerate chugging playing back an MP3 and a codec like Indeo or DivX at the same time.

Cinepak doesn't have nearly the quality of the latest wavelet-based codecs, but with enough experimentation I managed to come up with results that I was satisfied with.

You could opt for something more recent like an MPEG-4-ish codec, but that would introduce the possibility that it might not be installed by default on all players' machines.

User avatar
Ice Cream Jonsey
Posts: 30193
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Hey... who was the horse's ass that hacked my account and said that PNGs animate?

I mean, there ain't no "P" "N" or "G" on THIS musical scale:

ImageImage
ImageImage

Well, OK, I think there's a "G." But at the bitch-ass end.
the dark and gritty...Ice Cream Jonsey!

Post Reply