Cause lag problem while switch from background to foreground on IOS (IPAD mini 2)

There seems a problem while I switch the game to background and return.

The game become very very slow.After I switch again,this maybe recover or still be.

Could anyone test this?

Thanks.

on IOS 9.1 ipad mini 2
The way iOS works, more or less, is that when a program is no longer "resident" it's unloaded. This applies to most software that doesn't actually run in the background. So in a sense, if the webview cache doesn't have the files it has to re-check all the files again. I'm not actually sure how much of the "web browser state" is actually preserved in the process.
So,anyway to solve this? 😀 If apple review team found this and pay attention,they may reject I think.
Ouch, this could be a big stumbling block for iOS deployment if it's consistent.  I'll test this weekend and report here.
Ouch, this could be a big stumbling block for iOS deployment if it's consistent.  I'll test this weekend and report here.
Seems there is same problems on phonegap games.

Some solusion said  there're maybe 2 ways.

1.reduce the size of the image atlas.

2.restart the game automatically while resume.

> 🙁
So good news & bad news.

So I made a very simple game for testing: 1 22x20 map consisting of grass and trees only, no animated tiles, no plugins, no parallaxes, no parallel processes, 1 event that just walks around randomly mid-speed, and gives a short dialogue if touched, and 1 stationary event starts a battle when touched..

The good news: on my iPad (third generation), iOS 7.1.2 if I put the rv app in the background and then return to it, there's a moment where it's frozen after it first returns to full screen, but after that it plays about at the same speed as when played from a fresh launch. 

The bad news is that speed, the speed I get even when launching fresh, is pretty bad: map scrolling when moving is jerky, jagged, there's about a half second delay between doing the double-tap and the menu popping up or closing.  It is overall choppy enough that I could not entertain any kind of commercial release on iOS if this is the standard.  I had already ruled out deploying to phone because of reports of lag and limitations of the non-native HTML5-in-wrapper app, but I'm really hoping I don't have to rule out tablets as well.

I then upgraded the iOS to 9.1, and now the game runs even slower upon launch.

Seems there is same problems on phonegap games.

Some solusion said  there're maybe 2 ways.

1.reduce the size of the image atlas.

2.restart the game automatically while resume.

> 🙁

atfield, were those things suggested as tweaks one can make to cordova settings/build process?  # 2 sounds like it would violate apple's usability guidelines anyway, providing another road to probable app store rejection.

Does the game run smooth for you before you place it background and return?

Maybe the 2012 3d gen iPad just won't run mv apps well, but later tables can?  I'm going to start a separate thread asking for reports of speed from anyone else running tests on iOS, to get some more data points.
Apple can reject anything if they feel something wrong.Even the problems like fullscreen problem(run with black margin) or can not run on very low device(like itouch 4.0)

But not happenes everytime.But once they checked out,you can not make them ignore this in a same thread so you must start a new post  to test your luck or fix the problem.

My test game plays well on ipad mini 2 ios9.1(plugin,weather,big scene,audio,animation all included.So these are not the problem) if dont change to background and resume.But even resume back not lags(I mean walk low,text appears slow,every slow) everytime and you can reswitch several times and maybe the lag disappeared.

I don't think apple team would really pay attention to this problem.But very sure the user would not know how to solve the lag.(They wont have patient to switch around back and forth again and again and wont restart the game)

They will do 3 things. 1.shut down the games  2.delete the game 3.rate 1 star and write rude review for your game.

The fix suggestion seems not easy to deal with.Reduce resources I said maybe mean delete the pictures you dont need and make the tileset pictures smaller(so you cant be very convient to use the default tilesets)

Restart the game needs a native detection. I don't think there are many people pay attention on mobile use so there wont be a exist plugin for you. Maybe you can just do something on the converted ios xcode native project.

Even restart the game is a good way to solve lag but may cost player losing their current progress and make them mad.Then the 3 bad things happen again. BD

If you write a new thread,maybe you can let me know.
What it boils down to is that MV games are not "native" apps, they are HTML5 apps, MV (and previous RPG makers) targeted desktop systems, so the programming design retains this.

What people get riled up about is how something performs wonderfully on one platform (eg a desktop) and then is a poor experience on "something that looks the same" eg an iPhone vs a 99$ android phone. The performance gap between the highest and lowest performing device for a mobile phone and a desktop is actually quite wide. The weakest devices are barely more powerful than a computer from 1999. The most powerful mobile devices are about the same performance as mid-tier desktops under some conditions. But they also cost more.

A 600$ Macmini is power powerful than a 1000$ iPhone 6. Current devices that run iOS 8 or iOS9 still include 4 year old devices (iPhone 4S. 5th generation iPod touch, iPad 2 and iPad mini) It can be expected that these devices will still be around for up to 8 years. Thus people will complain that your game doesn't work on their device, even though their device is well past point of use.

Like... I'd really suggest not making any kind of "minimum requirements" more than vague "requires iOS 9/Android 5.0" or whatever is the current version at the time of release, because that at least sets the expectation that if they can't run the current OS their device is too old. But at the same time, the performance gap between devices is still large. You can run Windows 10 on devices that were built back in 2000 too... if you somehow find a device from 2000 that came with 1GB of ram. You can also run OS X 10.11 on some 2007 Mac's. The only machines that can't run current OS X are the early models that can't boot 64-bit kernels. Mac Models before 2006 used a different CPU entirely.

But the performance gap between "able to run" and "runs well" is pretty large on everything except dedicated game consoles. This is why the Console version is often "not as good" as a "PC" version, but only if the PC has overkill hardware. Case in point are games like FFXIII and GTA4/GTA5 which were designed for consoles, but their PC versions are often "horrible", while PC games like Portal and Mass Effect are better on (a high end) PC, but their Console versions are kinda neutered.

So going back to the topic.

If you are creating a game that you want to sell on an mobile device, then you must design it around the much lower performance of a mobile device, which means very small maps, and not huge amounts amounts of events.
atfield, thanks, that's good info.  I started a new, more general 'how's deploying to iOS working for you?' thread here, in case you want to comment there too.  I agree, both those fix suggestions for the lag-when-returning-from-background issue seem problematic.  I mean, cutting down on the number of graphics is totally doable, if that helps, but I agree that restarting the game when a user returns to the app, even if possible, is just as likely to piss off users as the slowness.

KisaiTenshi, I agree with your points.  That's why, as I said, I had already given up the idea of deploying to phones entirely, given the combination of MV's mobile app not being native and the wide discrepancies between power of hardware on phones.

However I was hoping that Apple tablets in particular could be safer to target, since A ) they're in general more powerful than phones B ) their hardware is known and has a very finite number of variations. Also, as I mentioned, I restricted my test game to 1 small map, and 2 simple events (in line with you're statement "If you are creating a game that you want to sell on an mobile device, then you must design it around the much lower performance of a mobile device, which means very small maps, and not huge amounts amounts of events").  And it is possible to mark you app in Xcode as targeting iPads only.

But maybe as you say, the hardware discrepancies between even the iPad versions are too much to guarantee a experience that would not have the majority of users on older iPads complaining.

As you point out, even restricting the iOS version to iOS9 wouldn't help yet, as I can install iOS 9 on my iPad 3rd generation, and it seems right now like the iPad 3rd generation is possibly not capable of running an MV-made app at a reasonable rate. 

But maybe there's some tweaks to MV (I've read it's tile-rendering system is vastly inefficient, and that alternate ways of loading assets could alleviate in-game lag at the expense of longer loading times) and/or to the cordova mobile-app-wrapping process that could move MV mobile apps to a generally acceptable state, at least for Apple tablets?

That's why I started the "post about your iOS deployment experience" thread - to see if there's a consensus of 'there's too many issues for this work', or if particular issues can point to either MV engine or cordova build-process optimizations.

If even restricting mobile deployment to just Apple tablets is not viable, I'd need to decide between just using MV for desktop PC/Mac deployment, or looking at other cross-platform development tools again...
To be fair, the iPad3 (which I also have) actually runs iOS 9's Safari rather poorly. So you're not imagining things. The iPhone 6S has no problem though. The iPhone 6S's performance however is nearly the same as a 2012 Macmini. 

Like, I really feel that the HTML5 export was the right direction (after all, it's possible to port all sorts of other stuff to it), but there is too much naivete in how it's a direct translation between VX ACE's Ruby to Javascript that it still has a performance problem. Like everything from how the map is drawn to how the events have to be re-parsed every time the maps change probably makes it worse than it needs to be.

But I have some faith in the developers to either solve it, or apologize for releasing a broken product and going back to the drawing board and create a native engine.

Original thread: https://forums.rpgmakerweb.com/threads/cause-lag-problem-while-switch-from-background-to-foreground-on-ios-ipad-mini-2.50280/