Displaying images?

I have a lot of figures/images in my game – probably about a hundred. For the latest entries, it no longer displays the image, just the text from the table.

Is there a maximum number of images/figures? Can I raise this limit? I have checked the coding of the images/figures and the later ones are coded the same way as the earlier ones. Also, images/figures are in a format that glulx recognizes and can display. So the problem is not there.

Has anyone experienced this?

1 Like

@mattdevins - I used images in my game but there are only 37 total (compiled for Glulx interpreter).

I haven’t read about an upper limit on images so far but it would be interesting to know if such a limit exists.

The Index section on Limits doesn’t mention figures, i.e. images, and the section on Figures doesn’t mention anything about limits (I did a quick read-through but could have missed something).

3 Likes

Very interesting. I have a WIP game that I expect to have a number of images. I assume this will also be relent in upcoming releases of Inform.

Very much worth a bookmark.

1 Like

@mattdevins - I also forgot to mention in my original post that I’m used these extensions in my game (I don’t know if you are using the same ones).

Also, re-reading your post I noticed you wrote “…it no longer displays the image, just the text from the table.” That made me realize that maybe the error might have something to do with tables, table structure, and table limitations.

In my game I didn’t use any tables to organize my images but simply listed them out.

Volume - Figures

A room has a figure name called illustration.

First carry out looking when the illustration of the location is not Figure of cover (this is the Display Illustration rule):
	if graphics-mode is true:
		display the illustration of the location.

A thing has a figure name called illustration.
The illustration of thing is usually Figure of cover.

Before examining the noun:
	if graphics-mode is true:
		if the noun is not a person:
			if the illustration of the noun is not Figure of cover:
				display the illustration of the noun.

Book - Settings
Part - 1895

Figure of Woking Street is the file "woking-street-4aef9_0_1.png".
...

And then specified the illustration along with the room description, etc.

Part - Woking Street

Woking Street is a room. 
The description of Woking Street is "You are standing halfway down the street..."
The printed name of Woking Street is "68 Woking Street".
The illustration of Woking Street is Figure of Woking Street.

If you post some source code here I’d be willing to take a look at it (I anticipate my next game will have more than 37 images and using a table-based method of organization might be more effective).

FYI, the entire source code that the above snippets came from can be found here if you’re interested in seeing more detail.

Thank you for taking the time to respond, I appreciate it!

The size of the table isn’t the problem, I created a second table to consult if the answer wasn’t in the first table and still no picture.

Here’s my code:

Instead of consulting:
	if noun is metal book:
		repeat through the table of Metal Book's responses:
			if the topic understood includes the consult entry:
				play the sound of the book;
				if there is a picture entry:
					display the picture entry;
					say "The book buzzes and clicks and then a male computer's voice says:[paragraph break][response entry][paragraph break]";
					stop the action;
		repeat through the table of Second Metal Book's responses:
			if the topic understood includes the topic entry:
				play the sound of the book;
			if there is a picture entry:
				display the picture entry;
				say "The book buzzes and clicks and then a male computer's voice says:[paragraph break][responses entry][paragraph break]";
				stop the action;
		say "There's nothing in the book about [the topic understood].";
		stop the action

Here is an entry from the first table (again, the early entries were displaying pictures just fine:

"Two of Wands"		"'The man is a traveller, looking at the mountains of the globe, twelve ranges that he has travelled that the two in the background remind him of.  He is old and walks with the aide of a cane.[paragraph break]The Two of Wands is a more mature version of the Ace of Wands, implying that this tarot card is all about planning and progress.  The two of wands is about making decisions.  In other words, you are either satisfied with your current knowledge or you are moving forward and taking risks.'"	figure of image two of wands

and from the second table (which does not show images)

"Bloom County" or "Michael Binkley" or "Beat Bedwetting Through Self-Hypnosis" or "Beat Bedwetting Through Self Hypnosis"	"'It's an old newspaper comic strip from the 1980s, [italic type]Bloom County[roman type].  You should see if you can search out some books, it's pretty funny.'"	figure of image bloom county

I’ll be damned if I can find where the problem is.

Any help is appreciated, as always!

1 Like

As an update (to respond to my own post, I’m not too solipsistic BTW). I think it’s a memory issue. I get this response when I’m trying to read from the second book’s table:

Memory is constantly being allocated and deallocated, as needed, to store indexed text, lists and other values which can stretch to contain large amounts of data. If you see this problem, then the story file has needed more memory at once than was available.

For projects running the Z-machine, there is only a predetermined amount of memory that can be used; you can raise this with the Use dynamic memory allocation of at least N option, but only until there's no more space in the Z-machine, which doesn't take long. On Glulx the situation is better: if a version of Glulx from around 2007 or later is used, then memory can be dynamically grown during play - this happens automatically - and even if not, the dynamic memory allocation setting can be made very large indeed if needed.

I can’t believe that I’m having a memory.issue. Just like in real life lol

@mattdevins - In the first table example you provide, it looks like you have three columns - consult entry, response entry, and picture entry.

  • consult entry = “Two of Wands”
  • response entry = “‘The man is a traveller, looking at the…’”
  • picture entry = “figure of image of two of wands”

Is my assumption about the column names correct?

In the second table example there appears to be four individual entries in the consult entry column, each separated by OR. I’ve never seen a table column constructed with logic in an individual entry like that. Could the OR’s be causing the problem, i.e. preventing a match on consult entry so no picture entry is returned?

I’ll try an mock up something quick with the code you’ve provided and some images I’ve got to see if I can prove my hypothesis and let you know what I find.

That’s a good suggestion, I’ll try it. I think I have other entries, though, that have multiple quotes.

@mattdevins - Just read this in the §16.13 Topic Columns in Writing With Inform.

So there’s your OR being used (never knew you could do that).

Could it be something simple like your first column should be named “Topic” instead of “consult entry”? (again from §16.13)?

Update: @mattdevins - Reading through your source code again I think my assumption about your first column being labeled “consult entry” is incorrect.

If you can confirm the column names of both table examples you provided when you get a chance that would help (sorry about causing any confusion).

@mattdevins - Managed to get the code snippet you provided working with some images I had.

"inform7-image-table-test" by Bill Maya

Example Location is a room. 

A metal book is a thing.
The metal book is in the Example Location.

Instead of consulting: [ Did not know that "consulting it about" was one of the built-in verbs (see Index > Actions) ]
	if the noun is the metal book:
		repeat through the Table of People Responses:
			if the topic understood includes the Topic entry: [ See Writing With Inform §17.5 - The Text Token ]
				say Response entry;
				if there is a Picture entry:
					display the Picture entry;
				otherwise:
					say "[line break][bracket]NO PICTURE AVAILABLE[close bracket][paragraph break]";
				stop the action;
		repeat through the Table of Place Responses:
			if the topic understood includes the Topic entry:
				say Response entry;
				if there is a Picture entry:
					display the Picture entry;
				otherwise:
					say "[line break][bracket]NO PICTURE AVAILABLE[close bracket][paragraph break]";
				stop the action;
		say "There appears to be nothing in the book about [the topic understood].";
		stop the action.

Table of People Responses
Topic	Response	Picture
"Humboldt" or "Doctor"	"This is Dr. Humboldt"	Figure of Humboldt
"Gernsback" or "Businessman"	"This is Mr. Gernsback"	Figure of Gernsback
"Watchett" or "Housekeeper"	"This is Mrs. Watchett"	Figure of Watchett
"Weena" or "Girl"	"This is Weena"	Figure of Weena
"Eloi"	"These are the Eloi"	Figure of Eloi
"Morlocks"	"These are the Morlocks"	

Table of Place Responses
Topic	Response	Picture
"Woking Street" or "Street"	"This is 68 Woking Street"	Figure of Woking Street
"Clearing"	"This is the Clearing"	Figure of Clearing
"Domed Building" or "Dome"	"This is the Domed Building"	Figure of Domed Building
"River Bank" or "River"	"This is the River Bank"	Figure of River Bank
"Underground Caverns"	"These are the Underground Caverns"	

Figure of Humboldt is the file "humboldt-3ed25_0_3.png".
Figure of Gernsback is the file "gernsback-40b2b_0_0.png".
Figure of Watchett is the file "watchett-7a90a_0_3.png".
Figure of Weena is the file "weena-bc3a7_0_0.png".
Figure of Eloi is the file "eloi-61ba7_0_3.png".

Figure of Woking Street is the file "woking-street-4aef9_0_1.png".
Figure of Clearing is the file "clearing-ff916_0_2.png".
Figure of Domed Building is the file "domed-building-fd353_0_2.png".
Figure of River Bank is the file "river-bank-61f36_0_0.png".

Test people with "consult book about weena / consult book about eloi / consult book about morlocks /  / consult book about girl / consult book about humboldt / consult book about gernsback / consult book about watchett / consult book about doctor / consult book about businessman / consult book about housekeeper."

Test places with "consult book about woking street / consult book about clearing / consult book about domed building / consult book about river bank / consult book about underground caverns / consult book about street / consult book about dome / consult book about river."

I used OR in several Topic entries for both tables.

There are two Test commands - “test people” and “test places” - that consult the book about various topics using synonyms, displaying a Response and Picture if they exist.

Unfortunately, I can’t seem to duplicate the issue you are having. I’ll keep experimenting.

For anyone who’s interested, I created a public Dropbox folder called “inform7-image-table-test” with the following files:

  • Archive.zip - Contains the images I used in my example
  • inform7-image-table-test.glorb.html - The compiled game in an HTML page for anyone who’s interested in trying it out

You can find the folder at this link. (I’ll keep it around until I remember to delete it. In the future, if the link doesn’t work, just DM me for the files.)

2 Likes