Search Unity

Regarding drawcalls, speed etc. in WebPlayer/Android

Discussion in 'Immediate Mode GUI (IMGUI)' started by kronholm, Mar 10, 2011.

  1. kronholm

    kronholm

    Joined:
    Oct 1, 2010
    Posts:
    26
    So I've been reading up on the gui stuff, and it seems to be the concensus not to have more than 20 draw calls when you make Android/IOS games. But what about WebPlayer? I'm making a game, a casual for-fun slot machine, which is built up of pretty much just 2D elements. Yes it's pretty silly to do it in Unity, but I do not like working with Flash at all, and I want to learn more of Unity.

    The game has a LOT of GUI items (over 400), which I've tried to offload a bit with spritemanager (the first), thinking that if it ran awesome on Android, with only 15 draw calls, it would run even better on WebPlayer. Wrong. So now, as a temporary solution to having the game run well in WebPlayer, I'm trying with a hybrid of spritemanager for the things UnityGUI can't do, and UnityGUI for stuff spritemanager can't do, such as long lines of text for highscores etc. If I use UnityGUI for displaying the highscore text lines on Android, it slows down immensily though.

    Am I to use spritemanager for Android, and stick to UnityGUI with WebPlayer? Or am I doing the right thing for WebPlayer by making a sort of hybrid between spritemanager and UnityGUI?

    This really bothers me, as I love to write very optimized code that runs great on low-end PC's, which is part of my target group with this game. It seems it cannot be done, am I wrong? Currently the game chucks along at 10FPS in WebPlayer on an old netbook, yet, another game I made with lots of 3D objects and a 3D animated character, around 3k tri's total in the scenes, runs at 30+ FPS.

    Hoping someone has been in the same situation as me, and can give some pointers and tips :)

    Ps. am only using one OnGUI() as people in other threads have suggested.