Jump to content

Walk sounds


Kibbols123
 Share

Recommended Posts

I have been thinking about that myself and while I haven't tried anything yet I had the following idea.

 

Every time you are ready to play a walk sound, you make a pick from the player controller to the ground, set for scene collision and use GetMaterial to get its material. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygetmaterial-r127

 

Each material will need to be associated with the according walk sound in a table or something though and a default for stuff that isn't associated.

 

It should be fast enough, as you only play walk sounds every couple of seconds anyway. The one problem I could imagine is that getting the material of collapsed scenery won't work but I'm not sure about that.

Link to comment
Share on other sites

I did a bit of experimenting and reading and came across what the collapsed scenery problem is. I got the raycasting to the ground working and also tried with a collision check but it seems if you are constructing buildings and floors with csg brushes which would be pretty typical then you can't check if they are collided with like you would with an entity/prop. Or at least you can't seem to use getmaterial on them etc. because they aren't entities.

 

It looks like if you give all floors a mass and collision type prop this will make them possible to check material but I haven't tried that fully and I'm not sure if that would be a good idea. I assume performance might be better with scene vs prop/mass? I don't know.

 

Another option might be to use invisible trigger boxes over the floors or at entry/exit points to different floor types, and when you enter one change to appropriate footstep sound. It might be a bit messy having lots of extra boxes/triggers to do that though and might make scene management more complex. Maybe it would work well for an indoor level but then there is terrain and possible different textures snow,grass,mud,dirt etc. and layering trigger boxes over that wouldn't be ideal, every time you paint the terrain you would need to check and adjust the trigger boxes.

 

What might be good is if the material dialog had an option to assign sound files like footstep sounds and maybe hit sounds for when a weapon hits it. This would make this situation a ton easier.

Check out my games: One More Day / Halloween Pumpkin Run

Link to comment
Share on other sites

What might be good is if the material dialog had an option to assign sound files like footstep sounds and maybe hit sounds for when a weapon hits it. This would make this situation a ton easier.

thats essentially what the original CoD did - attach effects like sound or vfx to materials.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

thats essentially what the original CoD did - attach effects like sound or vfx to materials.

 

I don't like that approach as this is limited to only one type of entity.

 

If you for example have a walking player character that can also drive in a car you would need to attach a sound for both the character and car.

 

Better would be to check for the material per raycast and then play a sound. Bit more code but also more flexibility.

Link to comment
Share on other sites

This sounds like it could be a fairly simple "library" to make. I'll need this for our game so perhaps I'll look into this and release something. It's pretty much mostly setup. Configure a table that says this entity type on this material makes this sound. Then it would just have some Update() function that you call that does the raycast.

 

[EDIT]

I think I'm going to put this on my sprint because it's interesting and I want to work on it :)

  • Upvote 3
Link to comment
Share on other sites

Looking at materials alone might not work for terrain. Seems terrain just has the textures not the material and not sure if we can get what texture is showing through at a given location to decide on the sound. Using an atlas shader, which we do, also wouldn't work as you wouldn't know which subtexture you are on. Trigger zones might be a better option but more work.

 

Footsteps aren't generally gameplay breaking.

Link to comment
Share on other sites

They're not game breaking but it makes such a difference if you have the appropriate sounds playing. Walking through the quiet landscape with echoing corridor footsteps clopping along doesn't help with the immersion. I'll probably go with a more generic softer sound that works both indoor and outdoor for now but it would be nice if there was an easy way to do this properly. It's another small step (ha there's an unintended pun) towards AAA game play, or at least AA.

Check out my games: One More Day / Halloween Pumpkin Run

Link to comment
Share on other sites

For me, sounds are very important for the immersion of it. Especially with the Oculus. Sounds are almost everything with the Oculus. If your footsteps are concrete footsteps when you're on metal and then you step onto dirt and it's STILL concrete sounds, it ruins the effect for the Oculus.

Link to comment
Share on other sites

Sound is very important!

 

I added some vertical sound triggers and it works ok, for now.

 

When the player collides into it it changes a flooring variable to a type: stone, grass, etc.

 

Then used some if statements inside my character controller to check that variable and then play the appropriate material footstep sound, all using the same code (for n=1,4 do) for footstep looping.

 

So not really attached to the ground but the player won't know.

 

~Ash

  • Upvote 2
Link to comment
Share on other sites

  • 7 years later...

Any further developments on this as I just bought LW and was using CopperCube until now which I was able to create a Behaviour to check each vertex in the local terrain area and get the name of the texture used and play the appropriate walk sounds. It even picked up animated textures like grass and plants and so had bush interaction sound effects for that also...worked quite well but lots of data to check...

Link to comment
Share on other sites

In the upcoming Ultra Engine, which is compatible with Leadwerks file formats, there are commands to get the terrain materials and weights at each point:
https://www.ultraengine.com/learn/Terrain_GetMaterials?lang=cpp
https://www.ultraengine.com/learn/Terrain_GetMaterialWeight?lang=cpp

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

2 minutes ago, Josh said:

In the upcoming Ultra Engine, which is compatible with Leadwerks file formats, there are commands to get the terrain materials and weights at each point:
https://www.ultraengine.com/learn/Terrain_GetMaterials?lang=cpp
https://www.ultraengine.com/learn/Terrain_GetMaterialWeight?lang=cpp

Sounds great - I only been using this engine a few hours so far but got the character controller crouch to work fine now and love the terrain system with multiple layers...now with the Ultra Engine, when/is this available now - is it separate to current 4.2 LW engine or requires it to run and is it extra cost ?? , thanx.....

Link to comment
Share on other sites

Ultra Engine is a new software that will only be sold on our site on a subscription basis at $9.99 a month. During the "early access" phase the price will be reduced to $7.99, and users will keep the lower price as long as their plan remains active.

The early access release will be a C++ programming SDK for Windows. There is a new editor in development, but in the meantime the Leadwerks editor is largely compatible.

Ultra Engine was invented to solve the performance problems I saw while working on VR projects at NASA. The engine delivers 10x faster performance than Leadwerks or Unity:

Additionally, it gives the user a lot more control over every aspect of the engine, with terrain materials being one example.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...