Hey folks! Jonny from Fatnose Games here.
We're working on our follow-up to Along Came a Spider, and our game seems to be exceeding the 16MB limit imposed in the Simulator (and on device), preventing it from running. I'm wondering how I might go about determining which assets / code are the... bloatiest
Using the simulator I've been prodding at the lua console a little -- using collectgarbage("count")
I've been able to determine the total memory footprint of the game currently (just over 16MB). But I've been unable to figure out how to print in any meaningful way what code / assets have been loaded at all, let alone how big they are.
First of all, I'm not sure where the loaded assets are being stored in the lua runtime -- I can see that there's a global playdate
table, but for the most part all I can see are utility functions for various playdate systems, i.e. mostly the lua SDK functions. I've tried disassembling the main.pdz and data.pdz files to no avail.
What I do know though is that if I delete enough songs from the game, and then reload the PDX into the simulator, the game runs. So my assumption is that the game is loading all of the assets in somewhere, even if they're not immediately needed? I just need to figure out where, and once I do, I can determine which assets need trimming down.
Any advice would be really helpful!
Cheers,
Jonny