Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

[RELEASED] - Impact CFX - Collision Effects System

Discussion in 'Assets and Asset Store' started by Cramonky, Mar 23, 2023.

  1. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    I am very pleased to announce the release of Impact CFX - Collision Effects System!

    Impact CFX is the successor to my asset, Impact - Physics Interaction System. It is a powerful and flexible material-based collision effects system for producing effects such as audio, particles, and decals from physics collisions and raycasts.

    Asset Store | Documentation | Tutorials Playlist | Discord

    Demo
    At the moment I do not have a web or other demo available, but I do have a walkthrough of the demo included in Impact CFX that demonstrates what it can do:


    Getting Started
    Check out the Getting Started tutorial for how to get up and running.


    Collision Effects

    • Play audio when physics objects collide with each other, with sounds based on the collision velocity and the objects' materials.
    • Play sliding and rolling sounds.
    • Emit particles on collision.
    • Leave decals behind on collision.
    • Support for terrains.
    • Works great with rigidbodies connected by joints and ragdolls.

    Footsteps
    • Utilize Impact CFX to play different footstep sounds based on the material a character is walking over.

    Weapon Impacts
    • Use Impact CFX to play sounds, emit particles, and place decals for bullet impacts.

    Note that knowledge of C# scripting is required to implement footstep and weapon impact effects done via raycasting.

    Performant & Configurable
    • Impact CFX utilizes Unity's Jobs system and Burst compiler to efficiently process effects with minimal performance impact, even with hundreds of colliding objects.
    • Extensive configurability means that you can optimize Impact CFX for your specific needs.

    Integrations
    FMOD Integration | Wwise Integration | Master Audio Integration

    Dependencies
    Impact CFX requires the following packages from the Package Manager:
    Burst
    Collections
    Mathematics

    Please let me know any questions, concerns, or any other feedback that you have!
     
    Last edited: May 30, 2023
  2. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Impact CFX does support emitting particles and placing decals for sliding and rolling! If you look at the Particle Effect and Decal Effect documentation, you can see there are options to enable the effect for sliding and rolling.

    I made a quick example for the particles: https://imgur.com/a/cKPonPK

    The decals are not dependent on any particular decal system. Really all the decal effect is doing is simply placing a game object; it does not have any concern for what other components are attached to the object.
     
  3. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Impact CFX Version 1.1.0 has been released! Check out the Change Log.

    2 key features in this update:

    1) Impact Particle Systems and Impact Decals now have the ability to change certain properties based on the collision velocity. For example on Impact Particle Systems you can change the particles' starting size, speed, and lifetime:


    2) A new Enable Impact CFX Logging option has been added in the Project Settings that enables debug logging to help pinpoint issues that are causing effects to not play correctly.

    Also, while technically separate from the core 1.1.0 update, I have made some extensions for enhanced support for URP and HDRP Decals. You can read the docs and download the extension packages here.


    As always, please let me know of any questions, concerns, or any other feedback!
     
  4. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Does it support Master Audio?
     
  5. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Currently I do not have an official integration package for Master Audio. I have been waiting to gauge demand before I invest in making one for Impact CFX (so consider your post the first +1 :))
     
    churi24 likes this.
  6. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Impact CFX Version 1.2.0 has been released! Check out the Change Log.

    The most notable change in this update is an overhaul of the Impact Effect Processors to consolidate much of the code into shared base classes. This greatly simplifies writing custom effect processors (though custom effects generally still require a good amount of work).

    The Custom Effects documentation has also received a major overhaul, with code examples and an example effect package available for download.
     
  7. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    churi24 likes this.
  8. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Hello! Would this be compatible with Unity 2020.3.26? Or is it just for Unity 2021.3+?
     
  9. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Impact CFX does mostly work with Unity 2020.3, however there are couple of editor scripts that use APIs from 2021.3+. These are not necessarily difficult to modify to work in 2020.3, and the core Impact CFX system does work otherwise, but I am not officially supporting any Unity versions before 2021.3.
     
  10. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    I see, would it be easy to check which scripts need changes? I'm not versed in C# but if it's just editor scripts the asset itself would work without issues?
     
  11. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    There are only a few problematic scripts, and the specific lines that are producing errors technically could just be commented out or deleted (of course this would disable the associated functionality, but the affected areas are not critical and there are workarounds).

    If you really would like to use Impact CFX in Unity 2020.3, you can send me an email at support@roadturtlegames.com and I can provide the modified files. However when installing updates it would be up to you to keep these modified files, and since I am not supporting anything less than 2021.3 in an official capacity I cannot guarantee that future updates will always use features or APIs that are compatible with 2020.3.
     
    EpicMcDude likes this.
  12. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Thank you for your availability, we decided to bite the bullet and upgrade our project to Unity 2022.3!
    After a couple of errors, Unity crashes and "Re-Import All" throughout the whole day, everything is now working as intended. Thought it was going to be an actual nightmare but it was all right.
    All this to say I ended buying your asset as well, can't wait to try it properly. It's bit weird not having a demo scene for built-in but it was just a matter of setting standard shaders on all materials no biggie.
     
  13. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    The main reason I didn't include a demo using the Built-In renderer is because it doesn't come with any real decal solution out of the box, the the closest thing being projectors. URP and HDRP were also a bit simpler to convert between since they share some common standards and workflows.

    I will admit that I have underestimated how many devs still use Built-In over URP or HDRP.
     
    EpicMcDude likes this.
  14. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Hey Cramonky,

    I'm trying to do a build of the game but I have these errors:
    upload_2023-8-21_22-22-40.png
    Would you know how to fix this as this is the only thing stopping me from doing a build? I have Jobs installed (and FMOD extension thank you btw)

    etc.

    Thank you
     
  15. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Do you have logging enabled in the Impact CFX settings? It looks like its throwing errors on lines related to debug logging, which is not Burst-compatible.
     
    EpicMcDude likes this.
  16. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Thank you, that was it, not familiar with Burst and all that!
     
  17. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Hey @Cramonky,
    Just bought impact cfx : would you have an fmod example project (with events and parameters) working with your plugin ? Would save me a lot time
    Thanks !
     
    Arche likes this.
  18. Arche

    Arche

    Joined:
    Jan 12, 2014
    Posts:
    2
    Came here asking the same question :)
     
    corjn likes this.
  19. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    I can provide a sample project, but it would have some caveats:
    1. I obviously can't freely distribute Impact CFX within this package, so you would have to open the project in Safe Mode to import it yourself to resolve errors.
    2. I can't redistribute the FMOD for Unity package either, so you would have to import that yourself as well and potentially have to make sure things are configured correctly.
    If you would still like to have a simple sample project with this extra setup work, I can put one up for download in the documentation.
     
    corjn likes this.
  20. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Sure, no problem with the caveats ! I would just like to see how the events and parameters are configured in FMOD studio. Everything else else on how it works in Unity is well explained in your doc :)

    Edit : or maybe it's really really easy : should I just add the parameters like "ImpactCFX_Intensity" on my sounds, and Impact will do the rest ?

    Edit 2 : making something like this just with the "ImpactCFX_Intensity" works well for me :



    But I think it might be nice to have a prefab parameter for fmod studio users, just to have the exact same thing as in Unity built in audio
     
    Last edited: Sep 7, 2023
  21. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Yes, all you need is to have a parameter named to match any of the parameters listed in the docs and it will work. I actually decided, instead of having the example project with its redistribution concerns, to update the FMOD integration docs with some examples at the bottom of the page: https://roadturtlegames.com/impact-cfx/documentation/fmod

    Also, what do you mean by "prefab parameter"?
     
    corjn, EpicMcDude and Arche like this.
  22. Arche

    Arche

    Joined:
    Jan 12, 2014
    Posts:
    2
    Thank you a bunch!
     
  23. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Thanks, that's really helpful ! I meant a parameter we could copy and past, but updating the doc like you did is also totally fine.
     
  24. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    87
    Currently stuck on 2019.4.9f1, would this still work?
     
  25. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Unfortunately from my testing I was not able to get Impact to compile in 2019.4.9f1 due to the
    NativeReference<>
    type not being in the Collections package available from the package manager (0.9.0-preview.6).
     
    nubdev likes this.
  26. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Hey Cramonky, I'm using FMOD and I'm testing the integration in the scene demo with the Ragdoll game object. Everything works fine except when each ragdoll limb collides with a surface at the same time, every sound plays over each other creating that 'phasing' effect (example when the metal sheets collide with one another at 3:08, the same sound plays at the same time:
    ). Is there a way to prevent that?
    I can only think of the Queue Capacity that is set to 32 but that is a global setting and I'd rather not limit the concurrent sounds globally.
     
  27. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Really the only thing you can do to mitigate the effects of overlapping identical sounds is to have multiple audio clips that are randomly selected + some pitch and volume randomness.

    I've considered making trigger components that allow you to control a group of triggers, so you could limit the sounds played for the whole ragdoll, but the idea has several problems that would make for a very ugly implementation and it wouldn't even necessarily solve the issue anyways.
     
    EpicMcDude likes this.
  28. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Ah gotcha, I'll mess around with those parameters.
    I'm curious about one other thing - what's the reason for some of the ragdoll limbs having the Impact Object Rigidbody component but no Trigger components? Essentially holding the collision information but no components to play the sound?
     
  29. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Ah yeah, that's another little trick to limit the number of sounds playing at once. Basically it's just assuming that having triggers only on some parts of the ragdoll (namely the extremities of the limbs and the head) will be "good enough" to produce sufficient collision effects in most cases.
     
    EpicMcDude likes this.
  30. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    118
    Should the limbs without the Impact Trigger components still have the Impact Object RIgidbody, considering it introduces some performance overhead?
     
  31. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    The Impact Object components are there so that other objects colliding with the ragdoll know what they are colliding with, but depending on your case you might be able to remove those as well and just use material mapping.

    It's all about finding out what little cheats and tricks you can get away with without your players noticing :)
     
    EpicMcDude likes this.
  32. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Just released Impact CFX 1.3.0! Check out the change logs here: https://roadturtlegames.com/impact-cfx/documentation/change-logs#1-3-0

    This is a pretty significant update that greatly improves your ability to control Impact Material "registration" (i.e. when Impact Material assets get converted into data that is used to actually play the effects).

    I imagine that this update won't make a huge difference for many users, but if you are interested in the changes you can check out the new Managing Registered Materials section of the documentation: https://roadturtlegames.com/impact-cfx/documentation/impact-cfx-manager#managing-materials

    If you are using the FMOD, WWise, or Master Audio integration packages, you will need to update those as well.
     
    Lars-Steenhoff likes this.