Game is taking very long time to load


#1

Hello, I’ve been making a top-down Zelda style game. Loading the game to test it is getting slower and slower. It now takes about a minute to load. Is this normal? I’m fairly new to the program.


#2

You mean the game-preview in GD or exported to itch.io, etc.?


#3

Possible problems…
Low ram available
Use of physics (I don’t think you used physics)
Creating objects ( this should be the problem)
It could be you have an action creating an object without a condition. When this happens
, it creates same objects multiple times(non stop)


#4

I mean the game preview I guess. The thing it takes you to when you press the play button in GD.


#5

I don’t think I have an action that continuously creates an object. But I do have lots of scene variables and global variables. Could that be the issue?


#6

And I didn’t use any physics as far as I know.


#7

Not sure if variables are the problem because I have a game with a lot of variables and it loads in approx 10 - 15 seconds (it’s a large game)


#8

Could it be too many global objects?


#9

Okay. I don’t know your game and system, but a minute doesn’t sound normal.
I have 10 scenes, ~20 global objects, 800 images and it takes <10 seconds.
Maybe you can delete a few things to test where the problem is.


#10

I don’t think variables could be a problem. Do you use large images? (>1000 pixels)


#11

Yes, some of them are many pixels. A lot of them are made in boxes that are 64 pixels wide and 64 pixels high and sometimes the boxes are filled in with a color. I made some floors images that would have far more than 1000 pixels but they are just in my resources. They aren’t actually in the scenes, so I’m not sure if that would affect the loading time. So far I have 26 scenes. I have 117 global objects and almost 100 global variables.


#12

What if you try doing a copy and eliminate the other scenes?


#13

Neither your pictures, scenes or variables amounts should affect the performance that way.

If that behavior started after some change in the events, then the problem is in the events.

For further help it would be useful to know the specs of your computer and the events of your game.

I recently had a very similar problem with the game I’m developing. After some changes in the events the game started taking up to 45 seconds to load and showing a noticeable FPS drop. To solve it I used the profiler/debugger bundled in GDevelop, that way I found the sections of the events that caused the problem and optimized some routines. The problem was with a massive amount of object timers and a massive amount of collision detections per frame, so I had to get creative to do the same things (more or less) in a different way. But I have to say, it was relatively easy to found the problem because I have my events classified in event sheets and event groups.