[Reason found] HTML5 game not loading properly

Hi!

I confronted an intresting problem, when publishing HTML5 games in the web hotel. This applies especially the games having lots of objects and images.

Here is the example. When I put the game into itch.io, it looks just as it should:

However, when I uploaded the identical files into the web hotel, the loading fails every time when loading the game for the first time. It looks like this:

When I reload the page, the game looks normal (or at least less unloaded objects). However, when I clear the browser cache, the problem comes again.

The same phenomenon can be seen with Firefox, Chrome and Edge, and in Windows and Chromebook. In other words, the problem doesn’t seem to be OS or browser-based.

It looks like that the game doesn’t even try to load all the object resources (the loading bar doesn’t seem to appear between the start scene and play scene).

That sounds more like you’re having timeout issues, rather than it starting before it’s done loading.

You can try a few things:

  1. Force all of your resources to preload. Probably not recommended, if the server is really slow, it could take ages.
  2. Make a manual loading scene, with your own loading message. Then have the condition “(Scenenamehere) has finished preloading” , with (Scenenamehere) being whatever the next scene is. Then have the action to change to that scene. If this doesn’t work, then your host is likely outright timing out entirely and severing the connection.

Hi!

Thank you for your response! Unfortunately these solutions didn’t work. :frowning: In Resources tab, I didn’t find the way to force the image files to preload (I guess they are preloaded anyway). For audio files there are three different options for preloading.

I made the separate loading scene, which is between the start scene and the game scene. However I noticed, that the game didn’t even try to load anything during the load screen.

With Firefox Network inspecting tool I finally managed to figure out, what is going on. You were right, the problem is really on the web hotel provider side. The screenshot below shows the core of the problem:

First the browser succeeds to load images, but suddenly the server starts to return 403 (forbidden) error. Also the error log of of the web hotel (cPanel) shows the error: “Client denied by server configuration”.

Googling revealed, that most likely the web hotel has the protection mechanism for Denial-of-Service (DoS) attacks, here an attacker will make lots of requests to the site, hoping to use up all of CPU and memory resources and stop the site working and denying service to legitimate users. To prevent DoS attacks, server allows only the certain number of requests to the same page during certain time period.

The protection mechanism itself is good, but in the case of the game having hundreds of objects (which is typical, if you have several characters having animations for idle, walk, run, jump, crawl, climb etc.) the mechanism turns against you.

I’ll contact web hotel server provider and try to find out whether there are some ways to suppress protection mechanism (e.g. with .htaccess configuration). If there is a way, I’ll put it also here, because altough this was not a bug of GDevelop, also other users may confront the same problem and this will serve as a documentation of the problem, cause and (possible) solution.

I got an answer from the web hotel provider. According to them, the reason for this behaviour is mod_evasive (Mod_evasive Configuration with Apache on Ubuntu Server 16.04 | Anansewaa) which is running on the back of the server.

Unfortunately, as a web hotel customer I am not allowed to configure mod_evasive settings. That’s undestandable and nowadays it’s also highly recommended to keep these kind of protection mechanisms on.

So, it looks like that the web hotel provider I’m using is not suitable releasing platform for bigger online game projects having lots of animations.

Hopefully this description helps someone who confronts similar problems.