Announcement

Collapse
No announcement yet.

MNSI - Adding Sound To Physics - Pending Release

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [SUBMITTED] MNSI - Adding Sound To Physics - Pending Release


    11th Month Update

    Official documentation wiki is now live.

    https://mischievous.eu/index.php/MNSI

    10th Month Progress Update - A Basic Game made using MNSI



    The Basic Sound Library- Every type of object demonstrated




    Description;

    This plugin adds a full suite of sound integration to physics in Unreal 4.

    Designed from the ground up to be as easy going on the CPU as possible ((6ms increase on cpu thread with 200 objects all interacting)), and easily usable for small and more importantly, large game projects.

    Set goals for this plugin.
    • Use OnTick as rarely and scarcely as possible
    • Design this as an Actor Component
    • Offer an easy fire and forget user experience
    • Optimize for large scale physics simulations
    • Optimize for large scale game development ((Though I imagine those have their own versions but just in case.))
    Currently I have successfully designed this as an component. The tired developer can just simply make a prop, and attach this component without having to do any custom Blueprint or code scripting. You just drag this on your physics simulatin' Hit event generatin' actor and it does the rest for you.

    This means that if you have 100 props, they can all use this one component. And all you have to do is just drag and drop it over them.

    And if I sound a bit arrogant, then that's because I'm tired. I call this "Mischievous's non stupid implementation" And I mean it. If you do any sort of search you'll be taken to suggestions telling you to do this for every prop's own blueprint, and will almost always tell you to stuff it all in the OnTick event and calculate your own velocity and it's, it's......It's just terrible. Especially when they start talking about ray tracing from every prop.

    And that's just for impact sounds. Try to do a search for adding "Friction Sounds." And google will just shut down.

    Obviously there are good suggestions too but this Is a marketing pitch after all and I love money :P

    Physics and money. My passions in life.

    So How does assigning sounds to physics works in current build?

    The way you tell this what sound to play happens though Structures and naming conventions.

    Let's say you have 2 Physical Material classes

    Default_Stone
    Default_Wood

    That's how your Physical Materials are called

    To tell the plugin what sound to play when Default_Stone collides with Default_Wood, you would go to the library structure
    and simply add a new key;

    Default_Stone-Default_Wood and point it to a Sound Cue Resource

    This means that you have to manually assign sound cues to your expected interactions

    Default_Stone-Default_Stone > Sound Cue for stone hitting stone
    Default_Stone-Default_Wood > Sound Cue for stone hitting wood
    Default_Wood-Default_Wood > Sound Cue for wood hitting wood

    Question: Wouldn't that mean that the amount of definitions grows exponentially with my materials?

    Yes. For that there are built in special tokens to help you around that.

    DEFINT - This is the default sound cue to play for a given impact event.

    Default_Stone-DEFINT

    Now if your prop that has the physical material Default_Stone collides with something that isn't defined, let's say MaterialX

    The plugin will try to look for an interaction key like

    Default_Stone-MaterialX

    And if it fails to find one, it will go look for

    Default_Stone-DEFINT

    That's the basics on how the 4 impact event sounds are handled.

    You have sounds for Light and Heavy collisions, as well as sounds for Roll and Linear friction.

    Hack Tokens exist for them too.

    You do not have to define all 2 sets of each class.

    You can have

    HardImpact Default_Stone-DEFINT
    LightImpact Default_Stone-DEFINT

    Or.

    You can only define

    LightImpact Default_Stone-DEFINT

    Now if the plugin wants to play a hard impact event but fails to find one in your library, it will fall back to Light impact event sounds.

    Same goes for friction. If it can't find a rolling friction sound, it will go look for a linear friction sound.

    This means that you can define everything. Or a bare bones 2 sound keys per physical material.

    There is also pseudo instancing.

    Default_Stone
    Default_Stone-Slippery
    Default_Stone-SomeRandomNameAfterTheDash

    Are all considered as the same sound key material, Default_Stone


    So where's this work at?
    • Impact Sound - Handles light and heavy hit events.
    • Friction against surface sound - Can know when the prop is experiencing friction to play appropriate looping sounds.
    • Pitch and volume based on speed
    • Can discern Rolling versus Linear friction and play different sounds in each case
    • Can now measure a prop's velocity relative to its closed system. A prop placed on a moving platform will no longer play its friction sounds, despite its world space velocity increasing.
    • Reduce the computations done on OnTick event. The plugin no longer uses the OnTick event.
    • Added proper physical material based logic.
    • Added logic for surface being hit. Essentially layer two impact sounds together. One intrinsic to the impactor material and one intrinsic to the surface being impacted.
    • Added an easy way for users to set up their own sounds without editing the plugin too much .
    • Added an easy way for users to set up their own physical materials without editing the plugin too much.
    • First recording set in, Shotgunshell, Magnum Bullet and coin on stone and wooden surfaces.
    • Sound library structure variable class.
    • 260 sounds added to The Basic Sound Library set that it will release with [NEW]
    • Easy to use system of adding sounds to a sound library and loading it in the plugin[NEW]
    • Completely re-designed the rolling sound and friction sound logic to make it extremely cheap[NEW]
    • Objects rolling in place act as if they are experiencing friction not rolling[NEW]
    • Player Distance Optimization, math doesn't happen if player isn't close enough[NEW]
    • Buggy Impulse Workaround, two objects placed on each other don't move but might constantly experience large impulse forces and play sounds wrongly. Added workaround fix to this[NEW]
    What remains to be done?
    • Beta test it.
    • Write all the documentation for it.
    • Release it.

    Marketplace Offering;

    It will come with the basic sound library.
    • Complete offering with physical materials setup and a sound library all ready for use.
    That's all for now. I'll continue to update this thread as I work though the following weeks on this.
    I started this threat to, obviously advertise this, but also, if you guys have any suggestions I'm always open to increasing the price based on features offered.

    Old stuff.














    Measuring a prop's velocity relative to its closed system


    Playing impact sounds


    Rolling versus Linear friction distinction.
    Last edited by MischievousM; 06-08-2019, 11:46 AM.

    #2
    More updates on the plugin;




    It can now differentiate angular versus linear motion of bodies.

    Useful if you imagine a car tyre's sounds when it's rolling along normally and the sudden screeching if its angular velocity drops but it keeps moving forward for a bit trying to come to a halt.

    Since I want to post updated every weekend, this also means I don't get to not have bugs :P So you also get to see it bugging out when the physics prop is moved via some other means. It still thinks it's rollin. Nothing that can't be solved though. Next week I'll turn the friction function into a more relativistic version and all my problems will be gone.
    Last edited by MischievousM; 07-01-2018, 12:58 PM.

    Comment


      #3
      New developments. After nearly entirely breaking the plugin I finally got relativity to work.

      Now a physics prop placed on a moving platform will not play its friction sounds when the platform moves. Sounds dumb stupidly simple. It wasn't.

      Newest video.



      Comment


        #4
        Imagine my face when after two weeks I finally managed to remove all dependency on the On Event Tick node.

        Nothing happens on Event Tick anymore And it never will.

        Click image for larger version

Name:	SadNode.JPG
Views:	1
Size:	51.2 KB
ID:	1503509

        Look at that sad node all alone. Heh heh... Heh.

        This means that now when simulating 1000 physics objects all interacting with this plugin attached for each one, the frame rate went from 20 to about 80.

        I'll post performance comparisons later. I just wanted to share my joy.
        Last edited by MischievousM; 07-18-2018, 04:22 PM.

        Comment


          #5
          2 months after I started this project, I've nearly solved 90 percent of all the problems it posed.
          Here's two progress update videos.




          Comment


            #6
            Wow, awesome project!
            I'm doing physics stuff and I would very much want to see this plugin on the marketplace.

            The sounds are a little bit noisy, is that because of the sound sample, or because of how it's played back?

            In the last video, when the rocks fall, there's a high pitch noise. Could you remove/diminish that somehow? I think it's cause by the volume of the friction sound of the rocks with the ground.

            Looking forward to more updates!

            PS: I like your two passions in life.

            Comment


              #7
              Yay, a single person shows interest 3 months after I started work on this! Yeah I noticed the sound issue too, once I make the custom sound class with its own logic and record some high quality sounds myself, I am confident it'll go away. I'll be posting more updates soon.

              Comment


                #8
                Not sure why people aren't more interested. It would be great to have this.
                I'm thinking it would be great for adding tire screeching sound.

                Comment


                  #9
                  Tire screeching is actually already possible Tire screeching versus normal rolling tyres are already implemented, I'll soon make a larger presentation video.

                  Comment


                    #10
                    Originally posted by MischievousM View Post
                    Yay, a single person shows interest 3 months after I started work on this! Yeah I noticed the sound issue too, once I make the custom sound class with its own logic and record some high quality sounds myself, I am confident it'll go away. I'll be posting more updates soon.
                    Don’t be discouraged! I’ve been quietly following this for awhile, I’m sure others are too!

                    Comment


                      #11
                      Keep on doing this wonderfull tool! You have a future client here

                      Comment


                        #12
                        This looks awesome!

                        Comment


                          #13
                          I'm really happy to hear responses! I am working hard to reach the next milestone.

                          Comment


                            #14
                            Any updates on this?

                            Comment


                              #15
                              Indeed there is. I prioritized working on this over making posts about it, but I need to change that strategy.
                              Added 2 new videos of the current build of this plugin.

                              No release date estimation yet though. I don't want to make a promise I acn't keep.

                              What I Can promise though is that I Will release it :P

                              Comment

                              Working...
                              X