Post

Replies

Boosts

Views

Activity

Reply to SpriteKit iOS 13 Swift 4 textures nil
This is a snippet from where I'm loading the scene from the sks file:if let scene = GKScene(fileNamed: level.File) { // Get the SKScene from the loaded GKScene if let sceneNode = scene.rootNode as! GameScene? { // Copy gameplay related content over to the scene sceneNode.entities = scene.entities; sceneNode.graphs = scene.graphs; // Set the scale mode to scale to fit the window sceneNode.scaleMode = .aspectFill; ....The GKScene load above is being triggered by an UIButton touch up from my main view controller. The GKScene instantiation is what is firing off the sceneDidLoad callback within my GameScene class.Inside my sceneDidLoad I have a pile of these for masks, objects, enemies, emitters, etc.let firstMask = self.childNode(withName: "//Mask") as? SKSpriteNode;let player = self.childNode(withName: "//Player") as? SKSpriteNode;then, where it crashes is here, because texture is nil:mask.physicsBody = SKPhysicsBody(texture: mask.texture!, size: mask.size);Now, what's odd, is that both "Mask" and "Player" exist in my scene editor, and as I said worked in iOS 12 just fine... The element "Mask" above IS loading into the variable firstMask, but it's texture and other properties are nil. "Player" is in my scene editor just fine as it always was too... but that player variable is coming back nil. It's almost acting like sceneDidLoad isn't finished loading the scene really, and my first few childNode calls are getting "something", but then later ones are not.If I comment out all of my sceneDidLoad code the next line to capture my sceneNode fails, because scene.rootNode is also null.if let sceneNode = scene.rootNode as! GameScene? {The entire GKScene call is just simply failing to load my file, and it makes no sense. Like Apple changed the structure of the file, but aren't throwing any errors about it failing to load, just handing back an empty trash structure of partially loaded elements and mostly nils.The whole viewDidLoad vs. viewWillLayout is exactly what I had to battle with back when I was doing some raw OpenGL stuff. But I don't see any similar overrides for SpriteKit. There's sceneDidLoad, didChangeSize, and willMove, that's about it. No others than sceneDidLoad seem applicable to initialization here for me to move my initialization code to.I guess my next step is to try and create a new sks file with the new version of Xcode to see if that one loads as a GKScene properly. If that works, I'm not going to be happy. I have countless hours into creating these game files, and I don't want to have to redo them all (already tried just opening and resaving one, that didn't make a difference).
Dec ’19
Reply to SpriteKit iOS 13 Swift 4 textures nil
SURE ENOUGH, creating a brand new sks file DOES load and work properly. Objects loaded, rootNode was not nil. None of the 40+ sks files that I created using Xcode 10 and the older SDKs load. They all flake out with mostly nil values and a nil rootNode.There has got to be a way to get these to work again without having to recreate my entire book of content. That's enough to simply make someone dump the entire ecosystem and simply forget about it. Imagine if I had 10 other games out there already and this happened? Holy mother of...
Dec ’19
Reply to SpriteKit iOS 13 Swift 4 textures nil
More information. I rebuilt one level up to the point it stopped working too.Texture Alpha Masks are the issue. I use them all over the place, because my levels contain complex winding tunnels. If there's an alpha mask in the level it ***** 😟 This isn't some lifecycle change during initialization, it's a full out bug that's likely going to require me to wait for iOS 13.3.1, or whatever, hotfix release before I can continue development.
Dec ’19
Reply to SpriteKit iOS 13 Swift 4 textures nil
Thank you.Now what I'm unsure of, is if it's a bug in the iOS 13 SDK? Or iOS 13 on the devices themselves? I'm guessing the SDK, because if every game on the App Store that uses texture physic masks broke there'd be a much bigger outcry. Or maybe there is and we just don't hear about it p, because its being directed at the developers themselves via negative reviews.I can't backdate my phone to 12.4 again, that window is already closed, Can't use the simulators, my game depends on constant gyroscopic movement... can't even begin to test with a simulator. I'm stuck waiting for a fix 😟
Dec ’19
Reply to SpriteKit iOS 13 Swift 4 textures nil
So it “is” an issue with iOS itself, given that you have backup methods in place in case the user is running 13.0 or 13.1? None of my physics bodies from texture are coming from an atlas, and under 13.3 completely broken. Not a case of them acting funny, but rather the entire sks fails to load. Convex hull approach is far too much work for my game. Based on how little time I get to work on it, the majority of devices out there will be running iOS 14 before I’m ready to release.
Dec ’19
Reply to SpriteKit iOS 13 Swift 4 textures nil
I have a support assistant ticket going that has been getting some response from Apple that they are working on it, and will have something in a future release. In the meantime, they offer the following workaround below. I haven't had luck with it yet. Yes, I don't get the crash on the physics body creation if i follow the step below if not setting them up in the sks file, but instead I'm now crashing because half of my nodes in fetching by name are coming back nil instead now, one of them being the camera! Maybe you'll have better luck with this:Apple suggested workaround:----------------------------------------------1. Set physics body type of problematic sprites to “None” in the .sks file.2. Generate and set the physics bodies at runtime using SKPhysicsBody.init(texture:alphaThreshold:size:)Here is an example of the suggested workaround applied in our Xcode Game Template with SpriteKit and GameplayKit selected:// Get the SKScene from the loaded GKSceneif let sceneNode = scene.rootNode as! GameScene? {// Copy gameplay related content over to the scene sceneNode.entities = scene.entities sceneNode.graphs = scene.graphs// Set the scale mode to scale to fit the window sceneNode.scaleMode = .aspectFill// Generating physicsBody for sprites at runtime based on their texture’s alpha channel. sceneNode.children.forEach { if let sprite = $0 as? SKSpriteNode, let texture = sprite.texture { sprite.physicsBody = .init(texture: texture, alphaThreshold: 0.1, size: sprite.frame.size) } } // Present the scene if let view = self.view as! SKView? { view.presentScene(sceneNode) view.ignoresSiblingOrder = true view.showsFPS = true view.showsNodeCount = true view.showsPhysics = true } }----------------------------------------------
Apr ’20
Reply to How do I delete my developer account?
Can't even use Contact Us to do this. The dropdown only provides the accounts that are "active", I can't select the developer account that has not been renewed... and I don't want to select one of the other teams for fear of them shutting that one down instead. Can't initiate a transfer of ownership either, none of those options are available unless I fork up another $99 to renew the account.
Nov ’20
Reply to failed to prepare device for deployment
Rebooting both devices does the trick for me, but would be nice for a fix so that all this rebooting doesn't have to constantly occur every time I want to work on one of my apps. Rebooting to fix issues is time consuming and annoying, rebooting to fix issues is such a "PC/Windows" thing to have to do. Part of the reason I love my Mac so much over my Windows PC was because I got away from stuff like this.
Jul ’22