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

[RELEASED] Truss Physics for Unity3D. Soft-body simulation plugin.

Discussion in 'Assets and Asset Store' started by Heartbroken, Aug 22, 2015.

Thread Status:
Not open for further replies.
  1. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Very cool :) If you can make a walk through of a simple drivable car / softbody wheel setup ( I am interested in softbody tires mostly) that would be really well received, your video would be a ground breaking one, lots of views I am sure :)
    Finger crossed this will materilize :)
     
  2. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    If you want soft tires only you have the problem a) very hard to setup the car suspension, and b) Unity's joints. I've only just setup a full softbody car to test, and initially right now I'm finding the same problem with the TXConstraints, the wheels pull away from the joint under heavy load, like turning at high speed, this is a photo of softbody tires *only* with the joint problem:
     

    Attached Files:

    khos likes this.
  3. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    You should increase SubstepPower in Truss Scene settings to solve this problem with TXConstraint
     
  4. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    This still works in unity 2018/19?
     
  5. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    That is totally cool! Even just a couple of hints of how to that up will help people, it is like a dark art or something. I'm interested in slow moving vehicles so soft tires would be really awesome :)
     
  6. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    108
    Can you made Tutorial ? :)
     
  7. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    I have done, but I think I was mistaken, the joints where okay I had soft links which pulled as I was turning, however, I did have to increase the Substep power but that was for the reason I asked if your vehicles reached the correct speeds, which mine weren't, 3rd gear wouldn't accelerate, so I increased the Substeps and now it accelerates better, so the fast rotation wheels become less accurate the faster you go.
     
  8. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Have you had to increase Substep Power in your project? I've had to because the vehicles don't accelerate properly. Have you tried testing this by creating a vehicle (standard) with standard torque output and see if it accelerates correctly per gear with Gear ratios, I have and it doesn't! So far.
     
  9. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I spent a lot of time for this, but it works now. Here are my scene settings and settings of my CarControl script

    upload_2019-2-19_19-26-12.png

    upload_2019-2-19_19-27-9.png
     
    Fibonaccov likes this.
  10. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Okay thanks I'll try that with mine in the morning, what's Tire gum hardness?
     
  11. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    Here are settings for wheel and tire gum

    upload_2019-2-19_22-13-8.png
     
    Fibonaccov and khos like this.
  12. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Oh ok, very cool! Just to ask if ok, did you make a copy of the red car demo and then make it your own? How did you get to this point?
     
  13. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Yeah those scene setting make everything work with car acceleration but Truss runs way too slowly, at least on my machine. What happens when you drop Substep to 3? Could you tell me if there is much difference with your vehicle's acceleration.
     
  14. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Here's a good question regarding Vehicle projects and Truss physics, because we are using Truss for tires, it makes it hard for others to calculate Forward and Side wheel slip, like the WheelCollider, how have you calculated wheel slip, are you using the RedCar Skidmarks code still?
     
  15. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I made my own project. If you understand the basic idea, you can create car with truss physics. But creating suspention and wheel joints (TxConstraint) are very complicated processes, I spent 2 or 3 months till I get working project
     
  16. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    When I set substep to 3 wheels and suspention moves like jelly. My congiguration is Core i3 8100/16GB RAM/GTX 1060 3GB
     
    Last edited: Feb 20, 2019
  17. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I'm using RedCar code for skidmarks
     
  18. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Substep set to 4 is very slow, my computer isn't slow and I can barely get 8fps!
     
  19. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    But how are you calculating forward and side wheel slip? 0.0-1.0 like the wheel collider. You must need this data for something? I'm using it for skid sound volume and pitch but the Redcar demo's way of doing it doesn't calculate radial wheel slip.
     
  20. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Hi, no probs, that is the thing though, I don't many people understand the basic idea as you say :)
    Would you be willing to make a youtube howto recording? I guess not include suspension/wheel joints, just a basic cr with soft tires would be most wesome.
     
  21. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    You can't setup softbody tires without suspention and constraints. First of all you should create deformable car softbody, and after this you should understand ho to link whhels to car softbody with suspention and TxConstraint
     
  22. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I don't fully understand how calculates wheel slip, I'm using Skidmarks script from redcar demo.
     
  23. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    I am too, because I can't figure out how to do real tire slip calculations, take a look at the Wheel Collider's forwardSlip and LateralSlip.
     
  24. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    Do you have redcar skidmarks script?
     
  25. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    That would take hours of video, starting from modelling the wheel in 3dsmax/Blender and car body, correctly, then creating the Truss for wheel and car body, properly, then designing the suspension, then attaching the wheel to the suspension. That's a mammoth tutorial!
     
  26. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Yes, I've had to settle for this code for now until I can figure out how to do real wheel slip.
     
  27. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    I wonder if I could take the red car code and adjust to my needs, would that be easy (er)? If you find time to make a tutorial video that would really cool! And popular.
     
  28. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    I learned everything from the Redcar demo, then additional help on here.
     
  29. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    It's not take a lot of time if you know what are you doing. I think about 1-2 hours with ready 3D models.
    1. Create truss for car body - about 30-40 min
    2. Create suspention - about 15-20 min
    3. Create wheels truss and constraints - about 15-20 min.

    Maybe I'll create video tutorial if I would have more free time
     
    n00b_013 and khos like this.
  30. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Yes that wouldn't be as bad, I got the impression people wanted a full tutorial.
     
    n00b_013 likes this.
  31. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    I'm running a test tomorrow with my vehicle running with NWH vehicle physics, I'm going to see how they perform back to back with Truss, my theory is that if you want fast moving vehicles you have to increase the Subset power for each stage of top speed, 0-90mph Subset 3, 100-140mph subset 4, 140-180mph subset 5, by then any machine will run too slow, I think the fast rotating Truss wheels require huge amounts of cpu power to accelerate to high speeds. Unless someone has a solution to this. Then we have the problem of more than 1 vehicle.
     
  32. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Would be great. Every now and then I give truss a try, I also uploaded the fix for the redcar demo a while back, but I just can't seem to get things to work the way I want.

    Wouldn't it be possible/better to use a different tire physics solution on a truss based car? Tire physics are very complex.
     
  33. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Please ! :)
    That would be most kind.
     
  34. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Do you mean for example, use RCC vehicle or NWH Vehicle wheels with Truss Soft body? I've never thought about that, you might be able to.
     
  35. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I did it, but in this case you get realistic body deformation and no suspention deformation.
     
  36. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    What about if you build the suspension like I did with Rigid bodies, then link that to the soft chassis body? If this is possible I may move over to this idea, soft tires are too slow for what I want.
     
  37. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    Try to uncheck Skinning in tire softbody setup
     
  38. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Still 10fps with Subset 4
     
  39. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    What configuration of your system?
     
  40. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Or a different softbody solution wheel only with normal car controller.. ?
     
  41. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    108
    Can you make VideoTutorial ? :)
     
  42. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    i5-6400 CPU 2.7ghz 4 cores
    GTX 750 Ti 2Gig
     
  43. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    I don't think there are many other solutions like this, but even if there were they would have the same problem, fast rotations are extremely computational, even BeanNG.Drive had exactly the same problem.
     
  44. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    108
    Guys can help with TrussPhysics ?
     
  45. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    How did you manage to do this, at first glance any vehicle controller which uses Wheel colliders has to have a Rigid body root? I've looked at the NWH vehicle controller/Wheel Collider 3D and that uses the same method as Edy's vehicle controller, applies forces to the Rigid body corners, none of this is any good for Truss physics?
     
  46. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    Okay, what specifically can't you do? Ask us for a narrowed down problem, step by step.
    Stage 1:
    a) Have you built a wheel yet in 3D?
    b) Have you set a Truss up for the wheel and had it bouncing on the ground it's own in Unity?
    That's the easy bit.
     
    Shadow-X6 likes this.
  47. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    108
    Yes i did but my Wheel have bugs i need create Vehicle with TrussPhysics but i dont know how work this you can made VideoTutorial how do with TrussPhysics pls i need know how Thanks
     
  48. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    What is the bug exactly with the wheel? can you post a few photos of the bug happening, we need more details if you want us to help. Forget about the car body truss for now, get the wheels working first. Please post some photos.
     
  49. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    How many nodes and links has your softbody wheel?
     
  50. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    113
    110 Nodes
    689 Links

    upload_2019-2-22_9-8-54.png
     

    Attached Files:

Thread Status:
Not open for further replies.