I started a new Inform 7 game with a graphic title page and a series of windows for various game elements - map, room graphics, room description, inventory, help - on the game screen.
I created a .gblorb file of this bare-bones game so I could run it through a few interpreters at this early stage to see how things would render and catch any potential issues early.
The two screens look okay in Lectrote and Gargoyle.
Since I’ve also used the Parchment Sitegen site in the past to create an HTML file from the .gblorb file for distribution purposes, I also did the same with this bare-bones game file. The HTML file was created without error messages and downloaded
That’s very interesting. It doesn’t look like there’s a problem with the file created by Parchment Sitegen, but with (A) how my Firefox is configured or (B) with a Firefox extension that I’m using that’s causing the issue in that browser.
I’ll do some additional investigation and post what I find here but I’m also posting this here in case anyone else has run into something similar.
Do you have Javascript disabled in Firefox, or something like that? However even if you did I don’t know why it would be displaying the contents of a <script> tag. That’s very weird.
Ah, the code is displayed because it’s actually an error message. The error message is because the data URL is too long - Firefox has a maximum length of 32MB, and with the base64 encoding the embedded story file is about 40MB.
Now that’s something I should come up with a solution for, because there will be valid storyfiles that are longer than that, but you also have a simple solution - shrink your images. Your images must be about 3-4MB each? You could probably reduce them to 1MB with a barely noticeable reduction in quality. You might also be able to reduce their dimensions if they’re very big. Even accounting for high pixel density devices, you probably don’t need more than 2x the display size.
Or use my original ifsitegen.py script, which doesn’t rely on data URLs.
EDIT: That was confusing. “Unpack the blorb” is a possible path for improving the Parchment Sitegen tool. Using my ifsitegen.py script is an alternative that Bill could do right now, but you have to be comfortable with running Python scripts.
Maybe, but it wouldn’t help with someone sticking more than 32MB of data chunks in a blorb (or compiling an encyclopedia into the exec chunk). Since I’ll need to handle that anyway, switching to exporting images into <img> tags would be a lot more processing than the sitegen site currently does, so I’ll probably just keep it embedding the whole blorb.
I wondered if Archaeological Fiction: Sagfjordbotn, with its ~727Mbyte .gblorb, might form some sort of test case. But the biggest chunk inside is a mere 14Mbyte Ogg sound file; it’s just that there are a lot more like it.
That’s got to be at least a couple of hours of audio, right? That’s definitely a case where you wouldn’t want all the media to be preloaded. Such cases would need a better solution than the basic sitegen site.
@Dannii - Good suggestion to keep an eye on the size of the images I’m using and reduce them in size whenever possible.
I reviewed my Figures folder and found that I had one particularly large image, island-0.png, in there. I’m not 100% sure why it’s there right now but I probably want to display the entire map using an out-of-world command like >map at some future date.
Image
Size
beach-0.png
2.5 MB
island-0.png
14.6 MB
island-1.png
3.6 MB
island-2.png
3.6 MB
island-3.png
3.6 MB
island-4.png
3.7 MB
the-dream-0.png
1.6 MB
When I removed the 14.6 MB file from the folder, rebuilt the .gblorb, and passed it through Sitegen, the downloaded file opened in Firefox.
One interesting item, the image that I’m using for the title screen, the-dream-0, didn’t display in Firefox (did display in Safari). Instead of the image there was just black. This happened whether I used a .jpg or .png image.
But that’s not related to my original issue. It could be because it’s an image I downloaded from the internet. I’ll investigate and post elsewhere what I find.
Takeaway from all this - Image size matters when using Sitegen.
Firefox version 97 and newer supports
data URLs of up to 32MB (before 97 the limit was close to 256MB). Chromium objects to URLs over 512MB, and Webkit (Safari) to URLs over 2048MB.
Firefox seems to be decreasing the limit over time for some reason.