Footsteps (Running faster and faster)
Zilla
Member Posts: 157
I want to simulate the sound of a running player that moves faster and faster.
I want to control the sound of a footstep with a timer that has a variable speed (depending on the elapsed time of the game).
I tried to implement the concept of "How do I have the Timer behavior use variable speeds?" from the Wiki:
http://gamesalad.com/wiki/how_tos:gsc_variable_timer_speed
But it doesn't seem to work the way I made it... Does anybody know of an existing, similar example that I coud download or study?
I want to control the sound of a footstep with a timer that has a variable speed (depending on the elapsed time of the game).
I tried to implement the concept of "How do I have the Timer behavior use variable speeds?" from the Wiki:
http://gamesalad.com/wiki/how_tos:gsc_variable_timer_speed
But it doesn't seem to work the way I made it... Does anybody know of an existing, similar example that I coud download or study?
Comments
What I would do as a simple work around is create a few different rules.
when speed is < 10
timer every 1 sec play footstep
when speed is > 10 and < 50
timer ever .5 sec play footstep
when speed is >50
timer every .25 play footstep
It's a little more work, and not truly variable, but it should work fine.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Thank you very much
I was using your approach in my last game "Walk The Line":
http://gamesalad.com/game/play/35111
There the player runs - and the obstacles appear faster and faster... but only as you suggested within three different ranges...
I wanted to have the effect a little smoother....
This is exactly what I was looking for ))
Thank you very much ))
Since low around zero and including zero would include a footstep and in the upper range the footstep may come too quickly (for performance too), you would want to handle a speed of zero (or even a small lower range that includes zero) and a speed of 200 (or even a small upper range that includes 200) separately.
Adjust the "/100" piece to vary it up a bit. You could even play with "log10()" and "ln()" to make the adjustment less linear. You could also use "min()" or "max()" to play with the lower and upper ranges a bit. You could also play with the equation itself using something that maybe fits your needs better. Open up a spreadsheet program and make a table of the values and any equations or sub-equations to see what you can come up with.
Also, you could make the footstep sound either a one-step or a two-step sound to fit your equation better.
good suggestions here for how to spice it up!
Thanks, again! I am putting out a jumping game soon and all of the moving actors use this to make the game get harder and harder so it was really key!
Your example works like a charm
@rebump
Thank you very much for your ideas: I love math Especially in a game engine like GS where you spend most of your "coding" by clicking through behaviours...
Oh well. Maybe it is similar to what you presented maybe not. Either way...the more info out there, the better.
@Zilla: I like math too. Too bad it has been decades since I took any math courses in college. If I get into this more and more, I may go take a class or two to refresh. :-)