- Home /
Sound wave emission?
In my current game I would like to create something similar to a sound wave. The idea is simple, a wave is created around a point and slowly increases in time, until, after a set time, it ceases to exist. However it gets more complex when you consider the sound wave ricocheting of other objects in the world, warping the shape from a general circle to a complex shape. This would be much like a ripple, only existing within the world. Furthermore this will likely be a 2D game, thus far all examples I have seen in this process have been done using height maps to distort textures in 3D.
Much of the basic behavior is similar to that if a particle emitter, only I am looking for a wave instead of simply particles. My question is how this might be done? I am still pretty new to unity, so I am unsure of the best way to tackle this task, and all my research seems to come up showing the use of height-maps to distort a texture. I don't believe this will work as the wave needs to be its own colour in my game, distinct from its environment. Additionally I am not sure how this method would work detecting environmental collisions in a 2D environment.
Any help or suggestions would be greatly appreciated.
What are you planning to accomplish with this? Emulating wave physics is very complex and computationally expensive. Unless it is a key part of your application I would suggest you make due without it.
These sort of emulations are also very time dependant, so you won't be able to have a very fast speed of sound.
I suggest you look into implementations of water ripples, since it's essentially the same concept.
well it is a core concept in the game. The idea is that you see using echolocation (a la daredevil) So the idea was to project the wave out into the world and see the way it responds do get a concept of the environment.
Theoretically a similar effect could be achieved with emitting a lot of particles in a circular motion...but I was curious as to the wave, as in my opinion it would look much crisper.
Speed was not a main factor, but I would say the concept is the key feature of the game. As for the ripples, that is mostly what I have looked into and most of what I have found uses height-maps.
So what I am hearing is I need to decide if I am willing to add a complex and expensive computation for the sake of crispness.
Simply think of the "height-map" as the amplitude of the wave (which is what it actually is). A problem you might encounter is that you'll need too many physics steps for echolocation if you want it to happen quickly (you might have to wait 2 seconds + for a single response).
I believe you might want to look into faking echolocation ins$$anonymous$$d of perfor$$anonymous$$g huge physics calculations, but thats up to you.