Hugo Cover Art Extension

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

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Hugo Cover Art Extension

Post by Roody_Yogurt »

I've been meaning to write a thing for doing 'cover art windows' in Hugo, to emulate what they do with Z-code and Glulx games these days. Of course, cover art doesn't make the game, but I thought it'd a nice way to fancy up a game (of course, it's dumb to try to appeal to IF snobs, but I figure this helps everybody).

Anyhow, Sam K. Ashwell has been organizing a cover art-based comp called Cover Stories, so that prompted me to finally write the thing.

You can take a look at the extension at: <s>http://roody.gerynarsabode.org/hbe/cover.h</s> . Eventually, I'll make a page for it on HbE.

EDIT: New link is: http://roody.gerynarsabode.org/hbe/coverart.zip

Image

(Yeah, I used the Blue Lacuna cover since it was the first cover art file I came across while testing this out.)

P.S. I imagine I'm going to hate actually making cover pictures, but oh well.
Last edited by Roody_Yogurt on Wed May 23, 2012 6:39 pm, edited 1 time in total.

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

I hope to be able to try this extension relatively soon. At any rate, it looks awesome! :)

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Bainespal wrote:I hope to be able to try this extension relatively soon.
That's what she said.
I don't have to say anything. I'm a doctor, too.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Bainespal wrote:I hope to be able to try this extension relatively soon. At any rate, it looks awesome! :)
Cool. Hope it works okay for you. Despite the simplicity of the intended effect, I've played around a lot with the algorithms for the various window sizes so it'll hopefully look ok on a bunch of screen sizes. There's definitely room for improvement, but it's also complicated enough that the current version may be as good as it's going to get.

loafingcoyote
Posts: 89
Joined: Wed Jan 04, 2012 2:57 pm
Location: Texas

Post by loafingcoyote »

Hey there! I know I'm a little late, but I finally got to play around with this today and I have a few thoughts.

First of all, this is very slick. No matter how I contort the interpreter window it comes out looking great. I especially like how it handles resizing the window. A quick key press resizes the cover art screen perfectly. The effect is impressive!

One thing I noticed was that the background color shows through on the bottom of the screen. This isn't a big deal and I'm sure it isn't news to you, but I was wondering if it was intentional. What drew my attention to it was when I restarted the game and noticed the restart message lingering under the cover art screen. It hurt the effect for me, but was easy to fix with a "cls" in the init routine just before calling "CoverArt". I then took a closer look at "cover.h" and changed this line in the "pressakey_window" object:

Code: Select all

return &#40;display.screenheight - 4&#41; ! * 4 / 5&#41;
to this:

Code: Select all

return &#40;display.screenheight - 1&#41; ! * 4 / 5&#41;
It eliminated the space under the cover art window and the "press a key" text was still displayed, even when resizing the window. I don't know if that change would work on all displays but I prefer the cover art screen to fill the entire window, if possible. I would be interested to know if there is a compelling reason to do otherwise.

Anyway, this is my first time to deal with picture or sound resources with Hugo. I tried putting a couple of pictures into a test game and the effect was, to say the least, less that impressive. Now I see why ICJ puts all his pictures in windows and have a whole new level of respect for how good his graphic-heavy games look.
Roody_Yogurt wrote:P.S. I imagine I'm going to hate actually making cover pictures, but oh well.
I understand your sentiment completely. I'm not exactly a graphic artist. However, from what I've read at intfiction, a game's perception is definitely affected by the absence of cover art. It appears to be a necessary evil.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

loafingcoyote wrote:One thing I noticed was that the background color shows through on the bottom of the screen. This isn't a big deal and I'm sure it isn't news to you, but I was wondering if it was intentional.
Yeah, it was intentional. Just as z-code covers show up in a pop-up window, I wanted to emulate the effect as best I could in Hugo. The distinction might only make sense to me, but I wanted the cover art window to feel out-of-game, not just like some in-game title screen.

For someone who doesn't want that effect, yeah, there are ways to get around it. I figured the easiest way is to just choose the same cover-background color as your regular background color.

The other thing that might not be instantly clear to people is that the extension assumes pictures are square, as that is the accepted format of the IF community.

loafingcoyote
Posts: 89
Joined: Wed Jan 04, 2012 2:57 pm
Location: Texas

Post by loafingcoyote »

Roody_Yogurt wrote:Yeah, it was intentional. Just as z-code covers show up in a pop-up window, I wanted to emulate the effect as best I could in Hugo. The distinction might only make sense to me, but I wanted the cover art window to feel out-of-game, not just like some in-game title screen.
Thanks for clarifying this. I hadn't seen this in action yet, because when I downloaded a z-code interpreter I chose Frotz, since it was my favorite in the old days. Turns out I accidentally picked up an old version that garbled the text. Having already downloaded Gargoyle to test my own stuff, I got lazy and used it instead of tracking down a z-code specific interpreter that actually worked. So, now I have a working version of Frotz and I see what you were trying to emulate.

Looking at it a second time, I think the pop-up effect is just fine. My concern with it was just a matter of personal taste and lack of familiarity with contemporary IF conventions.

Roody_Yogurt wrote:The other thing that might not be instantly clear to people is that the extension assumes pictures are square, as that is the accepted format of the IF community.
Thanks for the info!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Glad that is cleared up. That said, the existence of cover art doesn't mean a game can't have title art, nor do I even mean to suggest that this is something that everybody needs to subscribe to. Even though cover art is now a part of the standard way that games are displayed in places like the IF Database ( http://ifdb.tads.org ), in-game inclusion is still largely an Inform thing, and part of the point of having several IF languages is that we don't need to copy everything they do. Still, it was something that I was personally intrigued by and wanted to try out.

I think my next version of this will include an optional configuration-file-saving mechanic to give people the options of turning cover art off permanently or even just showing it the first time.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Ok, a new version is up! Some changes include:
  1. Now the CoverArt routine returns true after a successful cover art presentation, so you can call it like this:

    Code: Select all

         if not CoverArt
             &#123;
             "<alternative>"
             pause
             &#125;
    
    This'll allow you have alternative behavior. Originally, I just wanted to stick it to anyone not using the official interpreter (or Hugor), but this was added at Johnny Rivera's suggestion. I thought it was a fair point.
  2. Now it's possible to change cover art settings. COVERS ALWAYS and COVERS NEVER are always available. If you want to make the COVERS ONCE option available (cover art is only displayed the first time), in your game code, you'll have to set a GAMECOVER constant, which will be the name of a game-specific configuration file.
  3. If you want the player to be notified of cover art commands during the first turn (only after cover art has successfully been shown), #set COVER_INSTRUCT in your code, too.
  4. Proper message routines have been added.
  5. A grammar file has been added for those aforementioned cover art commands.
The new URL is:
http://roody.gerynarsabode.org/hbe/coverart.zip

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

I've just added this extension to my WIP, and it looks great. I hope to be able to show you exactly what it looks in a little over a week, but I'd better be pounding out the code. ;)

I found a small documentation mistake in the comment at the beginning of cover.h (the newer version):
7. NEW IN VERSION 1.4-
Cover Art options are now available!
Include "coverart.g" with your grammar.
The grammar file is "cover.g," not "coverart.g." I found that out because I copied and pasted the word the first time. :)

I don't understand what the command COVERS ONCE does, although I did figure out how to enable it after I looked at cover.g. When I try the command COVERS ONCE and then restart, it still shows the cover art as if it were the first time.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Thanks for the heads-up on the typo! That will be fixed on any future versions.

As far as "COVER ONCE" goes, I figured it'd be harder to tell that your command accomplished anything if it counted the cover art already shown, so I decided to have it show the current game's art just one more time. You'll notice that after that, it won't show again.

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

Roody_Yogurt wrote:As far as "COVER ONCE" goes, I figured it'd be harder to tell that your command accomplished anything if it counted the cover art already shown, so I decided to have it show the current game's art just one more time. You'll notice that after that, it won't show again.
Okay, I think I get it. "COVER ONCE" is only applicable if the game calls CoverArt() more than once in the same session, where restarting does not count as the same session. I just call CoverArt() in init, so I don't think COVER ONCE is relevant to my game, so I should delete the constant that enables it.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

It really has nothing to do with sessions, actually, since behind the scenes, it is saving to a configuration file. If you change it to "cover once", it'll do the cover one more time (regardless of what setting it was on before) but then it should never do the cover again, even if you start a new session.

It is meant to emulate the "show the cover one time" setting on z-code interpreters. True, it could be argued that if the cover has already been shown once, setting it to "cover once" should not show it again, but liked I implied, I was worried about people expecting one more cover-art-showing and not getting it.

The cover art system is also designed to work best with the official interpreter, which saves all configuration files in one directory, so "COVER ONCE" will not just work for your game, but all games that use it.

It'll also work with Hugor if you keep all of your games in the same directory (since Hugor saves configuration files to the working directory), as unlikely as that'd be.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

Roody_Yogurt wrote:It'll also work with Hugor if you keep all of your games in the same directory (since Hugor saves configuration files to the working directory), as unlikely as that'd be.
Heh, and there I thought that using the game's directory was a better idea, so that when you copy the game to another computer, you shouldn't go hunting for its configuration data.

Maybe this should be configurable, with the default setting matching the official behavior?

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Yeah, I'm pretty cool with the existing (Hugor) behavior. For the most part, I think it's good for Hugo to be transparent about where it is writing configuration files. For my joke game, the Halloween Horror, deleting the configuration file was originally key to restarting the game (in the current version, there's now a command to do so). In any case, it's kind of annoying having to explain where the user application folders are.

Having the behavior be configurable doesn't seem <i>so</i> important, but it probably wouldn't be a bad idea, either.

Post Reply