Search Unity

Terrain Options for Mobile.

Discussion in 'General Discussion' started by Job_MTalha, Feb 2, 2021.

  1. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Hi, I am trying to creating a simple 3D mobile game. I am looking at optimization techniques before starting development, Where do I start, I am soo confused right now?

    The game is third person, there are static walls, Grass, Water, mountains, fog, characters, enemy AI, force field, portal, (all low/ mid poly), I am not going for photorealistic models.

    I have a few questions, Please Guide me as this is very confusing. I have no knowledge of blender, I am coming from unity2D to 3D.

    What should be the resolution for the assets?
    When I import some models from blender to unity even though the scale is 1 the models are HUGE. then I have to set the scale of the model to 0.01 to achieve right scale. Is that okay? or is it not a good practice, performance wise?
    Should I use one big terrain or smaller terrains? Guide me pls.
    Is Urp A good Idea for mobile? If so then what should be the target settings of the urp asset? Low, medium, high? Which one should I target?
    I want to Use the new Shaders, For that I guess URP is compulsory right?

    I just want balanced look, I am not going for ultra beautiful assets, I just want a balance in the graphics and performance, so that for mobiles > year 2015, I can ensure a smooth experience.
     
    Last edited: Feb 2, 2021
    DungDajHjep likes this.
  2. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    ? anyone?
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    First thing first, if you aim to make decent profit on you mobile games, you may be rather dissapointed. Your chances are close to 0. But if just for learning purposes, sure go ahead.
    You better of luck however, with resktop games.

    Either way, it looks like you are very beginner to highlighted points and game devs. There is many questions and just starting points. The answers comes with an experience. On top of that, many similar topics already exiting, discussing 3D models properties, desired for mobile.
    But in the end, you want to test performance on live and profile your game, as you progress.

    My general rule of thumb is, make something as little as complex as possible, but enough, so it looks satisfactory. So your 3D model may look a bit squery up close and on big screen, but on mobile gldevice, it 2ont be noticeable at all. In the end, you don't want to put modern FPS quality characters into mobile. Would be overkill. And kill for battery drain too.
     
    Last edited: Feb 4, 2021
    jjc6252498 and Job_MTalha like this.
  4. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Thankyou for your reply. You're right. but kindly reply to the questions asked aswell. I looked online alot but got further confused.
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,191
    For mobile the best optimization technique is to avoid terrain systems and instead use optimized meshes. If you want to design within Unity you can do so then export the heightmap representing the terrain and import it into a modeling program to generate the mesh.

    If you decide to go ahead with a terrain system just be aware that it is heavy and you will want to have a simple terrain with low-ish resolution settings.

    No. You can use shaders with the built-in rendering system. You just won't have a node-based system for built-in unless you purchase one like Amplify Shader or Shader Forge.

    https://assetstore.unity.com/packages/tools/visual-scripting/amplify-shader-editor-68570
    https://github.com/FreyaHolmer/ShaderForge

    Yes and no. URP is good but has performance problems on old devices (four years or older) while the built-in rendering system has higher performance on older devices but locks you out of newer development tools like Unity's node-based shader system (again though there are alternatives to this).

    Typically you would create profiles for all three performance tiers and either select one based off of device performance or allow the user to select one, but if you don't want to deal with all of that just configure it to run well on the oldest device you intend to support.
     
    Last edited: Feb 4, 2021
  6. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Set the scale in import settings, not on the objects within the scene. Scaling a game object does not have the performance issues it used to, but it is still best to avoid if possible, and it is avoidable if you can solve it using the imported scale.
     
    Job_MTalha and MadeFromPolygons like this.
  7. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Thankyou for your detailed response. It clear some clouds of confusion over my head. Thanks A Lot mate.

    I get that terrain systems are heavy. avoid them, Ok. That was the most confusing aspect, Cuz most of ppl were saying to avoid terrain, stop using one big terrain, cut your terrain in blocks etc. This makes me think, is Probuilder a good tool to use to generate levels for the game then?
    I will be making simple low poly meshes in blender and will use them in unity with probuilder to make a simple game for now. Is that a good approach?

    One last thing, Could you please detail What do you mean by Optimized meshes? That is one more thing that is confusing me alot.

    thanks once again mate, really.
     
  8. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Yes, I am setting the scale to 0.01 in the import setting of the model, In the inspector the scale is always 1. But Is that cool? Performance wise? How can I tweak it in a way where it is already scaled correctly when exported from blender so that I dont have to set the scale in import settings to 0.01?
     
  9. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    589
    1 is considered 1 meter in Unity. When using models from other sources, I first place a Unity Cube in the scene, which is default a 1 meter cube. Then, adjust the import settings to roughly match, i.e. a chair sitting next to a 1 meter cube should be similar in size.

    It doesn't matter if your import is .1, .001 or 100, that just depends on the program that made it and how it was exported. What matters is that it appears the right size in Unity, when you start using Physics, it assumes that you are working in a world where 1 = 1 meter.
     
    lclemens and Job_MTalha like this.
  10. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Oh, Okay. I get it now.
     
  11. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    If you are scaling a scene, I suggest scaling it down or up, in a 3d modelling software eg. 3dsmax, blender, maya etc, save the project, then import it into unity.
     
    Job_MTalha likes this.
  12. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    You can try to use microsplat in combo with their terrain to mesh plugin.
     
    honeyrain and Job_MTalha like this.
  13. RitabrataKabiraj

    RitabrataKabiraj

    Joined:
    Oct 26, 2020
    Posts:
    2
    When I import some models from blender to unity even though the scale is 1 the models are HUGE. then I have to set the scale of the model to 0.01 to achieve right scale?

    It is because in your imported object settings it is probably because, you have toggled on "Convert Units" in the model section, it says that it will increase the size by 100 times. You can toggle it off to resurrect it.
     
  14. Deleted User

    Deleted User

    Guest

    I think shader graph is now supported in 2021.2 version for built-in
     
  15. qwertysachin3

    qwertysachin3

    Joined:
    Aug 31, 2020
    Posts:
    1
    Did you get your answer on what are Optimized meshes? If yes then please do reply. Thanks in advance
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The biggest problem is not terrain options for mobile, but "can I make anything at all and ship it?" in which case Unity's terrain is indeed fine for mobile. In fact Unity's terrain works fine on Quest 1 (which is saying something, believe me) if you use conservative settings and not too many textures.

    As such I'm going to go with the recommendation of using Unity built-in terrain. I also use it for performance critical devices if the performance bottleneck is me finishing my job.

    I get it's fun to recommend the best possible practises but it must be weighed against the fact you probably will not ever finish any game, ever with best possible practises. I've never seen a game ship by anyone, even the biggest pockets in the world, with that mentality.

    Anyone who hasn't shipped a game, ever, has to use all of Unity's features. How does this not make sense? :)
     
    colbydanesaddoris and derkoi like this.
  17. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,668
    You have so much basic question that it's easier if you just enter the unity learn website and look for mobile, there are very good tutorials and videos for mobile development. Also, for your question about the size of the object: That is a pretty common issue when you are starting with 3d, i'm a old school 3d artist so i always have a reference in my 3d software for the size (something like a low poly character in one of my layers) or keep an eye on the size of the objects you are doing in your 3d software, maybe you are making a 3km character. Also, you want to use an FBX exporter that let you export unity models, there is an option on my 3d software's fbx exporter that says "Unity 3d mode"
    Anyway the best you can do is, go to the unity learn website and search for mobile. Good luck
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    It's also something that's very possible to optimise later, should it turn out to be an issue. There are ways to turn a terrain into a mesh, and from there you can optimise it as if it were any other piece of art - reduce polys, customise shaders, split it into chunks, whatever.
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yep, thing is Unity is really good at letting you change your mind. Everything has some opportunity or other attached that Unity's opened over the years in response to feedback. And if it can't be done, Unity wants to know.
     
  20. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Thank you for this answer, which seems the only one on point in the whole forum (I've been searching for about half hour now).

    An additional detail you may know: do you think that the MICROSPLAT addon could give an additional edge on performance?
     
  21. rajneeshadrack

    rajneeshadrack

    Joined:
    Feb 15, 2023
    Posts:
    9
    MicroSplat doesn't function well on mobile; I've tested it with URP, and it doesn't work. There's a sudden drop in FPS, and heating issues arise.
     
  22. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    It works fine on mobile / URP. Make sure to use the proper package. Check the asset store, there are specific urp packages.
     
  23. rajneeshadrack

    rajneeshadrack

    Joined:
    Feb 15, 2023
    Posts:
    9
    I've verified my setup, and despite having a 6x6 km environment, I'm experiencing lag. Here's my process:
    1. I imported the package into Unity.
    2. Applied it to the Unity terrain and converted it into MicroSplat.
    3. The conversion process went smoothly, and I selected material based instead of PBR.
    4. When running it on my Moto G40, I'm only getting 7-8 FPS, whereas with the Unity terrain system, I achieve 30 FPS.
    This was the package: https://assetstore.unity.com/packages/tools/terrain/microsplat-urp-2022-support-244845
     
    Last edited: Dec 2, 2023
  24. zombiegorilla likes this.
  25. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    As above, contact the developer for support. It is a fairly common package, and used quite a bit. Personally, I've never experienced any problems with it. And given the popularity and ratings it gets, it seems most folks have a positive experience with it. Check with the dev, they may be able to help you resolve your issues.
     
  26. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    This is approximately the size of Skyrim, so depending on your use case it's potentially huge. At that scale you need very careful tuning to get good performance. It's incredibly easy for even one or two poorly set parameters to have a major negative impact.
     
  27. rajneeshadrack

    rajneeshadrack

    Joined:
    Feb 15, 2023
    Posts:
    9
    Currently, I'm utilizing Unity's terrain system, and it performs well on mid and high-end devices. However, I've encountered FPS drops on low-end devices. Despite reaching out to the author of Micro-Splat, who developed the system, they have not provided information or assistance regarding the issue.