(Resolved) physics game lags bad after replacing device build

I’ve got a major problem.

Using various builds including the latest 12.986.

When I replace the device build of my game, the games lags badly. It looks like the frame rate drops drastically and is unplayable.

When I delete the app from the device and load a new build, the game plays as expected, no lag.

I’ve searched and the usual problem for the drop in fps is not removing Runtime listeners properly during game play, but I don’t have this problem. The laggy play only occurs after “replacing” the device build which leaves the games files saved to the device intact.

I am still using Ice as I’ve not run into problems with it yet, but not sure if this is somehow related.

Does anyone have any idea what is going on?

Nail [import]uid: 106779 topic_id: 34095 reply_id: 334095[/import]

Bump…No one has seen this before?

Thanks, Nail [import]uid: 106779 topic_id: 34095 reply_id: 135684[/import]

Nope. I’ve never seen that problem before. If you can tell us which device you noticed this on then that might be helpful. You can also try it on the Android emulator to see if this problem is with your specific device, or if it’s a problem with your game itself. [import]uid: 135827 topic_id: 34095 reply_id: 135688[/import]

Are you saving any of your game’s state out and reloading it (which would happen if you replace instead of a delete and add after a build)? [import]uid: 199310 topic_id: 34095 reply_id: 135704[/import]

Rob wrote:
Are you saving any of your game’s state out and reloading it (which would happen if you replace instead of a delete and add after a build)?

Yes Rob, I am saving game states and reloading them. I’m actually using your “loadsave” module to facilitate the operation.

I’m saving maps/display object attributes and level completion times.

My game is for iOS only. I don’t get the laggy performance when reloading on the simulator which uses the previous saved states/files. I only get the lag when replacing the device build with Xcode.

I am also not getting any pcall errors on the device, which I would think would surface.

I realize somehow the saved files are possibly causing the problem, just not sure what to do about it. I may be mis-using “loadsave” somehow, but it works so well on a clean load. I need to preserve the game state files when the app gets updated so the player doesn’t lose their progress obviously.

I have successfully taken the game state json files from the device and added them to the app itself, and can load them from the app on first play without any laggy performance on a clean install / deleting the previous build.

Thanks for the attention,

Nail

[import]uid: 106779 topic_id: 34095 reply_id: 135712[/import]

I’ve heard of people complaining that sometimes json.encode() and json.decode(0 don’t play nicely together and my save/load functions depend on those guys. I would suggest trying to capture what’s being saved vs. what you think should be there and perhaps some states are being set incorrectly and causing the issues.

[import]uid: 199310 topic_id: 34095 reply_id: 135836[/import]

Bump…No one has seen this before?

Thanks, Nail [import]uid: 106779 topic_id: 34095 reply_id: 135684[/import]

Nope. I’ve never seen that problem before. If you can tell us which device you noticed this on then that might be helpful. You can also try it on the Android emulator to see if this problem is with your specific device, or if it’s a problem with your game itself. [import]uid: 135827 topic_id: 34095 reply_id: 135688[/import]

Are you saving any of your game’s state out and reloading it (which would happen if you replace instead of a delete and add after a build)? [import]uid: 199310 topic_id: 34095 reply_id: 135704[/import]

Rob wrote:
Are you saving any of your game’s state out and reloading it (which would happen if you replace instead of a delete and add after a build)?

Yes Rob, I am saving game states and reloading them. I’m actually using your “loadsave” module to facilitate the operation.

I’m saving maps/display object attributes and level completion times.

My game is for iOS only. I don’t get the laggy performance when reloading on the simulator which uses the previous saved states/files. I only get the lag when replacing the device build with Xcode.

I am also not getting any pcall errors on the device, which I would think would surface.

I realize somehow the saved files are possibly causing the problem, just not sure what to do about it. I may be mis-using “loadsave” somehow, but it works so well on a clean load. I need to preserve the game state files when the app gets updated so the player doesn’t lose their progress obviously.

I have successfully taken the game state json files from the device and added them to the app itself, and can load them from the app on first play without any laggy performance on a clean install / deleting the previous build.

Thanks for the attention,

Nail

[import]uid: 106779 topic_id: 34095 reply_id: 135712[/import]

I’ve heard of people complaining that sometimes json.encode() and json.decode(0 don’t play nicely together and my save/load functions depend on those guys. I would suggest trying to capture what’s being saved vs. what you think should be there and perhaps some states are being set incorrectly and causing the issues.

[import]uid: 199310 topic_id: 34095 reply_id: 135836[/import]

Update.

I finally figured out what was causing the game lag. My FPS was dropping from 60 to 30 when I “replaced” my game or if the device was turned off and then rebooted.

I have been using the same config.lua for my games and had set “antialias = true”, which now defaults to “false” if unspecified.

I changed it to “antialias = false” and it solved my laggy game performance.

I really don’t know why the game would play smoothly at 60 FPS when installed to the device with a clean load and when the game was basically relaunched, would have the laggy frame rate.

I’m thrilled to know that json.encode and json.decode had nothing to do with the issue though. Thanks Rob for the sleuthing suggestion, I did look into the possibility.

Nail [import]uid: 106779 topic_id: 34095 reply_id: 136650[/import]

Update.

I finally figured out what was causing the game lag. My FPS was dropping from 60 to 30 when I “replaced” my game or if the device was turned off and then rebooted.

I have been using the same config.lua for my games and had set “antialias = true”, which now defaults to “false” if unspecified.

I changed it to “antialias = false” and it solved my laggy game performance.

I really don’t know why the game would play smoothly at 60 FPS when installed to the device with a clean load and when the game was basically relaunched, would have the laggy frame rate.

I’m thrilled to know that json.encode and json.decode had nothing to do with the issue though. Thanks Rob for the sleuthing suggestion, I did look into the possibility.

Nail [import]uid: 106779 topic_id: 34095 reply_id: 136650[/import]