iPhone roadmap

http://blogs.unity3d.com/2009/04/06/unity-iphone-roadmap

Brilliant, thanks for sharing. A good direction you’re heading with telling about the planned stuff. Greatly appreciated!

Yeah, wanted to say it here again, too, thanks a lot for letting us know, its also all very nice things i´m looking forward to :slight_smile:

Great news! Thanks :slight_smile:

Thanks for the update. Have you guys decided if any of the planned 1.1 features will be Pro-license only?

Thank you for the update ReJ :slight_smile:
Can’t wait for objc binding and movie support in iphone advance :slight_smile:

Great news, thanks everyone at Unity.

First off, correct terminology: Advanced-only (Indie/Pro are desktop/web focused, Basic/Advanced are iPhone focused). :slight_smile:

Second, yes, we have some early decisions about which will appear in both Basic and Advanced, and others that will be Advanced only. We’ll share more of those details when the decisions are finalized.

Excellent, looking forward to the update…

This all looks like good stuff. I do have one question/request though…

A few weeks back, ReJ helped me diagnose a recurring framerate hitch that occurs in Zombieville USA. It turned out to be related to garbage collection happening mid game, and causing an abnormally noticeable effect on performance.

Is garbage collection going to see any improvements in the foreseeable future? Namely, can we run it manually, or have it run more often? Or will all of these other performances improvements most likely eliminate the ugly stalls that occur when GC runs at inopportune times?

Renaldas is the best source of information here, but I think that the plan is that you won’t have to focus on that as it should “just work” properly.

The best way to reduce GC hiccups is to reduce memory allocations.

The most common source in projects i’ve seen is with string allocations.
For example, calling gameObject.name will allocate a string. Structs like Vector3 or Color do not allocate memory because they are passed by value.

So basically you should go through your script code and ensure that there are as few memory allocations happening on a frame to frame basis and instead most of those allocations happen at game startup time.

You can also call GC.Collect (); to run it at specific times.

Strings are the primary source of allocations in my game, this is for sure. This is mostly due to referring to animations by name on a frame by frame basis (i.e. animation.CrossFade(“idle”):wink: I suppose the easiest way to avoid that would be to have variables that store the names of my animations which are only assigned once, and exclusively refer to animation clips via those variables - or would that still be the same?

GC.Collect () is news to me - I seem to recall finding an Application.GarbageCollect () or something like that in the manual, tried it, and saw no effect.

Doing animation.CrossFade(“idle”) does actually not cause a string creation per frame. so you’re cool there. however, be on the lookout for:

OnGUi()
{
GUI.Box(“player1health”+player1.health+" points:“+player1.points”);
}

as those concatenations are very inefficient. If you really need to do that, look at System.Text.StringBuilder
to create your strings.

As a guideline: look at every “new” you do, for referencetypes. Referencetypes are roughly everything except int, float, Color, Vector2, Vector3, Vector4. (I’m leaving some things out here but you get the idea). To precisely figure out if something is a valuetype or referencetype, open UnityEngine.dll in a assembly analysis tool, and it will tell you the exact type of all types in UnityEngine.

You basically need to go trough your Update and OnGUI() functions with a fine comb, and see if anything can be done more efficiently.

I’m pretty sure that doing transform.position can actually be sped up, since “transform” is a shortcut to GetComponent(typeof(Transform)). instead,make your own cached transform, and set it on Start, and then use your own direct refernce in your Update functions. Ditto for other references.

Good luck,

Lucas

Yes, that makes more sense. I had different sets of animations for my player based on what weapon he was using, so I was constantly refererring to each animation as “idle” + animset or “fire” + animset, where animset was an integer that referred to the weapon type. I’ve begun avoiding such concatenations with further projects, and have been avoiding using the names or tags of objects to embed information (something I used for my UI and particle systems unfortunately, and realized too late how costly it was). Both were big time savers when it came to scripting, but led to garbage collector running more often.

I’m done derailing this thread now, sorry about that. :slight_smile: If anyone wants to continue talking about how to cut down on runtime allocations we should start a new thread.

Awesome news ReJ and thanks for the updates! I can’t wait to see whats possible in 1.2. It really sounds like you guys have made a ton of improvements at the engine level that will allow us to push the visual and game play envelopes even further in the very near future.

Things are stepping up in iPhone dev quickly. Titles are looking better all the time. You see this on every new type of hardware. Anyway it’s good to know you guys are done with 2.5 and concentrating on the iPhone. I think I said this before but, PC gaming is the wave of the future : p

Great stuff, thanks for listening to your users!

Ok, so Lucus, if I have to have some concatenation inside an Update() loop, replacing something like…

gui_gameTime.text = gt_mins.ToString().PadLeft(3,"0"[0])+":"+gt_secs.ToString().PadLeft(2,"0"[0])+" x"+Time.timeScale.ToString("f1");

with String Builder would work how?

var txt = new StringBuilder(gt_mins.ToString().PadLeft(3,"0"[0]));
txt.Append(":");
txt.Append(gt_secs.ToString().PadLeft(2,"0"[0]));
txt.Append(" x");
txt.Append(Time.timeScale.ToString("f1"));
				
gui_gameTime.text = txt.ToString();
txt = null;

And this would be more efficient for performance and memory?

Probably not that much better. I would look into String.Format, as you are still doing a ton of allocations with the padding (each one is 2 new strings allocated).

Hmm. I cant see how I can pad 0’s to the start of a number using String.Format.

Looks like I can do it ok with spaces, but I cant get 003 :frowning: