Search Unity

Developing PSM games with Unity, this what I learned so far...

Discussion in 'PSM' started by marclar83, Jun 22, 2014.

  1. marclar83

    marclar83

    Joined:
    Jun 7, 2012
    Posts:
    16
    I got my publisher license last wednesday, and since I have ported two of my Indie games that are in-developments and started a third tech demo to learn the best practices on this platform!

    1) Don't use NGUI! until they fix it for PSM. I personally use NGUI 2.X in VRift Bowling and it's totally broken on PSM. Just the fact that the plugins is loaded kills the performances of my game below 5fps. Once I stripped NGUI out and put GUITextures and externally made 3D assets for the GUI my game suddenly took life at 60fps!
    [UPDATE]: Some version of NGUI have been reported to work properly, so make sure to test NGUI separately before using it, i tested version 2.3.x, version 3.x is now available.

    2) Add few subdivisions to avoid clipping. Ok their's a patch coming in few days or weeks to fix the clipping issues some devs have, but personally I hated the clipping so much that I tried several tricks to solve the issue (at least in the skybox!) Finally by cutting my box halfway on every angle and turn it into a sphere the sky stopped clipping! I did the same with my water mesh and now it look very good 95.5% of the time.

    3) Mobile shaders aren't necessary the bests for PSVita! I was shock to discover a lot of mobile shaders didn't worked on PSVita, but their PC counterparts does! After I did further in Sony's docs I found out they heavily modified the PowerVR GPU to resemble more of a low-end PS3 console than a high-end mobile phone! Always good to know, we can rely on theses heavy shaders on this handheld console.

    4) you might need to remove some 2D Sprites and put some 3D mesh instead. I had few billboards and 2D elements that use transparency that just didn't show up despite the fact I use the same shader on other objects and they show just fine! So i figure it might be the 2D plane with transparency that was my issue, so I made flat 3D versions of theses assets (simple targets, arrows and a line) and I use the same shader (without transparency) and they work now! Few triangles never hurt anyone.

    5) Avoid over-using the physic! In one of my games, fruits were raining from the sky and exploded in little chunks when they hit the ground. Even if that behavior worked fine on Tegra 3 and Apple A5x chips the PSVita laggedevery time pieces collided with each other. I had to change the physics from constant (dynamic) to discrete, replace the convex mesh colliders for sphere collider, and reduce the amount of debris in order to gain my performances back.

    6) Saving data locally almost always bring a small lag of a few milliseconds. Keep in mind that it's noticeable, so avoid saving during intense battles, we can't solved it, because that's how the PSVita handle access on memory cards.
     
    Last edited: Jun 23, 2014
  2. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    592
    nice article could you please name some shaders to avoid and which you recommend
     
  3. AlexGK

    AlexGK

    Joined:
    Jul 31, 2013
    Posts:
    38
    I don't remember what version of NGUI I'm using, but I haven't experienced any problems with it.

    Thanks for the advice. I'm about to add physics-based gameplay into my game, so I'll keep it in mind.
     
  4. MDaveUK

    MDaveUK

    Joined:
    Apr 27, 2014
    Posts:
    14
    It would be really nice if they used that 3rd hardware thread for physics calculations instead of having it with the main unity thread. As far as I know, it's unused according to the docs.
     
  5. marclar83

    marclar83

    Joined:
    Jun 7, 2012
    Posts:
    16
    For NGUI I specified I was working on an older version 2.X and not the more recent 3.X version, that is much better, but hard to quickly migrate as I experienced. I tried two games I had, both with the older version 2.X, both totally broken. If you're a mobile developer just be aware of the risk of using NGUI 2 and test your version separately before importing it your project.
     
  6. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Interesting that you would post that a couple of days after the fix was actually released ;)
     
  7. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    The main reason for this is that the PS Vita uses regular Cg shader language, while the mobiles (if we're talking about iOS/Android) use GL ES (GLSL) - Unity automatically translates Cg to GLSL, but the minute differences with Cg on PS Vita can sometimes cause problems.
    We want to remove this pain point as much as possible, so whenever you have a shader that doesn't work (and of course, is expected to work) - feel free to submit a small bug report, and attach a project with the shader, a material and an object (or similar).
     
  8. marclar83

    marclar83

    Joined:
    Jun 7, 2012
    Posts:
    16
    Which version of Unity should I use? The one from unity official website (4.5) or the custom one Sony distribute ?
     
  9. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    Well if your making for playstation mobile / Vita, then the Unity-PSM / sony one ;)
     
  10. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    I thought CG compiled to either OpenGL or DirectX? The Vita actually "runs CG"?
     
  11. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    For PSM you currently need a separate build - the one linked in this post : http://forum.unity3d.com/threads/unity-for-playstationmobile-official-release.252713/

    Your Cg code is compiled to native GPU microcode at runtime (when the shader is first accessed from a scene).
     
  12. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Doesn't it run either GLSL or HLSL at the end of the day? And CG just compiles to one of those...? Maybe this is the wrong place to talk about this or I need to do more research elsewhere.
     
  13. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    243
    Thats too bad my game is dependent on a few convex colliders that are required. I'll have to change my design in order to make this work.
     
  14. Kinos141

    Kinos141

    Joined:
    Jun 22, 2011
    Posts:
    969
    I'll tell you one thing, store assets that use inputs, like UFPS will not work on PSM, nor will PlayMaker visual scripting. I have gotten in touch with one of them to see if they are aware of this and can update their assets.