Search Unity

[RELEASED] Cut Trees

Discussion in 'Assets and Asset Store' started by danilec1313, Jan 7, 2022.

  1. danilec1313

    danilec1313

    Joined:
    Mar 10, 2018
    Posts:
    6

    Hello everybody!

    [SKIP this if you wish (my story)]
    7 years ago I decided to create some cool videogame. Without any knowledge in programming or Unity3d.
    It was a long but interesting way to learn programming.

    I started from Flash (ActionScript 3), then I learnt a little bit of web developing, mobile developing in Android (because I had 25 dollars for Google Developer Account but not 100$ for Apple Developer Program, also I had an old android phone, so the choice actually was only Android developing hahah)

    Then I found a job in IT as an ABAP developer, after SAPUI5 developer, web, etc. and actually there I got a big, real experience that helped me to grow in gamedev also. Because gamedev always was my passion and all my free time I spent on this. Doing something in Unity3d.

    Also the choice between Unity or Unreal was funny. I read a lot of articles, I sow a lot of video discussions but the decision was made after I download them both and tried to do some simple thing. Intuitively Unity was much better for me. Where to click, drag, where to code, how it interacts, etc.

    And during mm five and half years I was seeing how Unity changes, how it goes better and offers more cool, and very useful things, later I discovered Unity Asset Store. It's a very big pleasure to use it because a lot of talented people create awesome things that you can buy and use in your projects and it saves your time and also you can learn from them. It's amazing.
    THANK YOU developers from Unity teams and developers and 3d designers from Unity Asset Store!

    [Cut Trees pre-story, SKIP if you wish]
    So, almost 5 years I'm creating my own (big hahah) game. I don't remember how much times I started from 0 just because of learning so much new cool things every time and desiring to do things well.

    So, in my game I wanted to have the ability to cutting the trees to get a wood resources for buildings. I tried a lot of things, workarounds, etc (shaders, decals for example).
    Then I discovered that actually I can do things with meshes in runtime. And since July I was working on this tool. And finally I made it work. And I want to share it with you!

    (actually this is my second asset that I was trying to publish in Asset Store but the first one was not accepted and after 2 years since of that try I can say myself that yes, that asset could be much more better hahah)

    Unity Asset Store accepted my submission!! It's my first Asset in the Store!! I'm so happy!!

    [Cut Trees]

    So what is about.
    This tool is for preparing the tree asset in editor mode and then in runtime you can use an API function and add the damage to the tree and chop, chop, chop and finally cut it down.

    • As I tested it in Built-in Renderer Pipeline so in Asset Store I put only this Pipeline. But as there are pure mesh modifications I think it will work in other Pipelines too.
    • No Jobs, no multithreads, so it should work in any build like standalone, mobile, WEBGL, etc.
    It works with Unity Trees and SpeedTrees. All with Unity wind if you have Unity wind present on the scene, without wind it works too :).
    Also it should work actually with any mesh you desire. Just prepare the cut data due to documentation and you can cut any 3d model.

    But the correct behavior I can't guarantee if you will try it with some custom shader that handle some custom wind or other movements of the textures in verts.

    • No character controller included (because there are a lot of character controllers can be used)
    • 2 Demo scenes with possible usage are included
    • All runtime usage is just one call of the API function (addDamage) to add the damage and adding some callback functions if needed (see documentation).
    • Basic level of programming is required

    Also you can see the [DOCUMENTATION]

    Happy to share it with you!
    All questions, suggestions are welcome!!
    Thank you!
     
    Lars-Steenhoff likes this.
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    If you can do the cutting only from one side it would look better. ( the side of the axe )
     
    danilec1313 likes this.
  3. danilec1313

    danilec1313

    Joined:
    Mar 10, 2018
    Posts:
    6
    Yes! I was thinking on it from the beginning. And actually I had a version with that. But I wanted to add the possibility to cut the tree in different by height places. (Actually now the cut is at the height of the first chop, but I'm on it and will be in future updates)
    So, if I introduce multicut by different height if I not finished for example some cut at some height, exist probability for player to cut in another position at the same height and this adds a lot of new data, recalculations in second or third cut will add a lot of garbage data more, so at the moment I leave it like this.

    As always I needed to choose between the speed of the calculations and appearance. And in WEBGL for example this would take a big delay.

    Thank you for your thoughts!
     
  4. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    2eb1353465d39bae463be09db1654830.jpg images.jpeg

    Thank you for making this nice asset!

    I would start by flattening the middle vertex to match the outer vertices, It will all-ready look better I think.

    First I would try a flat cut, like from a chainsaw, and if that works a sloped cut.

    cut 1.png

    cut 2.png
     

    Attached Files:

    Last edited: Jan 7, 2022
    danilec1313 likes this.
  5. danilec1313

    danilec1313

    Joined:
    Mar 10, 2018
    Posts:
    6
    Yes! Totally agree. I will try to add this feature. And also I was thinking to add different selection of the mode. Like if this is for AAA games for PC so more realistic. If is for WEBGL or mobile for example, so less realistic.

    Thank you!!
     
    Mark_01 and Lars-Steenhoff like this.