Hello Guest

Author Topic: iOS Setup  (Read 3627 times)

pascal_mueller@gmx.net

  • Newbie
  • *
  • Posts: 4
    • View Profile
iOS Setup
« on: December 19, 2013, 03:39:39 am »
Hey,

first of all I have to say I am a great fan of the 2d Toolkit. You have done an awesome job so far. I used 2dToolkit with my first iOs project and I run into a couple of memory problems. I read quite a few posts and articles about that and there seem quite a lot of things to keep in mind when setting up everything with your game. I read a lot of posts from people with the same problem, so is there any tutorial that deals with getting a good performance with 2d games on iOs?
So before I setup something wrong for my second game I would like to get some feedback from the professionals. 

I am working on a 2d Jump and Run, like the old Mario games. The game should be able to play on all iOs devices ( Including iPhone 3). All textures are hand drawn.

1. Camera Settings. I am thinking about which Resolution is optimal. The 2d Camera uses 960x 640 as Standart. Is there a special reason to it? We were thinking about a resolution of 1024x768, like the iPad? Does that lead to memory problems with the older devices, like Iphone 3?

2. Backgrounds. We got a lot of very huge textures for our Backgrounds. What would be the best way to deal with that? My Idea would be to split the backgrounds into multiple textures and pack them into different atlases? About the atlases in general, is it smarter to have one big atlas for one big background or split it into multiple smaller atlases?

3. Activating/ Deactivating gameobjects. I read that deactivating gameobjects with big textures ( like our backgrounds) should be deactivated when they are off the screen to save memory. I thought about a system of triggers which are placed at the screen borders and activates/ deactivates the textures. Is that a good solution or are there any better suggestions?

Are there any more pitfalls I shoud be aware of? Like I wrote in the beginning, from all the posts there are a lot of people struggeling with that, but I was still not able to find a good tutorial dealing with this?

Cheers Pascal

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: iOS Setup
« Reply #1 on: December 19, 2013, 11:52:37 pm »
1. iPhone 3GS resolution is 480x320. You should probably base it on that if you're targeting that as the lowest device.
2. Pack background atlases only if you can take advantage of dicing, otherwise use sprite to texture, or resources.load to load the correct image in manually.
3. No, you will have to delete the game objects and Resources.UnloadUnusedAssets to get unity to unload assets.

There isn't a tutorial for something like this because everyones needs are pretty much different. A lot of the issues you'll run into are normal unity issues. Eg. understanding memory management in unity, etc.

pascal_mueller@gmx.net

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: iOS Setup
« Reply #2 on: December 21, 2013, 01:44:01 am »
Cool thx for the answer.

About the sprite sheets. Lets say I have like 8 different animations for my main character ( jumping, running.....). Each Animation consists of 8 frames. My character has a resolution of 450x550.
If I pack all my sprites in one atlas, I easily get very big atlases. From my understanding unity renders only one sprite per frame from this atlas (e.g. mainCharacterRunning0001), but loads the whole atlas. Doesn't that end up using more memory than having a single small sprite for each frame of the animation?
It makes perfect sense to me to use one atlas for a lot of textures of different objects, when they all appaer at the same time in the scene.

Cheers Pascal the confused

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: iOS Setup
« Reply #3 on: December 21, 2013, 11:25:30 pm »
You'd probably want to maximise atlas usage here - many small textures will likely cause a lot of issues if your game is texture heavy.