Hi everyone. Thanks in advance for looking at this. Disclaimer: I am totally an amateur, so please forgive me if I mess up some terms.
I’ve been working on a text based adventure for quite a while now. In general have been really happy with the results I’ve had with Unity until I started testing on mobile devices.
From the image you can see I’ve got a scrollrect that has a vertical layout group that has narrative, conversation, and action confirmation slider elements in it. The conversation elements are horizontal layout groups with an image and text.
I can load 15 or so of these conversation elements into a scrollrect and my FPS will drop from 60 to 40, but scrolling is generally okay. What does kill my framerate though is an autotype script on each of the conversation elements. It types them out one letter at a time.
It works fine with only a few visible, frames will hover in the 50s, but once I’ve typed out 6 or 7 (on a snapdragon 400 device) my frames drop below 20. Once the whole page of conversation elements have typed out, scrolling is okay and FPS go back up to 40.
I thought it must be my coroutine, but I rebuilt it with a state engine instead and it had the same problem. After days of troubleshooting, I don’t think it’s so much the autotype script by itself, but a combination of the general load of my UI elements plus anything else taxing the CPU.
I’ve been trying all of the suggestions I can find.
Unity UI Best Practices - Unity Engine - Unity Discussions offered a lot of leads, but nothing has really helped. I tried using canvases to disable items not on the screen. It certainly lowered my tris, but my batches nearly doubled (still not sure if I did something wrong there). I tried converting everything to a bitmap font, but that didn’t help either. I’m not using pixel perfect.
I tried deactivating UI elements on screen (my buttons, scrollbar, framecount, etc), anything to get my batches lower. But even with lowered batches (I can get them down to about 15) my framerate is terrible.
Unfortunately I’m using the community edition, so I don’t have access to any performance monitoring tools.
Would TextMesh give me better performance? Seems like I’d give up on a lot of the conveniences of UI to move to TextMesh, but I’m pretty discouraged. I’ve also seen talk of 5.2 being performance focused, could that do the trick? Or are there any plugins that might help?
Sorry for the rambling, seemingly disorganized question. After a week of this I’m a bit discouraged and worried that Unity might not be the right tool for what I’m trying to accomplish.
Any advice? Words of encouragement? Anyone to talk me back from the metaphorical edge?
Thanks