IOS 13 the fps drop and collision issues.

ios 13 the fps of the game starts to get reduce to 30-35fps. Also Sprite node is sometimes detection collisions and sometime not. My game was working fine before IOS13 update

Replies

I can't say anything about the fps, but there's definitely something going on with iOS 13 when creating an SKPhysicsBody from a texture. Here's the same game with showsPhysics turned on under iOS 12 and iOS 13:


https://i.imgur.com/vsGZLLz.png

I submitted a feedback about the physics bodies not being created properly in the iOS 13 beta on August 31. There is clearly a problem with creating physics bodies from textures. Further, it doesn't seem to matter if the texture is one in the app bunlde or one that is created dynamically at runtime.


Originally, I thought that this was isolated to app created using the iOS 13 SDK, but now that it is released, it also appears to impact apps built with a previous SDK if they are running on iOS 13. I haven't heard anything back on my feedback since Sept 4 when they asked for the image files. I uploaded them the same day.

Thanks for the info. I also sent them some feedback with a simple example to reproduce the issue. I guess we'll write our own wrapper to generate an appropriate boundary from the texture and use init(polygonFrom:) for physics bodies where we need more precision than a circle or rectangle.

Hi bg2b, I had the similar issue when generating physicsBody from texture on iOS13. After exploring couple of different ways to overcome this bug I manage to “fix” it the following way: 1. Imported image asset (in my case transparent PNG) into Photoshop 2. Select the “physicsBody” area and fill the section black 3. Save as PNG 4. In Xcode I had to create new Atlas folder and import it into newly created folder 5. Then in code use the newly created image as the input into physicsBody method Not ideal, but in my case where I don’t have many assets < 20 the effort taken to create new images wasn’t bad and temporarily fixed the issue.

We wound up rendering the textures into a CGImage and doing a convex hull approximation for pixels above the alpha threshold. For our textures that's pretty close to the result we get on iOS 12.

Same here.

It completely broke my game.

I'm desperate 😟