3D iOS Games by Tutorials Discussion

Can anyone point me to where the resources and projects folders are? I am only finding the projects for each chapter in the downloaded folder.

Hi there,

You’ll find the resource folders typically under one of three folders - “starter”, “final” or “challenge”. For chapter 1, you’ll find a resource folder under “01-scenes/projects/starter/resources/”.

Hope that helps. Thanks for your support!

i love this book
im on the end of project 3 now (i went trough the other 2 quickly since i knew this stuff already, yet reading it to see if there might be some better way to do stuff)
it has great stuff explained really good (like using normal maps and stuff)
but for my own game im looking to use a different type of game, not really a maze and not with pearls of life, more with collectables that they need to collect and with enemies
now it comes
 lol
i have a question on using normal/light maps
does it use a lot of memory to use them on a player object together with many other objects that are illuminated good ?
i would like to use them on objects in my game that need details, but im afraid ill suck up a lot of the memory, specially on older devices

At the end of Chapter 10, is it expected behavior for the ball to bounce at an irregular angle when hitting the area between bricks and segments of the paddle?

I also have this problem on an iPhone 6S+. The barriers and paddle sides randomly disappear when the ball collides with the bricks, and then re-appear after a few seconds. It doesn’t happen on an iPad 3, though. Both devices running iOS 9.3

Hi @orle, I had a similar problem and was able to resolve by clicking: Geometry Sharing → “Unshare” (under the Attributes Inspector of Scene Editor) for each of the nodes that were displaying the weird behavior (disappearing / appearing).

For me, the random disappearance happened for both iPhone and iPad (physical devices). The left barrier, and the right node of the paddle kept disappearing and appearing. After clicking Geometry Sharing → “Unshare” for those nodes, I was able to fix the problem. Hope this helps.

2 Likes

@sanjib , great! it fixed the problem, thanks a lot for your advice!

Hi there,

Glad to hear that you’re enjoying the book! :]

Scene Kit can handle massive textures - 4096x4096 pixels (this is device dependant, I do not know the exact details). Most of the time, you typically won’t use a texture of that magnitude on any character. My suggestion is to try out the same texture for the material at various smaller sizes, until you reach the smallest size that’s still acceptable to the eye. This approach will make sure that you’re not “abusing” the memory.

Another thing to point out is that Scene Kit can “Share” materials - this a great memory saving feature you should definitely make use of. When you “Unshare” the material, an new instance is created.

Coming back to your question - Material textures are definitely memory hogs, try and use/share the same material more than once on multiple objects. This won’t push up the memory usage, regardless of the amount of objects that shares the same material. Try to keep your textures as small as possible - chances are, you’re probably using a too detailed texture map anyways.

Your main concern with older devices should rather be performance. Special material features like normal mapping for example can be very expensive. Keep an eye out not to over-use these special features. If you keep the performance above 60fps, then all should be good from a memory perspective too.

Hope that helps. Thanks for your support!

PS. Good luck with your game! :]

Happens on my iPhone 6 plus also running 9.3

With Mr. Pig, if you close the game (but keep it in multitasking), and come back to it later, the frame rate drops to ~35 fps and all the cars assume the same position. Does this happen to anyone else? I guess this has something to do with actions’ progress not being saved when closing?

Hi @scowart , I followed @sanjib advice a couple of posts above, and it fixed the problem. You should give it a try.

It doesn’t ask me if I want the dae imported as a scenekit scene
 It just imports it as a .dea , no questions asked. I’m just dragging it in to the project. Confused, but I would love to import them like the author had them. I’m I doing something wrong or could it be something in preferences.

Thanks For the answer
I reduced normal mapping to only 3 objects
And Yes i do use shared textures after Reading About it
Thanks For the great book
(And sorry For typo’s, im On the way to comiccon So im On my iPhone)

I’m working on MarbleMaze, and I wanted to ask if anyone could explain the reasoning for moving the ball up to y10 in the reference node rather than moving the instance of the node up to y10 in the game scene. Thank you! Having a lot of fun with this book.

Maybe. I haven’t tried this yet. @chrislanguage could you help with this?

glad to know such content as in this mottos

Maximillian, theres no need to convert using Blender. Simply add the voxel .obj file to the xcode project, assets folder. Then convert it using Xcode.
With the obj file selected go the Menu Bar > Editor > and selects "Convert to SceneKit Scene file format .scn 
Select duplicate or convert (overwrite) option. Boom!

In chapter 2, I’m trying to set the scene background using:

func setupScene() {
   scnScene = SCNScene()
   scnView.scene = scnScene
   scnScene.background.contents = "GeometryFighter.scnassets/Textures/Background_Diffuse.png"
}

When I run the program, the background IS diffuse, but it’s gray scale, not bluish. I’m using Xcode 8.2.1. Do I need to change anything in the Main storyboard to get the main scene to be blue tinged?

1 Like

I see the same behavior in the “final” project chapter 2, so at least it’s consistent.

Looks like this is also being discussed here: