New Water SFX That I Might Remove


With today's update, I not only added some new water sfx, but I also made it so the landing sfx is more proper in the sense that it lines up with what your brain would expect when the boat hits the water's surface.

So for the water sfx. I am unsure if this really adds anything to the design of the game other than just being annoying. I still want to do a tech writeup as they're always fun to do but I would appreciate any feedback with how annoying or how much it adds to the game in your opinion if you get a chance to play the game :)

So the way that the water sfx gets played is it must test around teh boat in a radius if any water is incoming that would actually attempt to hit the boat. So in other words, the velocity of the wave of the water is pointing at the boat. From what I remember with the dot product, you can do the test of if the two are in the same direction which is exactly what you'd want to do since the boat would be in the way of the incoming wave. This is where I wish I could draw some picture with ease but i'll just explain it like the wave's velocity is moving north and you're in the northern part of the grid, the wave audio will play. Whereas if you were south of the northbound wave, the audio won't play (or shouldn't, anyways).

Now the tech part's a bit more interesting in my case as I don't actually touch any grid rendered geometry to determine if the wave is coming your way. The way I do it is by taking the boat's current position and just tracing a radius by stepping some percentage of 2PI (so one trip around the unit circle) and following the new vector for each percent of the 2PI for N times where you're stepping along that vector to see what new grid cell you might be in. Once you find the grid cell that stores velocity, density (and technically renderable geometry), you just check the velocity's direction relative to the boat's direction. 
It's also very important to note that the boat's position and the velocity of the grid MUST BE IN THE SAME SPACE! In my case, i'm just testing them in world space as it's easier for me to do so since I don't have to do more math to move the boat into the grid's space or the grid into the boat's via an inverse transform.

I hope what I wrote was clear enough! If you need some clarifications, let me know and I will do so! Thank you for reading and have an awesome day :]

Files

Funmi_Zip.7z 2 MB
Oct 23, 2021

Get Funmi

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.