Top 5 Optimization Tips from Building a Mobile Game in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024

ความคิดเห็น • 47

  • @mimaps
    @mimaps หลายเดือนก่อน +1

    man, that was excellent. i was completely lost with the profiler, but you gave the right priorities conceirning performance monitoring. infinite thanks for sharing

  • @spiderspyy
    @spiderspyy ปีที่แล้ว +12

    As someone who considers themselves good at optimization I think these pointers are really good! The other thing not mentioned is an object pooling system.

  • @Pontypants
    @Pontypants 10 หลายเดือนก่อน +1

    Awesome video! Thanks for making this

    • @LlamAcademy
      @LlamAcademy  10 หลายเดือนก่อน

      Glad to hear it 🧡

  • @TChrisBaker
    @TChrisBaker 2 ปีที่แล้ว +6

    Great lesson! This was all 100% new information for me

  • @fmproductions913
    @fmproductions913 2 ปีที่แล้ว +4

    Great tips! I think a more general way to summarize some points is to "offload work from the cpu to the gpu", or even more general "parallelize processes where possible", for example by using the job system or shaders. With the parallel nature of how shaders are run, it should be more performant in most cases. For example, recently I implemented a simple ongoing auto rotation for meshes in a shader instead of in MonoBehaviours and Update() - for collectible objects in a game.
    A few years back I tried the Animation Instancing repository from Unity too, and I got it to work but it take a while and some trial and error. There are youtube videos from someone called "Dr. Shahin Rostami" who covers them a little more into detail and I think there was a talk on it somewhere as well (not sure if it was a Unite talk) - those helped me too, for understanding and implementation

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      True. In general most optimizations I apply fall into about 3 categories:
      1. Parallelize the work.
      2. Pre compute the work and use the pre computed result.
      3. Use a less complex algorithm.
      I appreciate the reference for the Animation Instancing help. I’m sure many people will benefit from that!

  • @SpeedyGwen
    @SpeedyGwen 3 หลายเดือนก่อน +1

    when its in therm of mobile games, I aim for it to be able to run at 60fps on a nintendo 3ds which require absolutely incredible optimisation and well designed models and textures as if it runs, it will be able to run at above 60fps on every phones that are 15yo or newer
    the 3ds having a generally modern arm cpu makes codes that run on it run really well on many arm android devices

  • @flurinjenal374
    @flurinjenal374 6 หลายเดือนก่อน +1

    Thanks for another great performance optimization video!

  • @AndyLukito
    @AndyLukito 2 ปีที่แล้ว +6

    05:44 I've always known that skinned mesh renderers impact a huge performance to the game but never knew what's the easiest approach to solve them. I'll definitely try the tool from the asset store. Do you have any tips regarding that tool?
    P.S Just found out your channel, very underrated!

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +4

      The tool was very easy to implement and they have pretty good documentation. The only additional tip I have is to NOT use a prefab to generate the animations. Make sure to use the root model asset that has the animations or it won’t generate them correctly!

  • @kotted
    @kotted 2 ปีที่แล้ว +2

    Only 700 views? Huh?! This guy needs more

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      Share the knowledge with a friend! 😄

  • @user-fm6pq1fi5j
    @user-fm6pq1fi5j 5 หลายเดือนก่อน +1

    Thanks man, hepful and straight to the point.

  • @audemkay
    @audemkay 2 ปีที่แล้ว +4

    Awesome! Optimization is too often overlooked, not just in tutorials but in full released games themselves. Thanks!

  • @dynamicvoltage9765
    @dynamicvoltage9765 3 หลายเดือนก่อน

    I have a couple of tips as well:
    The Unity animator is incredibly slow. It's easy to animate this way, but you should try to use it sparingly if you can. Especially if there's an animation that's not doing anything. Disable the animator until you're actually running an animation.
    3D is faster than 2D. I know this sounds crazy, but 3D physics are actually faster than 2D physics, and doing an unlit/transparent cut out shader on a plane is faster than rendering a 2D sprite. Unity didn't initially have a 2D engine, and when they added it, it seems to have really been done poorly.

  • @poobagification
    @poobagification 2 ปีที่แล้ว +1

    Excellent stuff. This will be very useful if I ever get the dedication to finish a project.

  • @Francisco-Gutierrez
    @Francisco-Gutierrez ปีที่แล้ว +1

    Super useful, I love your content!

  • @ggshout3019
    @ggshout3019 ปีที่แล้ว +1

    Simply compressing audio, textures, models and clearing GI Cache reduced loading from 60 sec to 3 and a half.

  • @quadriproduction
    @quadriproduction 2 ปีที่แล้ว +2

    Great video.Can you make a tutorial for job system and spherecast (using physics in the threads)?would be awsome

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +2

      Of course! I’ll put it on the list!

    • @quadriproduction
      @quadriproduction 2 ปีที่แล้ว

      @@LlamAcademy awsome..thank you a lot

  • @P0Omah
    @P0Omah 2 ปีที่แล้ว +1

    Love your videos man, super dense with how much helpful info there is, but never feels overwhelming or dry.

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      Thank you 🙏 that means a lot!

  • @chiragsawajiyani8540
    @chiragsawajiyani8540 2 ปีที่แล้ว +1

    Please make more videos related to mobile game development specially about different controls and swipes etc

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      I’ll add that to my topic list!

  • @Hazzel31337
    @Hazzel31337 ปีที่แล้ว +1

    nice tips, didnt know the animator has that much coast associated with it

  • @Betruet
    @Betruet 2 ปีที่แล้ว

    Thanks mate, that was really helpful.

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      You're very welcome! 🙌

  • @Abdulwahab-vb6he
    @Abdulwahab-vb6he ปีที่แล้ว +1

    amazaing vid brother keep it up.

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว +1

      Thank you, I appreciate that 🙌

  • @ronigleydsonvilasnovas8067
    @ronigleydsonvilasnovas8067 2 ปีที่แล้ว +1

    thanks for the tutorial, topics about optimization are among my favorites. One question, would it be possible to use Ragdoll on characters in conjunction with Animation Instancing?

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      Unfortunately not easily as far as I know.
      The only way I know to do that would require you to swap between GPU animated mesh and the ragdoll skinned mesh renderer. That means at the time of the swap you’d have to be able to determine the positions the colliders/rigid bodies would need to be at, set those, then apply forces.

    • @ronigleydsonvilasnovas8067
      @ronigleydsonvilasnovas8067 2 ปีที่แล้ว

      thanks man

  • @MASTONGAMES
    @MASTONGAMES 2 ปีที่แล้ว +2

    too good!

  • @calvinms7503
    @calvinms7503 ปีที่แล้ว +1

    THANK YOU!!!!!

  • @nabilayyad2550
    @nabilayyad2550 ปีที่แล้ว

    thanks for the tutorial , its extremely helpful )
    May I ask if you used NavMeshAgent on each of these Zombies ?

    • @LlamAcademy
      @LlamAcademy  ปีที่แล้ว

      Yes! Each zombie is a NavMeshAgent

  • @aronkan7513
    @aronkan7513 2 ปีที่แล้ว

    Hi, an excellent tutorial, just one thing want to mention. In unity 5, you no longer can see the draw call, because they have taken it away

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      Remember that Unity 5 was released back in 2015 and is no longer supported. Any new projects should be started on a modern LTS release like 2020 or 2021. If you have an old project on Unity5 still you can try to optimize the draw calls by reducing the “Batches” in the profiler

    • @aronkan7513
      @aronkan7513 2 ปีที่แล้ว

      @@LlamAcademy I’m currently using Unity 2020 for some reason, in the game scene tab, when I check the status, the batching always shows 0 and the draw call is not showing either. I have some research online. Some people said it was a bug. Do you know anything about it?

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว

      @@aronkan7513 Hmm...nope the only time I have that happen is if I select the SCENE View. Llama Survival is on 2019.4LTS still so I can't say I had a lot of experience with 2020 outside making the tutorials

  • @arunachalpradesh399
    @arunachalpradesh399 11 หลายเดือนก่อน

    in mobile build , batches are overrated , though its important but shaders complexity and visual quality are as much important as batches. due to lower ram in mobiles and weak gpu. even reducing to lower batches by combining meshes your ram usage can be double which will effect performance even if you reducing triangles your shader complexity can lower performance . mobile optimization is a headache specially if you want to run on most average mid range device. unlike pc where reducing 50% of batches sometimes give more than 50% of fps. where in mobile its completely different case.

  • @pourmydrank
    @pourmydrank 2 ปีที่แล้ว +1

    Thanks

    • @LlamAcademy
      @LlamAcademy  2 ปีที่แล้ว +1

      You're welcome! 🙌