开发者

Does Apple Frown or Disallow Device-Specific Coding?

Short question: Does Apple frown, or completely disallow apps to code specifically for a device (not a feature, like Retina or Compass, but an actual device). Here's the context:

I'm launching a 3D game for the iPhone/iPad that is planned to be a Universal app. I've coded its UI in such a way that one set of screen coordinates perfectly positions 2D sprites on-screen, maintaining the aspect ratio differences.

I'm now running into TREMENDOUS performance problems for the first-gen iPad. iPad 2, iPhone 3GS, iPhone 4 (and iPod twins) work great (I'm not supporting retina yet either, performance is too low with it enabled).

I'm on the brink of branching into "if iPad 1" do th开发者_StackOverflowis type coding. I know that is a terrible practice, but the game I've built pushes the older hardware too much. I'm looking into even more optimization techniques to help improve, but I need to get an additional 20 FPS out of it, which is needless to say, a lot.

My concern is this: if I can't improve the performance across the board enough for the game to play the same way on an iPad 1 as an iPad 2, I am strongly considering reducing texture sizes just for the iPad 1, and possibly even removing or trimming down certain objects with more poly's. I do not want this to come at the cost of iPad 2 users, however, who have a device with a GPU capable of keeping up. How bad of a situation am I in?


I've played a number of games that offer an option within the application itself which provides the option of using 'high-resolution' graphics / textures (specifically for the iPad 2). I would say that not only would Apple not frown upon such an approach, but probably favour it - as it gives you the opportunity to show off the best of their devices.

I would suggest that you want to aim to support the two latest devices of each type (iPhone 4, iPhone 3GS, iPad 2, iPad 1, appropriate iPod Touch models). I personally think think that you are cutting out too much of the market if you support only the latest version of each device.

Much in the same way that the retina display uses high resolution graphics, I would suggest aiming for the simplest route to providing lighter versions of your game and more advanced versions. As you stated, providing lower resolution textures and lower polygon models would be one way of doing that. Now that the iPhone uses a unified memory system for GPU textures, you can probably pick texture sizes depending on the total memory that the device offers. If you are not already doing so, you also might want to consider using PVRTC texture formats for textures that will not be too prevalent.

While I'm against 'pre-optimisation', if you're running into speed issues, you might want to run your app through the profiler. You might find that there is a single bottleneck in your code that is causing more problems that you originally thought. However, if you're using large textures - I suspect you will notice a significant increase in speed on older devices just by using smaller textures and models with a lower vertex count.


Short answer: Apple will not frown at such coding.

I am slightly concerned that you are not seeing the same performance across an original iPad and a 3GS, seeing as they have very similar hardware - and the iPad is actually stronger on paper.

The kind of practice you are describing to use a different set of textures for the iPad is not uncommon - I know a load of iOS and Android programmers and they too are doing this to accomplish the best performance in their apps, so I'd say go for it!

Hope this was of some help! :)


You can specify the devices that your game will work on when you upload it to the Apple Store, Apple does not particularly care if it only works for iPad 2 although it is suggested that it should work for as many devices as possible.

I would try not to go with the if approach, as that will make it a nightmare maintenance some day, I would just upload it, and specify it only runs on iPad 2, of course that comes with a price as you significantly reduce your market.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜