Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

HTML files fail to load (Construct 3)

A topic by SaturnProductions created Jun 21, 2021 Views: 1,123 Replies: 7
Viewing posts 1 to 2
(+1)

Hello, 

I have been working on a game called The Carnage Club for 3 years and I have released multiple demos along the way (public on my itch.io page). Each of these demos have grown larger and larger in file size and file amount, however, they have always worked. They were developed on Construct 3, and I exported them for the Scirra Arcade. This exported a format that had the necessary components of itch.io's html/zip play in browser standards, so it would run. However, with my new project, the Construct 3 loader loads to completion, then the screen goes black and the game doesn't load any further. Why is this? When I inspect element, the tool says there are 1200ish errors, many of which involve failing to load resources and failing to fetch the c3 runtime.

My other builds for the game have been uploaded in the same manner but this problem doesn't occur with them. I have tried using Construct 3's HTML exporter instead and the game still won't load. This includes recompressing and deduplicating images to reduce file size. The file is quite large, but with recompressing and deduplicating, it is significatly reduced (75% smaller) and still has a similar number of error messages in the inspect element tab.

Has anyone else had similar problems or know any solutions? I'd really appreciate the help.

Thanks so much,

Harrison

Admin (1 edit) (+3)

The error message is likely telling you what’s wrong, so please read it carefully and try looking it up. If you can provide any examples of specific error messages then we might be able to help you more. itch.io’s html support uploads your code exactly as provided, so generally if something isn’t working then it’s due to what you provided not being packaged correctly or it having an issue in the code: https://itch.io/docs/creators/html5#common-pitfalls

I don't know if this helps but the game works on Safari, but not on Edge or Chrome. The only problem on Safari is that it takes too much memory and the tab therefore reloads after a little while. Additionally, on Safari, it seems to be able to play .webm audio files just fine but fails to play .ogg . 

I have updated Chrome to the most recent version but it still fails to load the game after the Construct 3 loader is finished. 

Lastly, the error messages seem to come from failing to load images. "Failed to load resource: net::ERR_FAILED" followed by a line of characters and the name of the image is very common. Additionally, many say "Error loading resource:  TypeError: Failed to fetch" followed by "c3runtime.js:1080". 

Does this info help in figuring out the problem?

Additionally, playing on Chrome while in 'Incognito' seems to work, sound and all. 

Sorry, last update:

I have gotten the game to load fully upon repeatedly reloading the page. However, sometimes the sounds load, other times the sounds don't load, that is, if the game loads at all. It seems to have a higher chance of loading to completion on chrome if I have the inspect element tool  open. Is there a fix for this? I'd like my viewers to not have a seemingly random chance of playing my game and playing it with sound.

"Uncaught (in promise) TypeError: Failed to fetch" is the most common error it occurs hundreds of times each time I try and fail to load.

Admin (2 edits) (+2)

You’ll have to look at the full error message (including the stack trace) and potentially the network tab on the browser console to see what’s going on.

For example, the Failed to fetch error likely includes the URL or path it’s trying to fetch. If it’s not pointing to a file that you have provided in your project then you have a bug in your code.

The common pitfalls article I linked talks about using relative paths over absolute paths, and talks about some of the common errors people have when they don’t correct distribute their HTML game.

Hope that helps

What do you think about the game working perfectly in Incognito? I feel like it is important to understanding the issue but I'm not very well versed in coding stuff so  I don't know. Also, the game is coded using something similar to block coding, so I don't know if I'm using relative or absolute paths or if I even have a choice. My other Construct 3 HTMLs all worked though and I didn't do anything differently to export them.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.