Search Unity

Assets AltTrees System [WIP] [AssetStore]

Discussion in 'Works In Progress - Archive' started by Diab1O, Sep 19, 2016.

  1. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Have you marked small shrubs and other small objects like "Is Object"?
     
  2. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    Thanks for letting me know. Is that going to be a feature in the future for ultra large terrains?
     
  3. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Yes, I plan it.
     
    Mark_01 and The_Uber_Rasta like this.
  4. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    I have not, I'll try that.
     
  5. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi is there a way to disable the gameobject tree for tree chopping? What happens is if the health is 0 it disables the gameobject for some secs before it respawns by turning it back on... the colliders are working but the tree still stands :D

    I have all my trees and plants set as gameobject
     
  6. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    If I correctly understood the question, to remove a tree you can use the following function: AltTrees.removeTrees
     
  7. sSuite

    sSuite

    Joined:
    Sep 28, 2014
    Posts:
    17
    Hi! I'm getting these errors & have no idea what they're referring to. Any advice?
    upload_2017-7-8_4-21-36.png
     
  8. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I don't want to delete the tree, only I want to disable the game object or turn off the renderers.

    I'm wondering I'm placing my trees as game Objects and not trees, can I just drag the new alt tree gameobject to the terrain to use or do i have to use the alt trees manager to use your system.

    Thanx Jim
     
    Last edited: Jul 8, 2017
  9. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Sometimes when I deselect AltTrees and select it again a "Working...Please wait..." Progress bar pops up and takes forever, sometimes more than 30 minutes. The most annoying thing about it is i can't do anything else because Unity takes Focus every few seconds.
     
  10. Ninlilizi

    Ninlilizi

    Joined:
    Sep 19, 2016
    Posts:
    294
    This fails on build with:

    Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesPatch.cs(2016,32): error CS0103: The name `AssetDatabase' does not exist in the current context​

    Ideas to fix this anyone?
     
  11. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Sorry for late answer!
    Did you edit this file manually earlier? "Assets\Plugins\AltSystems\AltTrees\DataBase\AltTreesDataLinks"
     
  12. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You can only disable rendering of all trees (make the manager object inactive).
    It is necessary to place trees through the manager.
    You can import your objects into the manager using this: Import Trees from Scene
     
  13. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    This happens when the terrain size in the scene changes.
    Do you change the size of the terrain? How many terrains in the scene? What is their size?
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Find the 2014 line in the file "Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesPatch.cs".
    Replace it
    Code (CSharp):
    1.                         if (treesNoGroupData != null)
    2.                         {
    3.                             pathStr2 = AssetDatabase.GetAssetPath(treesNoGroupData);
    4.                             if (pathStr2 != "")
    5.                                 bytesTemp3 = File.ReadAllBytes(pathStr2);
    6.                             else
    7.                             {
    8.                                 bytesTemp3 = treesNoGroupData.bytes;
    9.                             }
    10.                         }
    11.                         else
    12.                             bytesTemp3 = null;
    on this
    Code (CSharp):
    1.         #if UNITY_EDITOR
    2.                         if (treesNoGroupData != null)
    3.                         {
    4.                             pathStr2 = AssetDatabase.GetAssetPath(treesNoGroupData);
    5.                             if (pathStr2 != "")
    6.                                 bytesTemp3 = File.ReadAllBytes(pathStr2);
    7.                             else
    8.                             {
    9.                                 bytesTemp3 = treesNoGroupData.bytes;
    10.                             }
    11.                         }
    12.                         else
    13.                             bytesTemp3 = null;
    14.         #endif
     
    Ninlilizi likes this.
  15. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Yeah this was after splitting the Terrain, a 2048mx2048m into 1024 64mx64m Terrains. I ended up killing Unity and reloading. I regenerated the trees on the original Terrain again, converted them to altTrees, made a prefab of the altTrees manager and used that in the gamescene where I stream my Terrains. Works perfectly and faster than waiting on that progress bar.
     
  16. sSuite

    sSuite

    Joined:
    Sep 28, 2014
    Posts:
    17
    Aha, yes! It was causing some source control issues, so I reverted it to an earlier version. That seemed to help, but I guess it was a bad idea. Is there any way to fix this?
     
  17. Sp-ce

    Sp-ce

    Joined:
    Feb 2, 2015
    Posts:
    65
    Hello Diab1O,

    I'm very interested in this tool! It looks great, but I'm wondering if there are any updates regarding Map Magic? Is Alt Trees and Map Magic incompatible?

    Thanks!
     
    The_Uber_Rasta likes this.
  18. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Select this file in the editor. It contains 3 arrays. You need to make them the same length.
     
  19. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    At the moment they are not compatible, but I plan to fix it.
     
    Dwight_Everhart likes this.
  20. sSuite

    sSuite

    Joined:
    Sep 28, 2014
    Posts:
    17
    Thanks! that worked perfectly.
     
  21. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    I bought your system with the intent of using it but then discovered that it is Windows Only - please consider looking at resolving this as there are few desktop commercial games where only a single platform is supported. Most of us build for Windows, OSX and Linux and therefore a solution like this just gets dismissed immediately as of no use. I'm an indie developer the same as you are, I had to buy a mac to build for Mac's but the investment was more than worth it in sales.
     
  22. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    Can you tell me the problem? What does not work?
     
  23. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    Im getting a very annoying error with Unity 2017.1

    "InvalidOperationException: Material needs to enable instancing for use with DrawMeshInstanced."

    PLEASE FIX!!!!! Any Ideas?
     
  24. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    I was going by the comments of a previous forum message where the person was unable to get it working with OSX and your response was that you couldn't work on it as you don't have a Mac ..... has the status changed?
     
  25. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You need to install the latest version of AltTrees, for Unity 5.6.0+

    No, it has not changed. I do not have any other platforms than Windows. If you say what errors you get - maybe together we can find a solution.
     
  26. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    imported package. installed. opened demo scene and:

    AltTrees: dataLinks.getId(prototypes.tree) == -1. (9810294)
    UnityEngine.Debug:LogError(Object, Object)
    AltSystems.AltTrees.AltTrees:LogError(String, Object) (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:585)
    AltSystems.AltTrees.AltTreesPatch:Init(AltTreesManager, AltTrees, AltTreesManagerData, Boolean) (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesPatch.cs:785)
    AltSystems.AltTrees.AltTrees:Init(Boolean) (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:252)
    AltSystems.AltTrees.AltTrees:UpdateFunk() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:441)
    AltSystems.AltTrees.AltTrees:OnDrawGizmos() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:420)
    UnityEditor.DockArea:OnGUI()


    clean project
     
  27. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    This is a false mistake, do not pay attention. It appears only when you first open the demo scene.
     
  28. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
  29. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Hey @Diab1O I'm getting the same error as @Ninlilizi when trying to build.
    Code (CSharp):
    1. Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesPatch.cs(2016,32): error CS0103: The name `AssetDatabase' does not exist in the current context
    and

    Code (CSharp):
    1. Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesPatch.cs(2016,21): error CS0103: The name `pathStr2' does not exist in the current context
    Any ideas?
     
  30. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hey,
    Please look at this post:
    #post-3138186
     
  31. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    OMG I'm blind. Thank you.
     
  32. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You are welcome :)
     
  33. hellpenguin30

    hellpenguin30

    Joined:
    Sep 15, 2015
    Posts:
    15
    Does AltTrees Support Grass meshes as well? i made a normal map with regular unity terrain builder- was getting great FPS, then i added more grass- and the FPS is Terrible. Will this be able to resolve my issue using your AltTrees systems to export my tree's and grass mesh. Also one last thing if my Trees already have LOD's will you system detect that. Thanks, really interested in purchasing if this is possible
     
  34. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    AltTrees improves performance due to the system of far billboards. If your grass is far visible - maybe it will be better.
     
  35. hellpenguin30

    hellpenguin30

    Joined:
    Sep 15, 2015
    Posts:
    15

    so would the trees and grass i have look the same but with better performance- with your tool. hope this screenshot of my game shows
     

    Attached Files:

    Diab1O likes this.
  36. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    trees broken after hit play. it happens if i import trees from existing terrain. spam of errors:

    InvalidOperationException: Material needs to enable instancing for use with DrawMeshInstanced.
    UnityEngine.Graphics.DrawMeshInstancedImpl (UnityEngine.Mesh mesh, Int32 submeshIndex, UnityEngine.Material material, UnityEngine.Matrix4x4[] matrices, Int32 count, UnityEngine.MaterialPropertyBlock properties, ShadowCastingMode castShadows, Boolean receiveShadows, Int32 layer, UnityEngine.Camera camera) (at C:/buildslave/unity/build/Runtime/Export/Graphics.cs:411)
    UnityEngine.Graphics.DrawMeshInstanced (UnityEngine.Mesh mesh, Int32 submeshIndex, UnityEngine.Material material, UnityEngine.Matrix4x4[] matrices, Int32 count, UnityEngine.MaterialPropertyBlock properties, ShadowCastingMode castShadows, Boolean receiveShadows, Int32 layer, UnityEngine.Camera camera) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GraphicsBindings.gen.cs:2177)
    UnityEngine.Graphics.DrawMeshInstanced (UnityEngine.Mesh mesh, Int32 submeshIndex, UnityEngine.Material material, UnityEngine.Matrix4x4[] matrices, Int32 count, UnityEngine.MaterialPropertyBlock properties, ShadowCastingMode castShadows) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GraphicsBindings.gen.cs:2142)
    AltSystems.AltTrees.AltTreesManager.DrawMeshes () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:820)
    AltSystems.AltTrees.AltTreesManager.LateUpdate () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:441)



    IndexOutOfRangeException: Array index is out of range.
    (wrapper stelemref) object:stelemref (object,intptr,object)
    AltSystems.AltTrees.AltTreesManager.DrawMeshes () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:614)
    AltSystems.AltTrees.AltTreesManager.LateUpdate () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:441)
     
  37. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    dont know what was that errors. but now seems all ok.

    there is aother problem. in VR alt trees doesnt help anymore. in fact 10000 trees on terrain faster then 10000 trees imported to alt trees from terrain.

    EDIT:
    generated trees by alt tree dont have instancing option ON in material. checked it and magic happened.
    keep testing it.

    EDIT 2:
    all broke again after i clicked "update billboard texture and refresh scene" button in alt tree.

    found out that instansing option not turn on in bilboard materials. this is causing error spam and unvisible trees (billboards still can be seen). if i turn ON instancing manualy, then all trees generating but fps insanly slow.
     
    Last edited: Aug 4, 2017
  38. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    I think you have an incorrect version of AltTrees.
    What version of Unity and version of AltTrees?
     
  39. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    alt trees 0.9.8.1
    unity 2017.1.0f3 personal
     
  40. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Open the "Assets\Plugins\AltSystems\AltTrees\Scripts\AltTrees.cs" file. Find the line with the code
    Code (CSharp):
    1. static public int altTreesVersionUnity =
    What version is written? Should be 560
     
  41. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    yep, it is, line 13: static public int altTreesVersionUnity = 560;
     
  42. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    Sorry for late answer!
    Open the file "Assets\Plugins\AltSystems\AltTrees\Scripts\AltTreesManager.cs", find line 2780:
    Code (CSharp):
    1. #if UNITY_5_6
    Replace it with this one:
    Code (CSharp):
    1. #if !(UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5)
    The error "InvalidOperationException: Material needs to enable instancing for use with DrawMeshInstanced." will disappear.
     
    Vagrod likes this.
  43. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    Hi i need to populate terrain with trees on runtime with my generator, will i be able to do it?
     
  44. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
  45. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579

    This is runtime generated, these are prefabs, i need to know if
    1. I can delete trees on runtime easily with a delete tool
    2. I can save the state on runtime.
    (or at least you have exposed the DATA that i can save myself, shouldnt be that hard to make a list or whatever data structure youre using public, eh?)
     
  46. TheReEvolutions

    TheReEvolutions

    Joined:
    Dec 13, 2014
    Posts:
    2
    I have a question. I'm using a mesh for a terrain in my project, I use it because I can't move unity's terrain at play time. My my project has a large terrain and I move the word to the origin so I dont have issue with float point accuracy. I use The AltTrees system for my large map and it works great, I just have a small problem, you see when I reset the origin I move the my terrian mesh. The problem is , when I "reset" the trees don't, they stay. I was wondering if there was a way to move the trees along with my terrain mesh , If you know a solution please let me know. Thanks again cheers.
     
  47. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    you can move terrain if you uncheck "static" on it
     
  48. TheReEvolutions

    TheReEvolutions

    Joined:
    Dec 13, 2014
    Posts:
    2
    Not on play time.
     
  49. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
  50. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Yes
    No, at the moment it's impossible.
    Please look at the script "FloatingOrigin" in the demo scene on Camera.