Graphics Theoretical

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

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Graphics Theoretical

Post by Debaser »

Suppose some twisted soul wanted to depict movement on a hex map in Hugo: Is it possible to do overlaying graphics so you could depict the map as one file and icons depicting the actors as seperate files and move them in relation to one another?

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

Graphical tiles

Post by Kent »

I'm thinking not quite the way you'd like, especially if you want to be overlaying hex tiles on a map. Hugo's graphical display is (partly by design) not pixel-specific. There's been a bit of a trade-off in low-level functionality vs. portability and being adaptable to different screen resolutions/shapes/etc.

It is possible to do graphical overlays over a background image or set of images--for instance, I do this in my nearly finished work-in-progress. But it's easiest if the overlaid images are square (because JPEG doesn't support transparency) and if they're not required to be precisely aligned with respect to the background (because the built-in scaling and alignment functionality of the engine might work against you in that case).

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

Re: Graphics Theoretical

Post by Ice Cream Jonsey »

Debaser wrote:Suppose some twisted soul wanted to depict movement on a hex map in Hugo: Is it possible to do overlaying graphics so you could depict the map as one file and icons depicting the actors as seperate files and move them in relation to one another?
Along those same lines: if I remember right, the "patent" on GIFs expired a while back. I think GIFs (which allow transparencies) would allow hex mapping to be realized. Is the addition of GIFs "in the works" as they say?

(If it's in 3.1 already, I respectfully withdrawl my argument to disolve the senate.)
the dark and gritty...Ice Cream Jonsey!

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Post by Debaser »

A quick google search indicates that the patents don't completely expire until mid 2006.

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

Post by Ice Cream Jonsey »

Huh. I could have sworn that the Slashdot nerds just lost it over the revelation that Compuserve's laughable patent had expired.
the dark and gritty...Ice Cream Jonsey!

Debaser
Posts: 878
Joined: Tue Jun 25, 2002 9:55 pm
Location: Aurora, IL

Post by Debaser »

Ice Cream Jonsey wrote:Huh. I could have sworn that the Slashdot nerds just lost it over the revelation that Compuserve's laughable patent had expired.
From here:
We were able to search the patent databases of the USA, Canada, Japan, and the European Union. The Unisys patent expired on 20 June 2003 in the USA, but it does not expire in most of Europe until 18 June 2004, in Japan until 20 June 2004 and in Canada until 7 July 2004. The U.S. IBM patent expires 11 August 2006, (we are still searching the databases of other countries).

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

Graphics format

Post by Kent »

I think I'd probably end up going with PNG vs. GIF. PNG is just so much better in that it allows alpha vs. paletted transparency (and of course is 24-bit color to boot).

I've played around with basic PNG display on Windows, BeOS, Mac, and Linux, but haven't pulled the trigger partly because, at least so far, there hasn't been any pressure to do it.

(However this still wouldn't solve the alignment issues you'd face in trying to do a hex-style map grid with overlays.)

bruce
Posts: 2544
Joined: Tue Jun 04, 2002 10:43 pm

Re: Graphics format

Post by bruce »

Kent wrote: (However this still wouldn't solve the alignment issues you'd face in trying to do a hex-style map grid with overlays.)
Well, sorta. For any size regular hexagon, there's a maximum-size square that will fit inside it, and that size is the side length. The spacing of the centers of the squares is the same as the spacing of the centers of the hexes (because their centers are the same), and is sqrt(3) ~= 1.732 times the side length.

So if you can plop down an image at a specified pair of coordinates (which if you don't have pixel resolution maybe you can't do), you can still drop square tiles onto a hex grid and have it look OK.

Bruce

cauldron
Posts: 6
Joined: Thu Jul 15, 2004 5:13 am

Post by cauldron »

Hello,

If you could implement any graphic format with transparency (GIF or PNG), I would be very grateful.

Post Reply