LiEnby / chovy-gm

At long last. GameMaker 8.1 to PSP!
GNU Lesser General Public License v2.1
42 stars 4 forks source link

Game crashing when big objects persist in room changes #20

Open m1s3ry opened 3 years ago

m1s3ry commented 3 years ago

Edit: I found out why the game was crashing in the first place: It looks like if you have a big enough object with enough variables that is persistent, when changing rooms the game crashes.

I'm trying to port Super Crate Box. I have the source code and I'm adapting it to the PSP limitations, but the game will crash on startup.

I already ported a super small project and it worked fine, but now I'm porting thos project that's a little bit bigger (around 6mb) and it always crashes the PSP after the splash screen. I don't know what it is, because I'm now testing by creating a previous empty room in the project that does nothing and it still crashes, so it seems to be crashing when loading the game files.

LiEnby commented 3 years ago

6mb project files? gees i didnt even know GM81 could do that shit tbh

m1s3ry commented 3 years ago

I have a workaround. It's not ideal but: I have to write every variable of the persistent object in an ini file, then delete the object before switching rooms, and then creating it again and reading every variable from the ini. Is not ideal in the slightest, but hey, Super Crate Box is running at 60 fps on the PSP!

LiEnby commented 3 years ago

so what persistent objects memory leak? i guess?

m1s3ry commented 3 years ago

I don't know, but memory overflow sure. It seems that GM converted projects with chovy struggle a lot when loading rooms, even if those rooms are empty, so maybe there's the problem. I also found a lot of functions that don't work when converting the projects, but I found workarounds for some of them. I think surfaces related functions also make the game crash, so I had to disable those from the port.