Sword of Moonlight > Projects, demos, and games Information

Walking animations and sound defects

<< < (2/3) > >>

Holey Moley:
Thanks to the "Data Space" in this website with a cross-referenced database of SOM's files and 3D model previews, and the "Enemy PRF Editor" made by "JDO" of long ago, I was easily able to locate the Talos' sound file. It would otherwise be very difficult, because AFAIK the game player just loads all available SND files at the beginning, but I could be mistaken.

Anyway, it's interesting to try the following:


--- Code: ---[Sample]

footstep_identifier=30
--- End code ---

I thought I put documentation for these extensions in the wiki, but it doesn't seem like it. There's nothing there anyway.

30 is the SND identifier.

I don't know if this will work or not. The sound is just one sound, and the Talos plays it twice apparently for each step in its animation.

For the PC the sound plays when the foot touches down. This is too late it seems, even though it always seemed to work okay with the menu beeps. I guess I must have SomEx analyze the sound file, and assume the middle of its playtime is when the foot touches down. Maybe that's a bad assumption, but it's sure to be closer than starting at the top.


It also throws a wrench into the walking effect, since it will have to anticipate the foot touching down. One philosophy there is to just play the sound come what may, or after the sound begins playing, the step cannot be reversed at that point. I will opt for the former for now, since there are other times where locking in the step would be appropriate, and I haven't enforced that just yet either.


Anyway, it's a little spooky to hear a stepping like sound coming out of the walking effect!

Man I really wish the "Enemy PRF Editor" worked on NPCs. I also wish JDO had the good sense to publish its source code.

Holey Moley:

EDITED: I should warn--or I just noticed--that if you try the footstep_identifier=30 experiment, the way SomEx plays the sound (like a menu beep) has the side effect of converting that sound into a non-3D sound played at full volume. So the end result is the Talos will also play the sound like that, and you can here it as long as he is visible.

I will have to find the subroutine for playing 3D sounds. I discovered this experimenting with the volume, because it would play louder than the Talos walking beside you. I don't know, my feet make loud sounds traipsing across the hardwood kitchen floor. I don't really notice it, but it becomes distracting in a video game, something about how it's just bellowing from speakers from in front of you perhaps. The arrangement does sound what it sounds like to walk though. Even though something about it doesn't quite sit right with me.


I converted the 30.SND file to a WAV file by hand earlier today. Just to be sure I understood the SND files. I determined that its length was close to real-time, and when cut in half is more than 15fps. So being so short, I thought when it played shouldn't make much of a difference. I didn't want to try to time it. So what I did is change where it plays from at the bottom of the walking effect, where the foot hits the floor so to speak, or bottoms out at least, to the point where the sine wave crosses its middle. It's only a heuristic, but it's good enough to get the sound out in front of the touchdown, so it more or less succeeds in fooling my brain.

I've also added a footstep to when you land from a jump. It's not ideal, but you expect to hear something when that occurs, so it's necessary. It can play out loudest volume after I get everything sorted out.

BTW: DirectSound cannot make sounds louder than they are. I guess that goes for the BGM also. Possibly this is standard operating procedure for computer sound files. I don't know. But it means kind of like how 3D textures have to be super bright, because they can never get any brighter under most system, the sounds are the same.

Holey Moley:
Funny!

Looking at the swordsman/woman monsters, they actually use 30.SND, but only for the second step. The first is 31.SND. This explains the asymmetry. This is according to the user generated "Enemy PRF Editor" tool.

31.SND sounds less like a footstep. It's like a peg leg maybe. It's almost as if a better footstep sound was provided for all of these NPCs, except that the staffer who made the change didn't realize both legs had to be changed! And didn't test the models after the change...

The NPCs are not visible, but they probably use the same pattern. Although I thought these monsters sounded different from the NPCs. Probably just my imagination. This tool should use negative numbers I'm sure, where it says the pitch is "255" or something near this. That should be -1.

Holey Moley:
At first I thought the "pitch" parts of the sound effects in the PRF files were not doing anything, as if they were a feature that was disabled in the end. I couldn't really tell a difference. But I was probably just inputting figures that were out of range.

Anyway, for safe keeping, here is how the pitch works for an input frequency of 11025, which the SND files all are implicitly, because they do not store the frequency part of the WAV file (they are raw PCM data)

Note, -1 is 255, -2 is 254, as they map to an "unsigned" byte. I said this should be represented as -1 and so on in the "Enemy PRF Editor", but actually it would be better if it presented the following menu of frequencies to choose from, disallowing invalid values.


--- Code: --- [0] 11025
[1] 11943
[2] 12862
[3] 13781
[4] 14700
[5] 15618
[6] 16537
[7] 17456
[8] 18375
[9] 19293
[10] 20212
[11] 21131
[12] 22050
[13] 23887
[14] 25725
[15] 27562
[16] 29400
[17] 31237
[18] 33075
[19] 34912
[20] 36750
[21] 38587
[22] 40425
[23] 42262
[24] 44100
~~~~~~~~~~~~~~
[-24] 2756
[-23] 2986
[-22] 3216
[-21] 3445
[-20] 3675
[-19] 3905
[-18] 4134
[-17] 4364
[-16] 4594
[-15] 4823
[-14] 5053
[-13] 5283
[-12] 5513
[-11] 5973
[-10] 6432
[-9] 6891
[-8] 7351
[-7] 7810
[-6] 8269
[-5] 8729
[-4] 9188
[-3] 9647
[-2] 10107
[-1] 10566

--- End code ---

The function does change if the frequency changes, and the SND slots do seem to store WAVEFORMATEX data, even though for the SND files they must all be equal. I think it would work fine if the table was filled out with something other than the SND files (not the frequency table above, but the actual place where the sound effects are inside the game player's memory. Which is actually dynamic memory for a change, if I am not mistaken.)


I got the 3D sounds working without much trouble. Although I noticed that the system I set up a long time ago to fix the sound limitations, doesn't let the duplicate sounds have independent frequencies. It averages them. I don't know if that's a DirectSound limitation, or if I just didn't have enough information to go on at the time, or was just lazy. I've made a note to look into it.


I don't know how far I will take this right now. I want to get the sound effects working for the PC. I may fix some of the NPCs. It would be easier to do later. I guess it's conceivably possible to do. At least for the NPCs that do not use the soft body animation style. That can be done later in the year after I get those exported to DAE.

Holey Moley:
Update:

I've removed some (off-topic) mentions of a Windows 10 keyboard navigation bug that I noticed/wanted to address at the same time I was working on this. Today I sat down to work on it, and the bug was no longer presenting. I have no idea what that means.

I would like to do the work I'd also mentioned to add some features to SOM_MAP, but it's very tempting to call it day, and save those for later. Especially since I won't be going elbow deep into the tool's SomEx code now!


I've wrapped up work on the PC's footstep sounds. And I ended up doing a lot of other things while I was at it. So I am inclined to not get into editing the PRF files for the time being. This thread will not be closed until this job is complete. The two monsters are fairly easily edited the "PRF Editor". They are 60.PRF and 61.PRF I believe, and they need their first walking sound changed to #30, like the second.

I believe the last version of this user-generated tool is 1.6, and I was able to search for that and find this (http://www.swordofmoonlight.com/bbs/index.php?topic=533.0) link. Lookout if you just search for "Enemy PRF Editor" you're likely to get an earlier version. Organization is not the strongest suit of most anyone who's done anything like this for SOM (other than myself of course :smile:)

I only mention these PRF files, because the NPCs don't generally require their walking sound effects, as authors rarely fool with their walking mode feature.


PS: It doesn't look like I've mentioned it yet. But I do intend to work on adding a way to tag MHM polygons with a material ID, for purposes of playing sound effects off of them, and probably other affects as well (ice can be made slippery for instance.) And so however that will work it'll also have to carry over to the MPX files, as MHM files are not of importance to the game player. I have not studied these two file formats as of yet, however I do intend to have MHM fully understood and available as a DAE target by the end of the year. The MHM data should probably be part of the DAE files that house the MSM data. MPX will be next in line--its priority not being as high as MHMs.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version