Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    This function is almost ready. I will try to finish it in the next update.
    Sorry, I tested only on the PC.
    It is in the plans, but not yet implemented.
    The system can only convert SpeedTree, TreeCreator and custom meshes to AltTree. This is not a system for creating and editing the trees.
     
    roskelld and olavrv like this.
  2. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Happy New Year everyone!:)
     
    olavrv likes this.
  3. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Happy New Year mate!
    And Thanks for this great asset!
     
    Diab1O likes this.
  4. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    Hi,

    is possible to look an integration with Map Magic World Generator ?

    +++
     
    Nateply likes this.
  5. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello!
    I must first finish core system - the basic functions.
    Then I'll think about integration with popular systems.
     
  6. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    I would rather see some global spawning solution based on layer, slope/angle, altitude, normal and image/alpha based masking, something similar to Landscaper. Or to save time, integration with Landscaper to be the first one. :)
     
    simonjewell likes this.
  7. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Okay, I wrote it down.
     
  8. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    For me I would gladly see implemented such solution for normal objects like rocks and such which are most repeatable objects on most of maps.
     
  9. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello!
    Normal objects can be used. In the demo video has mushrooms and stumps. You can also add any other items.
     
  10. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    This looks bloody fantastic!
     
    olavrv and Diab1O like this.
  11. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you!:)
     
  12. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    512
    It bloody is! For the first time we can fill our 80km x 80km terrain with beautiful trees :D
     
    John-G and Diab1O like this.
  13. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    Is there any quick way to reset the system and delete all trees? I'm still only getting about 15FPS (up from about 5FPS with the terrain trees though), so I want to re-do all my trees and try again.
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hey!
    You can remove an object "AltTrees" from scene and add a new one.
    Can you show me a screenshot of the scene with the 15 FPS?
     
  15. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I did try removing the AltTrees object, but when I added a new one, all the old trees were still present. In the end I deleted the folder from AltTreesData, which seems to have done the trick.

    As a result, I don't have the scene with 15FPS anymore - I'm importing a new set of trees (only 115k instead of 350k) as I type this. I was getting about 10,000 batches before - could it have anything to do with the number of tree prototypes I was using? I had 13, but my new test is only using a single tree prototype. I'll let you know how I get on.
     
  16. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    But they have to be a part of terrain objects right ? If so it will be hard to adjust them at some point (change their position and such).
     
  17. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    No.
    You can add an object to AltTrees and put it anywhere. Watch this video: link
    It shows the work with a tree but with the objects - the same.
    Or I misunderstood the question?
     
    Last edited: Jan 7, 2017
  18. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Version 0.9.7, WIP:

    Added support PBR

    Legacy Render:
    bild 2017-01-03 19-23-12-83.jpg

    PBR:
    bild 2017-01-03 19-24-32-20.jpg

    You can configure PBR parameters for each tree.
     
    AndyNeoman and magique like this.
  19. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    HI~~
    is it possible let the wind works with all LOD(LOD0 ,LOD1,LOD2,LOD3,.......,Billboard)?
     
  20. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi!
    Wind is currently working with all LODs.
    Wind for billboards I'll do in the future versions.
     
  21. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Update 0.9.6.1 is available in the AssetStore!

    Changes:
    - Fixed billboards (thanks @larsbertram1)
    - Fixed installer
    - Fixed wind
    - The camera is no longer needed tag MainCamera
    - Fixed a lot of bugs

    Attention! For Unity 5.4.0+:
    Due to an error serialization Unity, automatic updates broken.
    I recommend installing the update in an empty project (without AltTrees).

    How install to not an empty project (with AltTrees):
    1. Create backup project
    2. Open empty scene.
    3. Run Update AltTrees(with the installer)
    4. Select the file "Assets/Plugins/AltSystems/AltTrees/DataBase/AltTreesDataLinks.asset", and assign a script "AltTreesDataLinks" on the missing script.
    5. To all trees(Assets/Plugins/AltSystems/AltTrees/DataBase/Trees) assign script AltTree.
    6. To all altTreesManagerData files(Assets/Plugins/AltSystems/AltTrees/DataBase/AltTreesData/[id]) assign script AltTreesManagerData.
    7. Open your scene with AltTrees. Assign script AltTrees to AltTreesManager.

    Please report all problems found. Thank you for your patience! :)
     
    magique likes this.
  22. Frednaar

    Frednaar

    Joined:
    Apr 18, 2010
    Posts:
    153
    Hi, I really like your asset, but billboards have the typical problem of not looking very good from top down view such as for flying games as billboards are aligned to the camera and look flat from top and rotated towards the camera position in XZ plan

    A nice addition would be to give the option to create 3 billboards along the X,Z and Y axis and not rotate them towards the camera as some games do.

    (I really hope you can find a solution as I am working on a flying game)

    Otherwise great great asset , congratulations !
     

    Attached Files:

  23. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Hi~
    I have found something strange .
    1500 calls come with AltTree for nothing( Whole planeBillboard position at 0,0,0 ),
    Is it a bug ?
    altError.jpg
     
    Last edited: Jan 5, 2017
  24. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    I plan to do different types of billboards in future updates.

    Wow, I'll check, thank you.
     
  25. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi, i am using unistorm weather system, unistorm changes the wind depending of the weather conditions
    is there a way to use the unistorm wind system in place of altwind?

    thanks
     
  26. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    Unistorm uses its own foliage shaders to handle adaptive wind.
    Perhaps they should just use reflection and gain access to the hidden windzone/terrain wind properties instead.
    It's not difficult.

    Windzones can affect grass and particle systems as well.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    As I was trying this out the other day, I had one persistent issue. It was mostly impossible to place trees in the correct location when the scene was zoomed out even a little bit. The tree placement brush was always far from the correct location. But if I zoomed in closer to the areas where I wanted to place trees then the brush shows up in the correct location on the ground. Note that this was testing on a mesh terrain and not Unity terrain. So the results may be different for Unity terrain.
     
  28. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi all,

    Is anyone getting batching with AltTrees?

    I'm not getting a single one which is unexpected. I'm also not getting anywhere near the 1000's of trees at the moment either. I have found an issue with Aquas and reflections but even with out that I would have expected to lay down more trees.

    It is still very early days and off course an improvement over the terrain tree's and great value but I just looking for a few pointers really to get more trees in there.
     
  29. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,

    At the moment, it is impossible. I'm doing the API to be able to change the trees and the wind from the code.
     
  30. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    What means "when the scene was zoomed out"?
    And can you show a screenshot? I do not understand the problem.
    Hi,
    batching impossible. AltTrees itself combines billboards, to improve performance.
     
    AndyNeoman likes this.
  31. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938

    Thanks Diab,

    Is there any tutorial on getting higher tree density in the scene? Which options do you recommend tweaking to get the most in there?

    My game is set in dense jungle so this is the most important feature for me.
     
  32. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    This article is not currently exist. In the near future I will write to her.
    The next update will improve the performance.
    You can send me screenshots of your scene + screenshots with the option "Debug Billboards DrawCalls". I look, and give recommendations for setting.
     
    AndyNeoman likes this.
  33. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    Yes, that is exactly what I wanted to achieve.
    Is it possible to migrate objects to Your system ? I mean I got map already populated. Nothing integrated with terrain, all as separate objects.
     
  34. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    I will record a video to show the issue.
     
    Diab1O likes this.
  35. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks, im sure it is because I am getting used to the system but i just did a quick test, 5000 trees getting 120+fps at all times, converted them to Alttrees (no changes) and now it gets 80-90fps but also the odd drop to single digits. The look is much improved, so i am happy with that but I was hoping the performance would go up (or at least stay the same).

    I will play around with it a bit more and if i am still having problems I will take you up on the offer :).
     
  36. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Im getting this error - not sure if its related to the slower performance. I am also getting a simila error with uNature so i am wondering if the two are having compatibility issues.

    Anyone else using the together?

    Assertion failed on expression: 'm_PreloadTextureAtlasData.size () == m_DetailPrototypes.size ()'
    UnityEditor.AssetDatabase:SaveAssets()
    AltSystems.AltTrees.Editor.AltTrees_Editor:Import() (at Assets/Plugins/Editor/AltSystems/AltTrees/AltTrees_Editor.cs:1679)
    AltSystems.AltTrees.Editor.ImportTreeWindow:Convert() (at Assets/Plugins/Editor/AltSystems/AltTrees/ImportTreeWindow.cs:754)
    AltSystems.AltTrees.Editor.ImportTreeWindow:OnGUI() (at Assets/Plugins/Editor/AltSystems/AltTrees/ImportTreeWindow.cs:192)
    UnityEditor.HostView:OnGUI()
     
  37. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    It will be possible in the next update.
    Maybe this is a problem in the grass? https://forum.unity3d.com/threads/m_preloadtextureatlasdata-size-m_detailprototypes-size.351643/
     
  38. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hey, just thought I'd leave some feedback as I bought it a few days back:

    1. There is a lag at when the game starts and the trees are populating, on my laptop it can take up to 30 seconds.
    2. There are occasional freezes during gameplay.
    3. Please add the option to place all trees of all types.
    4. Please add the option to clear all trees, or selected trees only.
    5. There is a noticeable lag when placing trees.

    Overall nice work so far, I noticed the performance improvement, though without the option to clear all trees I haven't been able to test it as much as I wanted.
     
  39. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hey! Thanks for the feedback!

    1. I am working on it. How many trees in your scene?
    2. I will soon fix it.
    3. I will add it in future updates.
    4. I will add it in future updates.
    5. I will soon fix it.
     
  40. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Ok great! I've tried it on various old projects, with varying amount of trees, but there is always some lag. Hopefully I'll have more time to test it over the weekend. I was mostly testing it with this excellent Tropical Forest pack but I also noticed that when the camera looks up, the billboards are clearly visible at the top of the trees. The pack includes a giant canopy tree, which may have caused this problem. But I'll test it more later, maybe I set it up incorrectly.

    EDIT: Before I forget, an option to select Billboard only would be useful for racing games where the player won't go near the trees.
     
  41. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Okay, good idea!
     
  42. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    Sorry for digging this but any timeframe for that feature ? We are almost ready to release and we would like to include Your package in our project as optimization thing.
     
  43. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Before the end of January.
     
    Killersan likes this.
  44. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I've noticed a large increase in performance with the latest update - good work! I don't seem to be getting any LOD for my tree though. Some trees close to the camera are at LOD0, but everything else is always a billboard. I've tried changing loads of settings on the tree itself and the AltTrees script, but I don't seem to be able to get LOD1 or LOD2 to appear.

    Also, sometimes I can drive right through a billboard tree. What I really want is to make sure I never see a billboard close up, even when travelling at up to 200mph. Could you suggest a combination of settings that would give this effect?

    Keep up the good work though, this is a really excellent asset.
     
  45. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    Here is the issue I was talking about. You'll also notice that the response is extremely sluggish. Whenever I move the mouse to a new location it takes about a second for the brush to catch up. And the brush is rarely in the correct spot unless I zoom in close to the mesh terrain.

     
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    I'm also getting the following errors when running the game in the editor:

    NullReferenceException: Object reference not set to an instance of an object
    AltSystems.AltTrees.Editor.AltTrees_Editor.OnEnable () (at Assets/Plugins/Editor/AltSystems/AltTrees/AltTrees_Editor.cs:131)

    NullReferenceException: (null)
    UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs) (at C:/buildslave/unity/build/artifacts/generated/common/editor/SerializedPropertyBindings.gen.cs:74)
    UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:154)
    UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:147)
    UnityEditor.TransformInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/TransformInspector.cs:26)


    I thought this might have something to do with the serialization issue you mentioned that occurs in 5.4, but I imported AltTrees into empty project and copied into my main project after that.

    In addition, the fix you provided for the Wii U isn't included in the latest package so I had to copy over the file you provided to patch it.
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    More issues on Wii U. I see tree leaves that are a mixture of correct looking leaves and some that have white outlines on them. Also, a very strange situation where the tree seem to bend backwards 90 degrees and then it looks like leaf geometry flies off the trees when the tree snaps back into place. It's very bizarre. In addition, there are 1-2 places in the scene that frame rate just plummets every time I'm in those areas. I now have generate billboards at start checked, but that hasn't helped. It seems like this is definitely not going to work on Wii U at this time.

    [EDIT]
    By turning off mesh and billboard cross-fade I get rid of the weird bending and leaf fly off issue, but I still have the white outline leaves and frame rate drops in specific areas.
     
    Last edited: Jan 7, 2017
  48. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi! Can you send me screenshots of your scene with the option "Debug Billboards DrawCalls"?

    Wow. In another scene the same?
    Other questions I will try to fix in the next update.
     
  49. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hey, I thought of a feature for the future once all the bugs are ironed out. It is to randomly spawn the trees and foliage at run time, so that every game would be different. Also the ability to add tags and layers, so that they can be avoided using an AI system without having to add colliders, useful for sniping games, etc.
     
    Last edited: Jan 8, 2017
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    In a scene where the ground is just a flat plane it seems to work better as far as brush positioning, but it's very sluggish in every scene I've tried it in so far.