Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

【Optimizers】- Easy to use and functional components to optimize any other components!

Discussion in 'Assets and Asset Store' started by FimpossibleCreations, Jan 28, 2020.

  1. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    122
  2. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    Are you sure you don't have "Managed Stripping Level" in project settings set to "High"?
    It crashing the build for unknown reason.
    Also please check this post: https://forum.unity.com/threads/opt...y-other-components.817362/page-4#post-6670810
    Make sure that this file have commented the "#if UNITY_EDITOR" lines.
    What version of unity you use?
     
  3. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    122
    Hi, FimpossibleCreations.

    No, my setting is "Low".
    Do I have to set it to "High"?


    Unity2019.4.17f1.


    Below is the iOS crash report.
    Organizer.jpg

    Actually, it is a problem that has occurred since Unity 2019.2 in June last year.
    Three days ago, I had the opportunity to install Optimizers in another app, so when I tried importing it, the same crash report occurred in this app as well.



    I found the "Possible workaround" at https://issuetracker.unity3d.com/is...48.989894362.1609385991-1677472399.1586186308.
    I'll try adding UnityFramework.framework to Link Binary with Libraries.
    ----
    By default UnityFramework.framework is embedded in Unity-iPhone target and it is not linked with it, UnityFramework is loaded later at runtime and some plugins are sensitive to this initialization path.

    * Go to Unity-iPhone / Build Phases / Link Binary with Libraries build section and add UnityFramework.framework.
    UnityFramework will be loaded at the same time as the main executable.
    ----


    Thanks.
     
  4. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    103
    I have been looking at the doc and the videos, I'm not sure if I have just missed it but how to I add Optimizer to optimize my NavMesh Agent?
     
  5. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    "Low" is ok, can you tell when this crash is happening? After some time of gameplay or when game starts? If it's often can you try removing optimizers and check if it still happens, to be sure it's source of crahes?


    Optimizers component is trying to find NavMeshAgent component by default, it should just appear in "To Optimize" list
    and then you can adjust it's settings for choosed LOD levels.

    upload_2021-1-11_10-13-52.png
     
    mick129 likes this.
  6. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    103
    Thanks you for the answer about the NavMesh Agent, in your example you use a sphere and I guess you need a terrain for this, but does it work with the NavMesh Component?

    upload_2021-1-11_11-20-36.png

    For another project I am also using MapMagic2, the parent object doesn't have a terrain but MapMagic2 will generate terrain at runtime, can it be possible to optimize the NavMesh if I attach Optimizer on them during runtime (I don't mind to do a bit of tweaking) and would it increase the speed of the navmesh generation?
    My biggest problem are the lag spike when I generate new terrains.

    Other than that this is a great asset by the way and you give me some really good results, this is a 5 stars from me already :).
     
  7. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    I just quickly added sphere to scene and attached NavMeshAgent to it to show you how it's detected ;)
    NavMesh component you mean NavMeshSurface or something else? I think it would be not neccesary.
    But if you need to Use Optimizers on custom components with custom methods you can use events for that
    upload_2021-1-13_11-21-58.png

    I think lag spike can be caused by internal unity computation for terrain and partially by map magic and it is probably unavoidable, maybe map magic will provide kind of async terrain creation in the future, it might be worth to ask author for that.

    Also maybe something like that could be useful for you? Some time ago I was experimenting with lag frame smoothing: https://www.reddit.com/r/Unity3D/comments/etilz5/i_saw_it_in_battlefront_ii_lagfreezepeak/
    So if you walk in the world and lag occurs, then camera will not jump far further but smoothly continuing going forward (I still need to test it with different execution orders anyway). I thinking to make it as free package to use.

    Attaching optimizer runtime might just not work right now, since it's dedicated to use with editor and tweaking it here, but I have task in list to add special methods to apply Optimizers runtime since it needs just few changes to make it work.

    Thank you very much! Feel free to give suggestions for the package ;)
     
    combatsheep and mick129 like this.
  8. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    103
    Thanks you for the quick answer and the information about terrain generation.

    As for the camera trick, I think this is a very good idea I will follow this for sure :).
    Edit: oh and yes I mean the NavMesh Surface.
     
  9. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    103
    I have looked at your lag peak compensation and I think this is very cool, I would use that ;)
     
  10. goldwyn11

    goldwyn11

    Joined:
    Apr 8, 2019
    Posts:
    10
    Hello, hopefully 2 basic questions.

    I have this asset already and I'm going to be using it liberally, but does it benefit static assets that have no LODs like a book or something? Or is it better to leave this asset off of simpler items? The culling off camera and no shadows at a medium distance sound nice, but I'm not sure if it's more efficient to just have a LOD that culls at a distance and leave the shadows on when it exists.

    Second question: Assuming the answer to the first one is yes, is it better to put this component on a bundle of items like a row of produce, or put it on the produce individually?
     
  11. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    Yes it's better to use optimizers on multiple objects or on object with multiple game performance influence components which you can disable. But it's not a main rule, when you use optimizers correctly you can place it on 100k+ objects and system will still not put much more cpu usage on the project. You can look onto manual page 6 to get some more detailed info about that.

    Lately I figured out that switching GameObject's layer (to layer not viewed by camera) instead of turning off renderer component is more performant and I will bring support for that in next update.
     
  12. goldwyn11

    goldwyn11

    Joined:
    Apr 8, 2019
    Posts:
    10
    Allrighty, thank you for the response c:
     
  13. laloTT

    laloTT

    Joined:
    May 25, 2018
    Posts:
    1
    Hi FimpossibleCreations!
    I have a problem when putting an essential optimizer in an object with a negative scale, could you help me out?
     
  14. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    It can be problematic, but maybe you can set Game Object with optimizer as parent of negatively scaled object?
     
  15. Alf_Pacino

    Alf_Pacino

    Joined:
    Apr 20, 2018
    Posts:
    6
    New Essential Optimizer always appears on the object's pivot. Is there any way for it to appear in the center?
     
  16. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    Can you show what is wrong?
    I added component to example model and it automatically fits in center:
    upload_2021-2-9_19-21-39.png
    Maybe your object don't have mesh renderer as child?
    Also you can adjust it's positioning with "Detection Offset" field.
     
  17. Alf_Pacino

    Alf_Pacino

    Joined:
    Apr 20, 2018
    Posts:
    6
    upload_2021-2-9_16-5-0.png
    The sphere is placed exactly on the pivot of all models.
    Pivot:
    upload_2021-2-9_16-5-22.png
    Center:
    upload_2021-2-9_16-6-23.png
     
  18. prg-liulie

    prg-liulie

    Joined:
    Dec 23, 2017
    Posts:
    11
    Maybe a bug: "Optimizers_CullingContainer.SetNewCamera" does not call "Optimizer_Base.RefreshCamera". So when calling "OptimizersManager.SetNewMainCamera" to switch camera dynamiclly, there could be a null reference error sometimes.
     
  19. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    Try with newest version on the store (there will be also "Auto" button next to "Detection Radius" field)
    Algorithm will try to fit to the model with mesh's bounds.

    Thanks for reporting, I will check it and fix for next update.
    As I remember container optimizers don't need camera reference but some gizmos could throw error indeed :|
     
  20. krapa

    krapa

    Joined:
    Jul 1, 2019
    Posts:
    2
    Hi,
    is there a way to add gameobjects or their components to optimizer at runtime for a fully procedural scene ?
     
  21. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    343
    Component is dedicated to be adjusted inside during edit mode, in next updates I will prepare code for dynamic management since it needs some re-coding.

    But there is still a way right now, you can check this message: https://discord.com/channels/675990346890608661/675993003801968641/806178052588961812
    upload_2021-2-18_11-51-28.png
    There is also assigning obstacle detection but you will probably not need this right now.
     
  22. eof2007

    eof2007

    Joined:
    Apr 18, 2020
    Posts:
    5
    Hi
    In this component, can I use the Maximum LOD Level parameter? To forcibly limit the LOD level for low quality settings like in a standard LOD?
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      68 KB
      Views:
      5
  23. krapa

    krapa

    Joined:
    Jul 1, 2019
    Posts:
    2
    thanks for the answer, I take a look ! :)
    When is planed the next update ?
     
unityunity