imini b3d questions for "the right way to do it"

BlitzMax Forums/MiniB3D Module/imini b3d questions for "the right way to do it"

Robert Cummings(Posted 2010) [#1]
Hiya,

I am ready to make my next iphone and ipad game and I will be using iminib3d for it. Here are my questions which I am grateful for your answers:

1. whats the best way to have lots of animated objects? the game is top-down and has robots which animate. Do I use copymesh or something? Whats best for performance since I want to instance the same mesh a lot and just generally animate a bunch of robots.

2. using b3d files, whats the best art path from 3dsmax? does it support the onigirl exporter?

3. I have my own font/text/hud graphics stuff. Is it ok to destroy the projection matrix etc for my own 2D overlays and then render?

4. Any tips or tricks for performance and such? will be most useful for iPad!

Thanks!


ima747(Posted 2010) [#2]
Some thoughts:

1) I believe copyEntity on iPhone unties the animations etc. between the entities (unlike in blitz)... If I'm wrong about that then CopyMesh will save you having to re-load the file a bunch of times... you will probably want to consider some sort of batching system to prevent using more entities/meshes than you need at any given point to limit resource usage. Along those lines keep in mind that iOS devices are portable and shouldn't (optimally) be treated like a desktop environment both as far as resources are concerned (very limited ram rather than a controlled expandable virtual pool etc.) and as far as game design is concerned (people need to be able to put it down and walk away in an instant, the screen is (typically) much smaller and partly obscured by the user's hand when they are interacting, etc.). If you tailor your design around the platform I find the resource management becomes easier to deal with (do I really need 200 bad guys? the level should only last 30 seconds... if I redesign the map it will feel the same with 20...)

2) Don't use 3dsmax myself so I can't really advise here besides saying if it works in MiniB3D on the computer it will probably work in iMiniB3D... just keep your polly count and texture size in check, the screen is tiny and the ram is even smaller.

3) I've taken 3 routes with huds:
a) In engine with sprites or quads attached to the camera. This is pretty simple to do. You can either check for touch projections to see what the user is touching, or my preference for speed is to just track touch positions directly to actions with the HUD as just a visual reference for the user. The advantage is it's easy and portable, you can spin it to/from a desktop version quite easily since nothing really needs to change.
b) Same as A but attached to a seperate HUD camera that doesn't clear before it renders. The advantage here is you can do 3D things in the HUD view (say a 3D star map) without clipping issues with the main camera. You can also set the clipping plane and distances for the HUD camera and elements seperately which can let you eek out some extra performance, but you are rendering twice, so your overall entity count (especially un-needed off screen elements) can really affect rendering time.
c) My personal favorite is to just use iPhone native elements over top of the OpenGL view. It requires a few tweeks to the base app you start with but it's worth it. It has no real performance impact (!) because nothing has to be "rendered". It's really easy to setup and tweak etc. since it's just standard UI elements. You can still track touches in the OpenGL view. It's much lighter on resources because you can actually use a tiny graphic for a tiny button rather than having to use something kinda big to make the texture clean enough. It looks crisper and can auto handle retina displays because well, it's just interface elements and that's what they do.

4) with the iPad just keep in mind that the memory does not scale with the screen or processor. The ram in an iPad is the same as a 3GS... and a 3G... and a first get... bout the screen is aprox. 4x as large which means 4x the ram is used for backbuffer etc. AND since it's bigger you need cripser (read higher resolution) textures to make it look as good... the iPhone 4 has double the ram, but it also uses double the resolution (which is 4x the memory, 2 dimensions remember) for it's graphics to for the retina display so your extra memory largely gets eaten up by the visuals.

Another thing to keep in mind is what extra features are you going to want? GameCenter, iAds, OpenFeint, any OS 4.0 specific tools? If you find you need to target 4.0+ you can wave goodbye to first gen and consider saying goodbye to the 3G as well since 4.0 is kinda crippled on the 3G. Which leaves you with 3Gs, iPad and the 4 all of which are MUCH faster than the first gen and 3G which gives you more processor to play with... The flip side however is the more devices it can run on the more people there are to play it (and, assuming your charing or using adverts, pay for it...). I target as low as I can go, but sometimes you either have to aim higher because you need something new or you just need the performance and that's the easiest way to ensure it will be there.

Last edited 2010


Robert Cummings(Posted 2010) [#3]
Thats a really nice set of tips. I've only made one iPhone game using opengl (in my sig) and I wanted to see how 3D's art path would speed stuff up in terms of content creation :)

I like the tips, and I'm open to more since I need to get the most I can out the hardware but hopefully just be compatible with normal 3g phones later down the line...