Hey everyone,
I’m currently working on a game using Phaser version 3.80, and I’m encountering a major issue with memory management. My game assets are quite large, taking up around 1.5 GB of memory. When I run the game on mobile browsers like Edge or Chrome, it crashes due to insufficient memory.
I’m hoping someone here has experience with optimizing memory usage or implementing on-demand asset loading in Phaser. Here’s a bit more context about my problem:
Current Situation
- Phaser Version: 3.80
- Asset Size: Around 1.5 GB
- Browsers: Edge and Chrome on mobile devices
- Issue: Game crashes due to high memory usage.
What I’ve Tried
-
Loading Assets: Initially, I loaded all assets at the beginning. This works fine on desktop browsers, but it’s a memory hog on mobile.
-
On-Demand Loading: I attempted to switch to on-demand loading by removing assets and loading them just before rendering. However, this approach led to rendering issues with images and styles appearing incorrectly.
What I Need Help With
-
Memory Optimization: Does anyone have any tips or best practices for reducing memory usage when dealing with large assets in Phaser?
-
On-Demand Loading: How can I properly implement on-demand loading without causing rendering issues? Are there any specific methods or techniques I should be aware of?
-
Case Studies: If anyone has successfully tackled a similar problem, I’d love to hear about your experience and how you managed to optimize memory usage or implement on-demand loading.
Any advice or suggestions would be greatly appreciated! I’m really stuck on this and could use some expert guidance.
Thanks in advance for your help!
Best regards,