iOS Recent Slowdown

Hello there. I have been playing Siralim 2 for about a year on my iPhone 6S, then stopped for about 2 months, and now have picked it back up. To my shock it is now running extremely poorly and I cannot figure out why.

iOS 10.3, Siralim version 2.4.0.

I’ve tried rebooting and have re-tested multiple times just to double check. The slowdown exists both on the overland map and in combat. On the overland map it speeds up when in an unpopulated section of map, and combat speeds up a bit once I’ve killed several baddies.

My perception is the # of sprites on the screen at once is causing a resource bottleneck. All animations are reduced in frame rate as a result, and I need to use Turbo battles and frame skipping to even reasonably play - neither of which was needed at all before.

From my experience with iOS game development, this slowdown seems quite unreasonable given the extremely minimal amount of graphic load being presented. But I haven’t seen any other complaints about iOS slowdowns on the forums or elsewhere (though there are many for other platforms), so I’m not sure what to think…

I appreciate any insight you could provide me with!

Graphics aren’t likely to be the bottleneck - it’s more about RAM than anything else. Do you have a lot of creatures in your stable (like, hundreds)? Or maybe a ton of artifacts or spell gems? Getting rid of items is probably the easiest thing you can do to help because you can either mass salvage or mass transmute your artifacts/gems. The one drawback to not having a limited inventory is that things can get a little cluttered and cause slowdown over an extended period of time.

Also, I know you said you have frame skipping enabled, but make sure you also have high performance mode enabled as well.

Hello Zack. Thank you for the response.

I loaded up XCode and profiled Siralim 2 to try and better understand the cause of the slowdown. As luck would have it, the slowdown wasn’t occurring today but I still collected data and observed some odd behavior.

In town the memory usage was peaking at 160MB with frame skipping and high performance enabled. After teleporting to an area and engaging in a few battles it would increase to about 218MB and hover there. This is a very low amount of memory usage given that the iPhone 6S has 2GB. Given that I’ve rebooted my phone prior to playing Siralim 2 each time I encountered the slowdown, I have to imagine most of the 2GB was actually available at the time.

CPU usage was around 70%, increasing to about 80% in battles which seemed rather high to me. I have been working on a Real-Time-Strategy game displaying over 20000 static sprite tiles and over 2000 animated sprites on the screen at once, all with A* pathfinding going on, and only use about 50% of the CPU on this phone. I suspect the Siralim 2 game engine may not be limiting the frame rate, so it just renders as fast as possible and hits the CPU hard?

Now here is where it gets weird…

Disable Frame Skip and High Performance mode did not affect memory or CPU usage at all. Even after going back to the city and back out and engaging in multiple combats.

Killing the game process and reloading saw memory spike to 250MB on the title screen, 300MB in town and 350MB in combat. I am not sure what to make of that. Are the high performance/frame skip settings only taking effect when you reload the game? Or is the iOS garbage collection just being lazy and leaving crap behind from the previously-running process? I don’t know…

I’d be interested in hearing your thoughts on this. Does this memory usage resemble what you’ve seen in testing?

Thanks for the response!

That sounds like a reasonable amount of RAM to use. Whenever a new sprite is displayed, the game needs to load a 2048x2048 pixel texture page that contains that sprite. I’ve optimized which sprites appear on certain texture pages as much as possible, but in the end, you’re still going to have several texture pages loaded into memory at the same time just because there are so many creatures in the game (I think the battle sprites alone require 2 texture pages, and overworld sprites are a bit more than that). Spell effects have a similar issue - each spell effect contains 8 frames, and each one is 64x64 in size. I think spells take up 3 texture pages in total.

FPS Skipping is really only useful for devices that, for some reason, impose a maximum FPS on the game. A lot of Android devices do that, and so does the PS Vita, so that option is just there to prevent the game from slowing to a crawl.

With all of that out of the way: what level is your character? Just trying to get an idea about how far into the game you are.

My character is level 92, and I am currently on level 35 of the dungeon. I’ve been focusing on building up my critter army quite a bit more than the main plot line.

Alright so I’ve had it slowdown on me a couple more times and I managed to catch it in the profiler again. Surprisingly, the memory usage is much less right now - 90MB or so during slowdowns in town, and about 150MB in a dungeon. But the CPU usage is exceeding 80%. It seems to begin stuttering just as it hits about 82%, and the game really grinds to a halt when it gets past 90% (usually in a battle). It makes sense the game would slowdown when the CPU is getting hammered, but I cannot see any reason for the game to be using this much CPU in a static fight like this.

On the overland map I’m noticing CPU usage usually is 70-79%. Occasionally it will exceed 80 and the movement becomes choppy, but then it goes right back down. A few times in the city my CPU went past 90% and wouldn’t come down unless I moved to the far top of the map.

What CPU usage do you expect from a high-end apple device? As a sanity check I am able to minimize Siralim 2 and launch 3D games like Fallout Shelter and run them just fine without any slowdown and less CPU and memory usage reported.

Thanks!

It’s likely that some specific configuration of traits/items/creatures is causing that to happen, especially since you said it was fine before. Some traits will take more processing power than others (some will take a lot more) simply because their effects require more calculations. Either that, or as mentioned before, you might just have too many items, creatures, or other objects at this point for your phone to handle - such is the problem with there being no limits to these imposed by the game. I’m sorry there’s not a better or more straightforward answer for that.

That seems extremely unlikely. Traits, spellgems, weapons in the bank, critters in my farm - none of these should be creating any load on the CPU while I am parked unmoving in the middle of a hunting area. I am observing the CPU being overwhelmed while absolutely no actions are taking place in game.

After some thought, since coming back it appears you added some sort of filtering to the graphics. Previously I would see a moire or line effect along the tile map where it wasn’t scaling properly. Is it possible the graphics pipeline needs some optimization, or the filtering is causing issues?

I am still curious what engine Siralim 2 uses if you can share it.