Hello everyone!
I’m developing a game with a single scene, and it’s quite heavy.
Is there a way to progressively load code and objects during gameplay, depending on the player’s progress?
For example, when the player reaches level 2 and gets a new weapon, the game starts loading the weapon they’ll receive at level 3—all within the same scene.
I’d appreciate any ideas!
Well, GDevelop’s progressive loading model is based on scenes so the easiest way to achieve this would be to cut up your game into separate scenes
GDevelop’s architecture doesn’t allow loading a scene if all of the resources it may use are not loaded - you would need to get your hands dirty deep inside GDevelop’s internals to get it to work any other way.
You can share your events between scenes using an external event to make this workflow easier.
Could you explain how external events can help me?
I experimented with them, but they didn’t produce the desired result.
Oh, and I almost forgot to mention—I’m concerned about my game’s loading time. Right now, it’s quite long. The main issue seems to be the amount of code. Currently, the art, music, and fonts take up 3 MB, while the JS files take up 10 MB.
I tried creating a preliminary level where I removed all unnecessary objects and code. By saving the player’s coordinates, I was able to move the player to the next scene after it loaded, and it worked. However, my game is already published, and this update would break the game if a player has a saved progress.