Long loading of the game on the site

Hello! I have such a question for you: when launching my game on the site, at first a black screen hangs for a long time (about 20 seconds), and only then a game loading bar appears. The archive of the game weighs only two megabytes. On the second and subsequent launches of the game, the download is fast. What could be the matter? Here is the link. https://yandex.ru/games/app/219757#app-id=219757&catalog-session-uid=catalog-16ebeb0b-23f3-573c-8c48-f9b222fb6668-1683006899983-ef10&rtx-reqid=3563477517552322750&pos={"listType"%3A"played"%2C"tabCategory"%3A"common"}

For me, it took over 30 seconds with a status set to “Connecting”. which seems to point to an issue not with the game, but rather the problem is with the server hosting the game. You may want to contact them to find out why there is such a noticeable delay.

Yes, I have already contacted them. Games from other game engines run fast there. The problem is with Gdevelop. There is some incompatibility with Gdevelop and this site. The APK with this game runs very fast. Maybe you can manually tweak something in the web build of the game

Unfortunately, doesn’t appear to be anything gdevelop specific. Checking a few other pages of that site shows just as long times to get past connecting status in my browser’s dev console.

Poked around at a few other games and it seems like anything that loads resources directly takes a long time. Maybe they compress the files into a single storage and have to decompress each file when it’s called, or each resource has to go through the same connection delay.

Either way that’s not necessarily something the devs on the engine could fix

Thank you for your attention to my question!

I’ve got the same issue when launching from Steam. But other games made with GD on Steam launch fine. So I’m exploring what options are right now. Will get back to you if I get any breakthroughs.

They helped me solve the problem. The problem was that for each extension function, gdevelop creates a separate file. There are a lot of files. They were uploaded to the server sequentially, one after the other. So there was a delay. I made edits to the indexHTML file so that the files are loaded in parallel and at the same time. But it works with web build. I’m not sure if it will be the same with Steam.

Uh… that’s not good. But thanks, that’s a good lead and I’ll chase that one down tomorrow.

Can you please explain how you did this magic trick?

I don’t understand programming and such things. This instruction was written at my request, by an experienced programmer. Here it is.

  1. Open the html index from the web assembly and add defer to each script inside the tag (<script defer src="…>)
  2. Then create an index file in the root of the project.js. In the list of scripts, add a link to this script (just copy the background. write the string and in the src attribute index.js .) ()
  3. Open the created index.js. And cut from index.html the contents of the lowest script tag and paste in index.js .

For these manipulations, I used the Visual studio code program.

2 Likes

I made a little mistake
2. Then create an index file in the root of the index.js.

Would be great to see several screenshots. Especially for #2 and #3. I should create index.js file in the same folder with index.html. Right? Then what does this mean “cut from index.html the contents of the lowest script tag and paste in index.js .”? What exactly should I cut?

  1. Open the html index from the web assembly and add defer to each script inside the tag (<script defer src="…>)

  2. Then create an index file in the root of the index.js. In the list of scripts, add a link to this script (just copy the background. write the string and in the src attribute index.js .) ()

  3. Open the created index.js. And cut from index.html the contents of the lowest script tag and paste in index.js .

2 Likes

We need to open the file index.html , which is located in the folder with the web assembly, and cut out from it what is indicated in the lower screenshot. And paste it into the created file index .js.

2 Likes