Posts

Post marked as solved
15 Replies
3.5k Views
So I have been working on a game using SpriteKit, utilizing the scene editor. Has been working very nicely, up until I was required to update to the latest SDK. I have been too busy lately and haven't gotten to work on it again until now... so it was flawless when I was running iOS 12 on my XS. My device is now iOS 13.3, which forced me to update to the latest version of Xcode (11.2?). Now, my app crashes, all textures from every SKSpriteNode in the scene are nil when getting references to them. They load just fine in the scene editor itself. In code, however, in the sceneDidLoad override, all of my childnode calls succeed in getting the SKSpriteNode reference, but texure is always nil... which then blows up my texture based PhysicsBody instansiations. The scenes entities structure also seems empty (so I'm not sure how I'm getting references to SKSpriteNodes, but I am). Just seems like GKScene fromFilename is loading an empty shell of my sks file.This a known issue with the new tools? What did Apple change to break this? Anything new introduced that I need to be initializing? Should I be forced to update the project to Swift 5 to get rid of the issue? Not the first time Apple has changed something drastic in the application lifecycle that completely breaks every one of my apps, and I have to scrounge around for a different way to initialize the various components to get things to work again. Frankly I'm getting sick of it, spending more time fixing things from the complete disregard for any semblance of backwards compatibility in these SDKs than I do creating new functionality.Thank you 🙂
Posted Last updated
.
Post marked as solved
2 Replies
905 Views
I’m pretty new to SpritKit, and am trying to figure out the best direction to take when creating the maps for a game I’ve started.The maps are track-like... sometimes a road sometimes a tunnel, etc. I‘ve creates two levels so far, and they work great. They are currently giant 5000x5000 pixel images with a matching 5000x5000 pixel mask image overplayed and hidden for the collision detection. Performance is great, works like a charm. However, app size is my concern. The PNGs are pushing 8-10MB, and I fear the game will quickly turn into a needlessly large download as soon as I get a small handful of levels in there. They are very cartoonish and hopefully Xcode compression routines will go a long ways... however, would a tile based setup be better vs. a single monolithic image?Some if these maps have an extreme amount of trees. The level that sparked my concern is a road going through a forest (top down and cartoony 2D). I know that I‘d save tons of space, and have a much smaller app package if I pieced the map together reusing a small handful of tree sprites all over the map vs. one giant 5000x5000 pixel image with the trees drawn on... but how will that perform? We’re talking 1000+ tree sprites vs. a single giant SKSpriteNode.The giant image route is quick and easy to create levels, but not at the cost of my app being 2GB in the App Store 😟. Or will the PNG compression processing during the publishing step be extremely significant? If I go the individual sprites route I will likely need to take s step back and create a level editor and my own “map file” format... cause from what I’ve seen so far, the scene editor is not going to handle what I need to throw at it to do this.Thanks!
Posted Last updated
.