Search Unity

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

Discussion in 'Works In Progress - Archive' started by Heartbroken, Jan 31, 2014.

  1. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi community!

    Just a quick post to show off my "work in progress" soft-body simulation demo:



    Cheers :)


    Update 4 Jul 2014

    Hi all! That's a loooong delay :)

    But anyway. Here is a new video of my soft-body (or deformable-body, if you prefer ;)) simulation plugin.



    Looks similar, but it's rewritten almost form scratch. The performance is improved dramatically. The C# part object model is greatly simplified. And some new cool features are implemented.

    The public demo and beta of the plugin are coming soon.

    Cheers :)


    Update 11 Aug 2015

    Hi all,

    The asset is submitted for review.
    While I'm waiting for the review result you can watch another RedCar Demo video :)



    And play the demo itself of course ;) RedCar Demo (Zip 9.5MB)

    Cheers :)
     
    Last edited: Aug 15, 2015
    ZiadJ, woodsynzl and EliasMasche like this.
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That looks pretty fun but was seemingly more focussed on deformation than soft body physics and such. Would you be able to give examples of more organic things compressing and bouncing/flexing and so on? As i'm very interested in that sort of thing and currently would have to pre-bake an animaton doing it in houdini or something at the moment for the effects I want to achieve when interactive would be much more desireable
     
  3. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    @lazygunn - Thanks for your feedback. It's already kind of tradition to call this type of simulation "soft-body" as opposite to "rigid-body" which can not deform by definition. Of course, our soft-body can also be tuned to have jelly-like behavior, but doing demo with such objects is not really interesting. It's too simple :) In any case, it's just our first steps, and I believe in the future we will have such demos as well.

    Cheers :)
     
  4. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi! Just updated the first post with the link for a new video:



    Cheers :)
     
    FBTH likes this.
  5. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    Looks really neat.
    I could play with that demo for hours (I love games like Flat Out and Destruction Derby)

    Off-Topic question: What's the song in the video?
     
  6. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Thanks

    Yes, that's why it takes so long, instead of improving the simulation I just play with it for hours

    The song is just a music YouTube proposes for free. "Electric Beat" or something like that

    Cheers
     
  7. Dag-Tholander

    Dag-Tholander

    Joined:
    Jul 16, 2014
    Posts:
    90
    are your car a single mesh?

    Im not so good at scripting with meshes so I found a script, but it requires a rigidbody and my car is not a single mesh, so when i try to add that script to my car parts the rigidbody combined with the colliding car part colliders and makes the parts fly away in every direction do you got any tips?
     
  8. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi Dag,

    All detachable parts of the car are separate meshes. But, I think I should mention, my demo doesn't use unity's built-in physics. It's a demo of Truss Physics engine, so it uses Truss Physics.

    As for your problem, I think you should setup different collision layers for different parts of your car:
    http://docs.unity3d.com/Manual/LayerBasedCollision.html

    Hope this will help.

    Cheers ;)
     
  9. Jamcount

    Jamcount

    Joined:
    Apr 20, 2014
    Posts:
    44
    I didn't know that GTA 6 will be developed in Unity... Just kidding, keep up the good work.

    -Jamcount;
     
  10. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Actually, why not ;)
     
    Jamcount likes this.
  11. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
  12. MaxieGast

    MaxieGast

    Joined:
    Jan 18, 2013
    Posts:
    2
    First of all, just one word: Awesome.
    I didn't know this was actually possible in unity.
    I need this really much,and this was just the thing which i was looking for.
    Can't wait when its finished.

    Now i still have a few questions:

    1. When can we download it? Because without this i can't really work further with my game.

    2. Is it going to cost money? Yes? How much?

    3. Can you implement diffrent cars?

    4. Would it be easy to import in your game.

    Well i dont need answers to all questions just the ones which you have the answers from.

    But as i already said, good work guys, Awesom!
     
  13. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Is this something like what beamng is doing?
     
  14. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Looks quite nice, seems like it's better than ROR (what beam ng is originally made out of).
    Tho there is a massive performance issue. The demo starts lagging pretty fast.
    But I like the car physics aswell, seems like there is a spring tire model?

    Anyway keep up the good work!
     
  15. Kaji-Atsushi

    Kaji-Atsushi

    Joined:
    Oct 6, 2012
    Posts:
    234
    Fantastic work is all I have to say :). Keep it up!
     
  16. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    1. When(if) it's done. Depends on how few people need this.
    2. The more people need it - the cheaper it is.
    3. Sure. It's general purpose. You can implement anything.
    4. It's designed to be as simple as any other thing in Unity.

    What kind of a game you are making?
     
  17. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Yes. But better ;)
     
  18. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Yes, the collision with meshes still needs some optimization. But it works well on my 4yo notebook. What's your configuration?

    Yes, even air pressure in the tires is simulated.

    Thanks
     
  19. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Lol love the confidence! :D although beamng does simulate more pieces. Like the car door could swing open and get dented as well as the hood. Would that be possible with this?
    Edit: nevermind just watched the second video. That's exactly what I needed :)
     
  20. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Thanks ;)
     
  21. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Sure. I'm just not as good in 3D modeling as BeamNG guys. But BeamNG is still great :)
     
  22. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Do you have a release date planned?
     
  23. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    For the moment I plan to release the beta version to collect more feedback and let people check if they can/want to use it. But I can't name the exact date as I'm still not sure which features I need for this beta version.
     
  24. MaxieGast

    MaxieGast

    Joined:
    Jan 18, 2013
    Posts:
    2
    I'm Making a BeamNG Type of Game/Skate 3

    Its with cars where you just need to stunts to get points.
    But if you crash the car should deform.

    So thats what i need this for.

    I wanna make that if you crash youy get points to.
    But without this i can't make it.

    So i hope its coming out soon.
    Its Awesome!

    -Max
     
  25. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi all.

    Being inspired by the articulated-body simulation from the neighboring thread I decided that I also need this feature in my engine :)
    Though it's not really related to the soft/deformable-body simulation, it's still cool and can be used for many great things.

    Here's the first simplest test:


    Cheers ;)
     
    thieum likes this.
  26. Dmitry45

    Dmitry45

    Joined:
    Dec 12, 2013
    Posts:
    8
    Hello friend, good luck to you, do not leave their job, I will follow the news!
     
  27. Mehrdad995

    Mehrdad995

    Joined:
    Jul 17, 2013
    Posts:
    46
    Hi
    Do you have any plan on releasing truss physics(even a beta version) at the end of 2014?:rolleyes:o_O
     
  28. thieum

    thieum

    Joined:
    Apr 8, 2011
    Posts:
    61
    HI, you're system looks pretty good. I'm also doing realtime deformations in my project but it is not as good as yours.
    Definitely interested into this, if it's not dll based and if it can support many collisions at the same time (check my wip forum thread to get what I mean ;° )
     
  29. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi. Yes, I plan to release a beta version. Hopefully in this year. The beta will be for Win32 platform only.

    Just in case, the support of mobile platforms is not planned atm, as my tests show that they still aren't powerful enough for such kind of simulation.
     
  30. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi. Sorry, but it IS "dll based".
     
  31. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    How's everything going with this? This is definitely a useful asset. :D
     
  32. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi blueivy. Thanks for your interest. It's still in development. Hope to release a beta version till the end of the year.
     
    blueivy likes this.
  33. the7347

    the7347

    Joined:
    Dec 29, 2012
    Posts:
    33
    Hi, this is a great job but I could not prove it, the car remains static, he is suspended in the air.

    I tried it on w7 64x and wVista 32x

    11.png
     
  34. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi. I already saw one report about this problem, but never was able to reproduce it. Could you please PM me 'output_log.txt' file from 'Truss_Data' folder? Thanks.
     
  35. the7347

    the7347

    Joined:
    Dec 29, 2012
    Posts:
    33
    Already send, solve please.
     
  36. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Question - How heavy in terms of CPU or GPU usage is this asset?

    Can it be applied to a bunch of cars (100+) in the same scene? Would there be any performance loss?

    Just curious,

    HeadClot
     
  37. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    The simulation is currently done on CPU with multithreading enabled. User can specify the maximum number of worker thread available. How heavy it is depends on usage, on the simulated objects complexity and the hardware performance. The original goal of the library is not the car simulation but rather for passive deformable objects like metal barrels, fences, gates, lampposts etc. The car simulation is definitely quite expensive as fast rotating objects (like wheels) require very small simulation time step. But in any case it's oriented on modern powerful platforms, so if you're thinking of simulating 100+ car on the first iPod, it probably won't fit :)
     
    HeadClot88 likes this.
  38. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Thank you for the in depth reply.

    I guess I would need to evaluate it to see if it fits my needs. :)
     
  39. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Do you plan to switch over to the gpu?
     
  40. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Also I would love to see some demos with non-car deformable objects, that would be cool!
     
  41. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    The problem with the simulation on GPU is that's quite expensive to get the simulation result back to CPU to use it say in the gameplay code. So the plan is to have "decorative" objects on GPU and "gameplay" objects on CPU. But that's longterm plans.

    I'd love to see it too. Do you have any ideas what could it be? :)
     
  42. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Hmm I have some ideas, maybe use the car in the video to crash into metal poles and fences and other objects. It will also show two way interaction. Also two cars crashing into each other.
     
  43. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Well, I was rather thinking about a demo with no cars at all :)
    But for sure I can add some stuff to the RedCar demo as well. Btw that two stacked boxed in RedCad demo are deformable. They maybe just a little boring. Need to find more interesting models :)
     
  44. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    How's everything going? :D
     
  45. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi blueivy.
    I didn't do anything yet as I'm quite far from my PC at the moment.
    I'll be back at the end of the next week and will try to make something.
    Cheers :)
     
    blueivy likes this.
  46. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    632
    Also just saw this vid of a ragdoll in a beamng car


    This increases the realism a lot! Do you think that something like this could be apart of the asset as well?
     
  47. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    As the approach is quite similar, I believe anything from BeamNG can be made with Truss Physics.
     
  48. noelboehnke

    noelboehnke

    Joined:
    Nov 19, 2014
    Posts:
    8
    Do you think a Unity project will arrive as demo for free? If yes, when?
     
  49. noelboehnke

    noelboehnke

    Joined:
    Nov 19, 2014
    Posts:
    8
  50. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi utk7001. Sure, a sample project will be included into the package. When it's done. I want to be sure that it works not only 'in my hands' :) Cheers