Varying Player Footstep Sounds

I haven’t tried this myself yet, but I wanted to make it known that it is now possible to implement a primitive way to vary the player footstep sounds in FPSC-R using a combination of Omega Core expanded keyboard input and the 3D sound system. If anyone wants to give this a try before me, here is what you would need to do.

First step is to replace the default grass walk sound with a file of the same name that just contains about 1 second of silence. I’m not sure exactly which file this is so you’ll have to find that out for yourself at least for now.

Second, load up the footsteps sounds that you want to use for you game using the ocAULoadSound function. You should do this preferably in a global player.lua script that you attach to some object in the game world and turn Always On to true. So, you might, for instance, load up a grass walk and a stone walk sound. You’ll also want to use the new ocAUSetSound2D function so that you don’t have to update the sound position to player position every time he moves. Although, you might want to do it that for your own reasons.

Third, in your player.lua script you’ll want to check for movement keys like wasd and arrows. While in motion you can then tell Omega Core to play the appropriate walking sound in a loop and to stop playing when no longer moving. 

So, how do you determine then which sounds to play? That’s why this is a fairly primitive implementation. Unless you do some complex location checks or lay down some really complex zones, you should only use this for entire areas. Perhaps you always play the grass walk sound outdoors, but when your player crosses a trigger zone into a stone building then you switch to always playing the stone walk sound.

While this is somewhat primitive and doesn’t handle complex cases, it should work very effectively in the simple cases. When I get some time I’m going to implement something like this in Rescue the Princess. Good luck to anyone who gives this a try. And don’t hesitate to ask me questions if you’re trying to do this and get stuck.

Advertisements

I am a born again Christian and a servant of our Lord Jesus Christ. I'm happily married to my wife, Michelle, and I have 2 beautiful daughters named Sarah and Grace. I am a programmer, filmmaker, and video game maker.

Posted in News
3 comments on “Varying Player Footstep Sounds
  1. magiqueprod says:

    One more note. You might be able to do a little more complex footfall variation by putting trigger zones in the shape of certain geometry. For example, you might stretch and shape a trigger zone to conform to a wooden bridge that crosses over a stream. And while player is in that zone you could play a wooden footstep sound.

  2. magiqueprod says:

    I’m going to be putting together a series of stand-alone tech demos for Omega Core that demonstrate the power and flexibility of its capabilities. I might just have a nice little demo very soon that shows off this varying footfall concept using a little more than just trivial scenarios.

  3. magiqueprod says:

    I did play around with this idea a little bit and it turned out to be a bit more complicated than I envisioned. As I proved that it’s definitely possible, I also failed to accomplish my goal in one sitting and so decided to shelve it for a bit while I focus on more important matters. I saved the demo and will try again at a later date.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: