UFO:Alien Invasion

Development => Sounds and Music => Topic started by: DexCisco on November 21, 2012, 01:06:14 am

Title: A facelift for footsteps/terrain
Post by: DexCisco on November 21, 2012, 01:06:14 am
While some of the footstep sounds are OK, many of them sound like someone whacking the ground with a stick.  There is also no variation in the step sounds, so they are all "clunk, clunk, clunk, clunk".  It would also be nice if the sounds could be standardized a bit more in terms of length and the general footfall sound so they blend together better.  I have been looking at the terrain.ufo file, as well as the team_*.ufos.  The team ufos have lists of sound files for wounding and dying sounds for the various units.  I think the same thing could be done to the terrain.ufo, allowing each terrain to have multiple footstep sounds, perhaps with alternate sounds for crouched walking, heavy steps (like Ortnoks, Power Armor), spiders, tracked,  wheeled (UGVs) etc. as needed as well as grenade bounce sounds.  The code should be very similar to how the team defs are parsed and used.  Terrain.ufo also needs new entries for the added textures, as well as bouncefractions set in each.

I don't know that much C++, but I think I may be able to figure out well enough how to reuse the existing code to create the new structure.  It will still be a lot of work though.  Is anyone else working on something like this?
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on November 21, 2012, 12:36:03 pm
While some of the footstep sounds are OK, many of them sound like someone whacking the ground with a stick.  There is also no variation in the step sounds, so they are all "clunk, clunk, clunk, clunk".  It would also be nice if the sounds could be standardized a bit more in terms of length and the general footfall sound so they blend together better.  I have been looking at the terrain.ufo file, as well as the team_*.ufos.  The team ufos have lists of sound files for wounding and dying sounds for the various units.  I think the same thing could be done to the terrain.ufo, allowing each terrain to have multiple footstep sounds, perhaps with alternate sounds for crouched walking, heavy steps (like Ortnoks, Power Armor), spiders, tracked,  wheeled (UGVs) etc. as needed as well as grenade bounce sounds.  The code should be very similar to how the team defs are parsed and used.  Terrain.ufo also needs new entries for the added textures, as well as bouncefractions set in each.

I don't know that much C++, but I think I may be able to figure out well enough how to reuse the existing code to create the new structure.  It will still be a lot of work though.  Is anyone else working on something like this?

Mattn is already working on something like this (i hope), based on my idea: http://ufoai.org/wiki/Proposals/Sound/Footstep_Sounds
Its also noted in my Get rid of the Silence (http://ufoai.org/forum/index.php/topic,6700.0.html) thread. Team based footsteps are also already in the code. Ill create new footsteps as soon as everything of the stuff is ingame and working.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 23, 2012, 10:33:42 pm
I thought about categorizing the textures too.  It would make it more maintainable, but it is a bigger change and involves changes in more places in the code.  But I suppose if you are going to do it, do it right.  I was thinking something more like this:

terraintype grass
{
   bouncefraction 1.0
   sounds {
      footsteps {
         normal (
            "footsteps/grass"
            "footsteps/grass1"
            "footsteps/grass2"
         )
         crouched (
            ...
         )
         heavy (
            ...
         )
         spider (
            ...
         )
         wheeled (
         )
         ...
         
      }
      bounce (
         "weapons/grenade-bounce-grass"
      )
      
   }
   textures(
      "tex_nature/grass001"
      "tex_nature/grass"
      ...
   )
}
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on November 23, 2012, 10:50:45 pm
The best place to put stuff like this is in the Discussion page for the Proposal in the wiki. The forums drift into obscurity after a while.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 24, 2012, 12:39:34 am
OK.  Moved it there (didn't know I could edit the wiki), but there doesn't seem to be any link to the discussion page unless you are in edit mode.
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on November 24, 2012, 12:59:59 am
You must be logged in to get a link to the Discussion page.
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on November 24, 2012, 04:13:08 pm
It would make it more maintainable...
Thats the reason why i even haven't thought about touching the current footstep sounds "assignment". As long as i haven't add the footstep sound to every single textures, iam fine.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 24, 2012, 11:17:57 pm
I am going to start playing with this as best as I can.  If there is anything you can think of to add to the terrain.ufo structure, let me know.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 29, 2012, 05:28:26 am
I just committed some changes I made.  It is my first time so I hope I didn't screw anything up.

I parsed every texture out of the .map files and stored them in a local database, then went through and visually categorized every one of them (>1000) according to the sound they should make.  I then assigned one footstep sound as well as a bouncefraction to each category, then used that info to dump a complete terrain.ufo (now 10x larger).  I can use the same data to create a new, more compact terrain.ufo that will allow for multiple footstep sounds, etc. as I have proposed, but that is a ways off yet.

I also created some new footstep sounds for wood, carpet, metal grates (new category) and grass.  I also modified the hard-coded footstep volume up a bit.  It was at 20%, so the sounds would have to be recorded quite loud to be heard.  I upped it to 40%.
I also added movement sounds for bloodspiders and hovernets, as the team defs allow for an overridden constant footstep sound for them.

It is not a finished product, but hopefully better than silence.
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on November 29, 2012, 10:40:38 am
DexCisco: can you make a patch and upload it to our patch tracker (https://sourceforge.net/p/ufoai/patches/)? Then someone can look at it, let you know what needs to be changed (if anything) and then apply it to master when it's approved?

Also, can you share the code you used to parse the textures? These little bits of code are useful for future revisions should we need to make them.
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on November 29, 2012, 01:46:28 pm
I just committed some changes I made.  It is my first time so I hope I didn't screw anything up.

I parsed every texture out of the .map files and stored them in a local database, then went through and visually categorized every one of them (>1000) according to the sound they should make.  I then assigned one footstep sound as well as a bouncefraction to each category, then used that info to dump a complete terrain.ufo (now 10x larger).  I can use the same data to create a new, more compact terrain.ufo that will allow for multiple footstep sounds, etc. as I have proposed, but that is a ways off yet.
Inform me as soon as the stuff is available in the nightly builds.

I also created some new footstep sounds for wood, carpet, metal grates (new category) and grass.
Please upload your sounds here first, so i can make a quality check. And actually i wanted to make new footstep sounds, as i already mention in my last post. ;)
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 30, 2012, 12:54:40 am
It is pointless to upload a diff if the sound files are not in place, and I don't know how to handle that.  Crystan, you wanted to see the sound files first anyway, so here they are.  Feel free to add them or replace them as you see fit.

Terrain.ufo is completely new
move.ogg is the Hovernet move sound I put in sounds\aliens\hovernet\
move2.ogg is the bloodspider move sound from sounds\aliens\bloodspider\
The team_aliens.ufo adds these sounds
The rest of the sounds are from sounds\footsteps
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on November 30, 2012, 01:10:08 am
OK, here is the diff.  I can't get my SourceForge password until tomorrow.
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on November 30, 2012, 11:34:31 am
Oh you just assigned the missing footstep sounds to textures which haven't had a footstep sound using the current footstep system? Well i thought you added a system we were talking about earlier, because adding footstep sounds using the current system is actually a waste of time. ;) (it was also my leverage to adding a new footstep sound system :P) Anyway we cant use the sounds you uploaded for the following reasons:

move.ogg is the Hovernet move sound I put in sounds\aliens\hovernet\ - the hovernet got already a new (better) "footstep sound", just havent uploaded it yet because mattns code havent worked at that time.

move2.ogg is the bloodspider move sound from sounds\aliens\bloodspider\ - if i understood you right, you found that sound in the bloodspider folder? That cannot be the case. This is the original bloodspider move sound i made and is still the only footstep sound found in the bloodspider folder: http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=blob;f=base/sound/aliens/bloodspider/move.ogg

grate1.ogg - doesnt match the quality standards
grass5.ogg - doesnt match the quality standards

wood5.ogg - is fine in quality but it wont fit to the other wood footsteps (ill make completly new ones, dont worry, until the original concept i had i mentioned is ingame)

I can remove and exchange the stuff with the other sounds, so we can still make use of your work - if you want.

Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 01, 2012, 05:12:53 am
Quote
Oh you just assigned the missing footstep sounds to textures which haven't had a footstep sound using the current footstep system?  Well i thought you added a system we were talking about earlier,

I am a long ways off from attempting to implement that.

Quote
because adding footstep sounds using the current system is actually a waste of time

Well, there are sounds for every texture now.   :)  I did it programmatically, so now that the textures are categorized, I can generate the terrain.ufo in seconds.

Quote
the hovernet got already a new (better) "footstep sound", just havent uploaded it yet because mattns code havent worked at that time.

So upload that sucker.  I would like to hear it.

Quote
if i understood you right, you found that sound in the bloodspider folder?

No, I created it.  I didn't find the one you made until I was looking for a place to put mine.  I haven't tested out yours in game yet, but mine is better than spiders with two feet, which is what it was.

Quote
grate1.ogg - doesnt match the quality standards
grass5.ogg - doesnt match the quality standards

By quality standards do you mean frequency and kbps or you just don't like it?  I had to back and forth between programs a bit because I only have one program that will save .ogg files, but I like some of the editing tools in the other better.

Quote
I can remove and exchange the stuff with the other sounds, so we can still make use of your work - if you want.

Do what you feel best.  I like it the way it is, personally, at least better than missing sounds and some of the clicky footsteps.  This part of the game is your baby, so it is your choice how you use it.

Title: Re: A facelift for footsteps/terrain
Post by: Crystan on December 01, 2012, 02:11:08 pm
I am a long ways off from attempting to implement that.
Well, there are sounds for every texture now.   :)  I did it programmatically, so now that the textures are categorized, I can generate the terrain.ufo in seconds.
Ah sorry, thought you added them by hand. ;)

So upload that sucker.  I would like to hear it.
Sorry, didn't mean to offend you. Check the attachment for my hovernet sound together with some other new footstep sounds
*Note: i designed the hovernet sound as a one shot sound

No, I created it.  I didn't find the one you made until I was looking for a place to put mine.  I haven't tested out yours in game yet, but mine is better than spiders with two feet, which is what it was.
Oh sorry. Yeah, mine is tbh a very old sound i made around end 2010.

By quality standards do you mean frequency and kbps or you just don't like it?
I meant the frequency - its noted in our  sound & music contributor section (http://ufoai.org/wiki/Music_and_sounds).

Do what you feel best.  I like it the way it is, personally, at least better than missing sounds and some of the clicky footsteps.  This part of the game is your baby, so it is your choice how you use it.
Oh dont get me wrong - i am happy about that someone finally cares about the footsteps. As already mentioned i didn't mean to offend you. Anyway have you a site where i can checkout other sound samples from you? Oh and which programs do you use? :)
Title: Re: A facelift for footsteps/terrain
Post by: ShipIt on December 01, 2012, 05:23:09 pm
So far I found some minor problems only.

- The formatting in terrain.ufo.
Code: [Select]
terrain tex_base/helipad{
footstepsound "footsteps/stone1"
bouncefraction "1.0"
}
terrain tex_base/lab_wall001{
footstepsound "footsteps/stone1"
bouncefraction "1.0"
}

should be
Code: [Select]
terrain tex_base/helipad {
footstepsound "footsteps/stone1"
bouncefraction "1.0"
}

terrain tex_base/lab_wall001 {
footstepsound "footsteps/stone1"
bouncefraction "1.0"
}
And usually one newline at the end of the file is enough.  :)

- A typo where it reads "footseps/dirt2" instead "footsteps/dirt2" in terrain.ufo.

- The terrain.ufo contains a lot of useless textures, like the ones that are used for blending only. I would rather like to see only the needed textures there. There is a footstepper.sh script in /contrib/scripts. Not sure what it does exactly, but it was used to find textures and add them to terrain.ufo, so it might be worth taking a look.

If you could solve that, I would vote for pushing this to master. Crystan should be able to replace/add sound files afterwards, if needed. Of course it would be even better if you could provide sound files that meet the quality standard Crystan mentioned.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 01, 2012, 06:56:55 pm
I have attached an updated terrain.ufo to fix the issues that ShipIt has mentioned.  I believe that the footstepper script was intended to work with the footstep surface tag in Radiant, but none of the maps that I looked at had that tag set.  I could be wrong.  The game has to have some way of determining what grids are passable.    I thought about trying to decypher the map format and determine which brushes had large, horizontal surfaces, but it was easier to just grab it all.

As for the sounds, these are the only ones that I did because they were the ones that I felt sounded the least like they should.  The grass was very crunchy, and the bloodspiders making the same walking noises as humans was just odd.

I am not at all offended by my inability to read the standards first.   :D  I'll see what I can do in the future about higher quality sounds, but we are talking about noise here.  I think the frequency breadth is more important than the throughput, and stereo doesn't really make much sense because the footsteps are going to be positionally located anyway.

One thing I found challenging, particularly with the looping bloodspider sound is that the sound plays for each grid you enter, so walking horiz/vert plays the sounds closer together than if you walk diagonally because walking diagonally takes longer.  So either the horiz/vert walking sounds overlap, or the diagonal sounds skip.  I almost think it would be better to have one, long audio loop for footsteps on each surface type (maybe even synched with the animation !) and have the sounds played by some kind of object that can be told to start, stop, or change the sound based on queues from the actor.  So I start walking on grass, it tells this object to start playing the grass footsteps loop.  I move over onto gravel, it switches the loop to the gravel footsteps loop.  I stop moving, it stops the loop.  I crouch and move, it plays a different loop of crouched footsteps.  It would eliminate the whole problem of having to piece together unnaturally tiny little fractions of sound from different sources, and all the timing issues involved, particularly with constant footstep sounds like spiders, hovernets, and eventually UGVs (and flying armor  ;)).  The end result would be much more natural sounding.
Title: Re: A facelift for footsteps/terrain
Post by: ShipIt on December 01, 2012, 08:21:37 pm
I have attached an updated terrain.ufo to fix the issues that ShipIt has mentioned.  I believe that the footstepper script was intended to work with the footstep surface tag in Radiant, but none of the maps that I looked at had that tag set.  I could be wrong.  The game has to have some way of determining what grids are passable.    I thought about trying to decypher the map format and determine which brushes had large, horizontal surfaces, but it was easier to just grab it all.

I think growing the terrain.ufo file without end by adding each texture is not the way to go. We need some way to find out which textures actually needed here. Maybe Duke has an idea about this.

As for the sounds, these are the only ones that I did because they were the ones that I felt sounded the least like they should.  The grass was very crunchy, and the bloodspiders making the same walking noises as humans was just odd.

I am not at all offended by my inability to read the standards first.   :D  I'll see what I can do in the future about higher quality sounds, but we are talking about noise here.  I think the frequency breadth is more important than the throughput, and stereo doesn't really make much sense because the footsteps are going to be positionally located anyway.

If Crystan says the quality of the sounds is not good enough, I believe him. If so, we will need to replace them asap.
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on December 02, 2012, 11:51:56 am
@DexCisco: this looks great, thanks for doing all this legwork. Can I ask again: can you give us the script you used to categorize textures and generate the terrain.ufo file? This could be great for keeping this file updated in the years to come.

Did you only add textures that are definitely used in the maps (using the licenses file as I mentioned before)? If so, I think it's fine to add all these texture references, even if not all of them are likely to be used as floors. First, they could end up being walked on if a wall panel is lying destroyed on the floor, for instance. Second, since this is pretty comprehensive and sorted by category, it will make it easier to define overall texture categories which we could eventually use for lots of sounds, not just footsteps.

@ShipIt: the footstepper.sh only lists those textures that have the floor surfaceflag checked in Radiant. Maintaining the maps seems like more work than maintaining the terrain.ufo file, especially if we can use DexCisco's sorting and generating script.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 02, 2012, 09:23:52 pm
Since I am not very good at C++ or Python ATM, I used what I know, which is Lotus Notes, so it is probably not going to be very useful unless you want to download the Notes Designer  :D.  I can run it against the map files and have it identify textures that are new and need to be categorized.  If someone wants to rewrite this using something else, have at it.  I knew I could do it quickly and easily with what I know.  It was a way I could contribute without knowing much C++.

As mentioned before, I parsed the .map files, not including the tex_common textures, so only used textures are included.  The _nm textures are not included, as they don't show up in the map files.  I have also created a list of textures that are only used once or twice if someone wants to attempt some consolidation (attached)

I have noticed several maps with doors lying on the ground for instance that now have appropriate footstep sounds.
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on December 03, 2012, 11:04:26 am
...and stereo doesn't really make much sense because the footsteps are going to be positionally located anyway.
Well i've written that just the ambience sounds should be preferably in stereo. :)

I crouch and move, it plays a different loop of crouched footsteps.
Well for a game like UFO:AI its actually not necessary to create extra crouched footsteps. But if you want to implement a system for it - go on. I wont stop you. :D

One thing I found challenging, particularly with the looping bloodspider sound is that the sound plays for each grid you enter, so walking horiz/vert plays the sounds closer together than if you walk diagonally because walking diagonally takes longer.  So either the horiz/vert walking sounds overlap, or the diagonal sounds skip.  I almost think it would be better to have one, long audio loop for footsteps on each surface type (maybe even synched with the animation !) and have the sounds played by some kind of object that can be told to start, stop, or change the sound based on queues from the actor.  So I start walking on grass, it tells this object to start playing the grass footsteps loop... ...It would eliminate the whole problem of having to piece together unnaturally tiny little fractions of sound from different sources, and all the timing issues involved, particularly with constant footstep sounds like spiders, hovernets, and eventually UGVs (and flying armor  ;)).  The end result would be much more natural sounding.
I asked mattn a few months about that, he meant it would be difficult to implement looping sounds - atleast for the geoscape - could be another story for the battlescape since it supports looping sounds for ambs. :( Btw. until the loop system is not ingame, we should use my spider move sound - although i like your sound. Also ill commit soon a sound update which will also include completely new footstep sounds. (including grate sounds) :)
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on December 03, 2012, 11:47:46 am
@Crystan: how soon do you expect to have the new sounds commited? When you do, I'd like to get DexCisco to generate his terrain.ufo file again and then get it in-game so we can test in case there are any performance problems with such a long file.

@DexCisco: you never know, someone on the dev team might have Lotus Notes, and it could save a lot of time when we have to update this thing in a year or two...
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 03, 2012, 05:40:25 pm
Crystan, if you want you can give me a list of sound file names to use for each category so I can generate a terrain.ufo with the right sounds so we don't have to search/replace to fix it in the future.

I have been using my terrain.ufo (and my sounds) in game and have not noticed any performance issues, though the AI turn can get a bit noisy when there are multiple actors moving at the same time.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 06, 2012, 01:56:39 am
Updated the terrain.ufo to add the extra whitespace.
Title: Re: A facelift for footsteps/terrain
Post by: H-Hour on December 06, 2012, 10:47:09 am
DexCisco, thanks for this. Can I just check: is this set up to work without your added sound files? ie - if I add this to master without adding your sound files, will it work without any problems? Or will it look for sound files that don't exist?
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on December 06, 2012, 03:22:23 pm
Crystan, if you want you can give me a list of sound file names to use for each category so I can generate a terrain.ufo with the right sounds so we don't have to search/replace to fix it in the future.

I have been using my terrain.ufo (and my sounds) in game and have not noticed any performance issues, though the AI turn can get a bit noisy when there are multiple actors moving at the same time.
Sry have been busy with other things. Well atm iam replacing all stock sounds (grass1-4,snow1-4,sand1-4,stone1-4,wood1-4,metal1-4 etc.) just had not the time finish the stuff.
Title: Re: A facelift for footsteps/terrain
Post by: DexCisco on December 07, 2012, 12:52:40 am
Quote
is this set up to work without your added sound files?
No.  At the moment it uses grass5, carpet5, wood5, which are all my sounds.  I could put them back, but...  :'(
Ok, here is a changed copy...


Quote
Sry have been busy with other things. Well atm i am replacing all stock sounds (grass1-4,snow1-4,sand1-4,stone1-4,wood1-4,metal1-4 etc.) just had not the time finish the stuff.

At the moment we only need one sound for each.  If you make your best #1 we can work with that until we can use multiple sounds per terrain type.
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on December 17, 2012, 11:46:19 am
Here are the new footstep sounds. I've also multiple sounds of the same type available (grass1-4 etc) but i want to modify them a bit (and atm they're useless anyway). Ill also add later extra sounds for grate and metal.
Title: Re: A facelift for footsteps/terrain
Post by: ShipIt on December 29, 2012, 04:50:43 pm
Shall we push those sounds to the repo?
Title: Re: A facelift for footsteps/terrain
Post by: Crystan on December 30, 2012, 02:55:52 am
shure