Search Unity

【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:
    133
  2. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    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:
    133
    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:
    228
    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:
    540
    "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:
    228
    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:
    540
    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:
    228
    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:
    228
    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:
    12
    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:
    540
    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:
    12
    Allrighty, thank you for the response c:
     
  13. laloTT

    laloTT

    Joined:
    May 25, 2018
    Posts:
    4
    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:
    540
    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:
    540
    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:
    13
    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:
    540
    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:
    9
    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:
    540
    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:
    7
    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:
      303
  23. krapa

    krapa

    Joined:
    Jul 1, 2019
    Posts:
    9
    thanks for the answer, I take a look ! :)
    When is planed the next update ?
     
  24. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    New Video coming tomorrow. "Apollo's Dream II" Using tons of assets, as usual. The music is always an original composition.

    Hope everyone enjoys it, the scene and music has been in the works for a long time. We are glad we are finally coming to a final product.

    Keep an eye on our YouTube for the new video.
    https://www.youtube.com/user/silverthorndavid/videos
    View attachment 829055
     
  25. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Apollo's Dream II is now live!
    A ton of work went into this one, I hope everyone will enjoy it.
    Creating beauty with Unity for a Virtual Experience with an original soundtrack is a lot of fun and I hope it shows in the video.

    Optimizers helps to keep everything running smoothly!
     
    Shamantiks likes this.
  26. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Are you hijacking this thread or something?
     
  27. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    No, I'm just trying to wake it up.;)
    No one has said anything here since February.
     
  28. Supergrubman

    Supergrubman

    Joined:
    Jan 2, 2014
    Posts:
    20
    Does Optimizers support multiple cameras? If not are you planning to add this feature?
    If there is no support for multiple cameras then it's real world application is really limited. Especially for VR where you need a minimum of 2 cameras. Even in non-VR games there is always a chance one is going to use more than one camera at some point.

    I hope this will be clarified. Thanks!
     
  29. Calum

    Calum

    Joined:
    Mar 14, 2015
    Posts:
    45
    Hi there, I'm trying to get the backs of my buildings (they're separate meshes) to cull but they just won't meaning when I'm looking straight down the street there's an awful lot of polys being rendered :(

    The weird thing is (as you can see in the picture) buildings/objects that are behind them do cull. I'm trying to get these backs of the buildings to cull with Optimizers but can't figure it out.
     

    Attached Files:

  30. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Just a guess
    But can the front and backs of the buildings be made into separate game objects to allow them to cull?
     
  31. Calum

    Calum

    Joined:
    Mar 14, 2015
    Posts:
    45
    I think that's the problem. I unpacked my environment prefab and things are culling much better now. Not 100%. At some angles, those steps are still rendering depending on the angle you're looking down the street.

    Thanks for the help :)
     
    dsilverthorn likes this.
  32. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Excellent! Glad it moved in the right direction.
     
  33. Calum

    Calum

    Joined:
    Mar 14, 2015
    Posts:
    45
    Thanks,

    This might be a stupid question but in terms of just environment asset culling what advantages does optimizers offer over Unity's built in occlusion culling? I know optimizers can do lots with lights and particles but if you don't have lots of lights or particles is there a real advantage to using optimizers?

    Thanks again :)
     
  34. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Someone else would have to answer that.
    I only use it for buildings but lately have just been doing videos so I haven’t needed it too much for performance.
     
    Calum likes this.
  35. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Does this or will this asset work with networking (multiplayer)?? Out of the box it works? Needs some setup? Not a feature it has. Thanks in advance because we would love to use this in our game but that is a must.
     
  36. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    Hello, if you have separated rendering things like buildings etc. from netcode, then Optimizers should work with it.
    If your other player instances are using for example something like foot ik, you can try disabling/enabling script responsible for that with optimizers when other players are far from camera.

    Setup of this plugin looks like that: add Essential Optimizer to some enviro object prefab, select components you want to optimize, adjust distance for culling and then it's ready. (there is also tool for automatic detecting prefabs on scene and applying optimizers component to them with auto settings -> Inside Optimizers Manager component -> Scene Tools -> Scene Optimizer)
     
  37. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Wondering. Has anyone attempted or knows if this asset will work alongside of World Streamer 2?? BAsically the cutting up of Large terrain into smaller pieces that load in and out as needed .. Really hoping someone has attempted this already.
     
  38. TrentSterling

    TrentSterling

    Joined:
    Jan 4, 2013
    Posts:
    99
    Having some issues getting the Multiple Terrain optimizer to work. Quest 2, Unity 2019.4.29

    Center terrain gets culled when I reach maxdistance, but when I come back into the area, the terrain stops drawing! I checked the component and the Draw checkbox is unchecked. I can reset the bool in the editor, but when I reach maxdistance it disabled drawing again. Tried every setting that seemed applicable.

    Any help would be appreciated!



    EDIT: I think I figured it out. Draw heightmap needed to be enabled in the lower LODs. There's just so many settings!

    EDIT EDIT: Can't get the settings to apply to any other terrains, even if I add a component to the others. The readme PDF doesn't really mention the terrain setup very much,
     
    Last edited: Aug 22, 2021
  39. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    Wow, some update might break the inspector window of Multi-Terrain Optimizer, I am fixing it right now.
    There is not much in the manual since it should work right away and all important things be described in the parameters tooltips, sorry for that.

    Edit: Package just has been updated, can you try it?
    Now you will see something like this (+more tooltips for "Do" field):
    upload_2021-8-22_14-25-0.png
     
    Last edited: Aug 22, 2021
  40. Filipinero

    Filipinero

    Joined:
    Jul 22, 2020
    Posts:
    1
    Hello everyone!

    I am getting this from my scene:

    [OPTIMIZERS] Optimizer had saved objects to optimize which are not existing anymore!

    Is it safe to ignore this warning?
     
  41. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    In most cases it's harmless, that means optimizer had reference to for example "Light" component but this light object got lost (maybe you just removed it because it's not needed anymore?)
    In the future this log may be removed, in old version of Optimizers it was important message, but current version is handling it better.
     
  42. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Hello- new user- just imported the asset into my 2019.4 project and am getting these two error that prevent anything from being compiled

    Code (CSharp):
    1. Assets\FImpossible Creations\Shared Tools\Editor Tools\Property Attributes\FPD_HeaderAttribute.cs(3,14): error CS0101: The namespace '<global namespace>' already contains a definition for 'FPD_HeaderAttribute'
    2.  
    3. Assets\FImpossible Creations\Shared Tools\Editor Tools\Property Attributes\FPD_HeaderAttribute.cs(10,12): error CS0111: Type 'FPD_HeaderAttribute' already defines a member called '.ctor' with the same parameter types
    It's causing issues in other scripts from the asset as well
     
  43. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    I think some old files wasn't overwritten by package import and files duplicated.
    Can you try removing FImpossible Creations directory and import package again?
     
  44. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Thank you for the reply- followed your instructions and the errors are gone- thank you.
     
  45. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Sorry if this has been discussed but cant find a solid answer. We are looking to Update to V2 but basically have an entire game with multiple scenes all set up with old version of Optimizers and components.. Is there a tutorial on exact steps to take to get the newest version and have it correctly work? I read on the asset store to use "Optimizers Converter V1 to V2.unitypackage" is this included with updating or on a git or drive somewhere? Should we completly remove the old directory before updating (assuming this will give us about 10k errors from missing scripts and that is our worry..) Thank you for the help hoping making the big jump forward can give even more power to this asset.
     
  46. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
  47. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    Hello and sorry for late reply.

    Optimizers Converter V1 to V2 contains old Optimizers core in separated directory, so you would be able to use V1 and V2 the same time, there should be no errors.
    However, there was many changes to directories on my packages, so it will be better to remove "Fimpossible Creations" directory from the project, then import Optimizers 2 and then import converter package, the components of V1 still should be on your prefabs after that (but please keep some backup).
    Then Optimizers V1 should display new buttons on top of the inspector window like this:

    upload_2021-11-4_10-44-40.png

    Best way to use this buttons is doing it through inspector window of prefab (not isolated prefab mode) since unity allows to handle sub-assets of prefab in a better way.

    Do you have custom scriptable optimizer scripts?
    If yes it will be better way to do them from new template since many things changed for handling custom scriptable components.
     
    Last edited: Nov 5, 2021
  48. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Thank you very much. Will be attempting this later today.
     
  49. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Has anyone tested around with the terrain Optimizers very much? Ran an initial test and end result saw worse FPS.. Is this possibly just in the editor, or ??? (Tested on identical 8km x 8km maps, cut up into multiple terrains where we used optimizer.)
     
  50. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    540
    The Unity Terrain component logics are changing through unity versions and enabling/disabling some of the terrain features are causing bigger or smaller peaks depending on the unity version, that's why there is "Do" switch toggle in LOD settings to avoid changing some parameters, which in some unity versions can cause cpu peaks.
    8km x 8km seems to be big, so each enable/disable (for example when camera is rotating around) can trigger a lot of computations for unity engine. Splitting terrain to around 512x512 chunks was in most cases efficient.