Sounds and Surfaces

Started by Zeotrope, July 04, 2018, 02:52:09

Previous topic - Next topic

Zeotrope

Sounds and Surfaces... or more to the point. Different footstep sounds for different surfaces a player traverses.

In my Open World FPS, for most of the time, the controlled player walks across sand and grass and I'm pretty happy with the footstep sounds I have chosen. However, I also have stone, wood and metal surfaces I would like the player to walk across and I'm not sure how to approach this problem in a logical way.

My initial thought was to place a trigger box (re-sizable to suit) just on and above a given surface and thus while the player touched said trigger, the appropriated footstep sound set would be applied

Would this "trigger" be detected via a collision ? Is there another way ?

GW

#1
You could create hidden 2d map made up of a list of 2d polygons, check if the player(x,z) is inside any polygon and change the sound.

Matty

Have a low resolution color map similar to your heightmap where the ground is different surfaces.

Pick down at the player's feet.  Get the coordinates X/Z and scale to fit the color map for surfaces.

If the color is red play earth sounds
If the color is green play grass sounds
If the color is blue play water sounds..

makes sense?

Zeotrope

Quote from: Matty on July 05, 2018, 06:11:02
Have a low resolution color map similar to your heightmap where the ground is different surfaces.

Pick down at the player's feet.  Get the coordinates X/Z and scale to fit the color map for surfaces.

If the color is red play earth sounds
If the color is green play grass sounds
If the color is blue play water sounds..

makes sense?

Makes sense for terrain based footsteps but what about entity based footsteps ? Buildings / wooden piers / decks / metal plates etc. ?

GrindalfGames

Give each object a collision type and then change the sound according to the collision type

RemiD

#5
i would use low details shapes and name them appropriately (to be able to identify their material) and use a linepick on the near enough low details shapes. (the low details shapes are not rendered using entityalpha 0)

or use a 2D array where each 1x1z unit cell has a value which correspond to a material

_PJ_

Are you using BSP for the level geometry? I believe this has a capability for material types.

Otherwise, How is the geometry generated - you could always assign an encoded pixel to the vertices (using W etc. that isn't actually used) to encode the material type.

Check the collisionvertex with player and see the value of W -if it's different from the last time you checked, change the sound in that channel.

Zeotrope

Quote from: _PJ_ on September 01, 2018, 11:49:32
Are you using BSP for the level geometry? I believe this has a capability for material types.

Otherwise, How is the geometry generated - you could always assign an encoded pixel to the vertices (using W etc. that isn't actually used) to encode the material type.

Check the collisionvertex with player and see the value of W -if it's different from the last time you checked, change the sound in that channel.

No BSP for level geometry. Using built in terrains and some mesh overlays here and there. Also on top of that, structures like bridges and walkways, rocks and walls, building interiors, jungle foliage and grassy fields are all loaded in via an array. All placed and manipulated via my editor and saved out into a *.txt file which is loaded each time the program is run.

Seems I require a host of solutions that either linepick the loaded objects I traverse and another routine to pick find the terrain surface via a color picking system. Not a huge priority at the moment but I eventually want to implements this.