Author Topic: Sound modularity (departure from sounds.tbl)  (Read 2079 times)

0 Members and 1 Guest are viewing this topic.

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Sound modularity (departure from sounds.tbl)
Most things in SCP are highly modular.

I can make a ship and supply a -shp.tbm file and anyone can just drag and drop it (+ models and maps) into any active mod and it will work.
If it uses custom weapons, make a -wpn.tbm and drop hat in and it will work.
Custom weapon effects? Supply them, drag and drop!

But not with sounds. Sounds are cumbersome, since you constantly have to reference the numerical ID instead of actual file names AND because you have a singular file that is not conductive to multiple mods.

I suggests that one can reference sounds directly by name as well as by sounds.tbl ID (for backwards compability).

For example, I can say
$LaunchSnd:                             93

OR

$LaunchSnd:       "trp_photon_muzzle.wav"


This not only makes the entire system more modular, but also makes modding easier, since you don't have to do cross-references with the sounds.tbl, and is easier to read a a glance.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline m!m

  • 211
Re: Sound modularity (departure from sounds.tbl)
Everything you described is already possible :nervous:

The wiki article has documentation for all the features but if you use one of the two new sound entry formats you can assign an arbitrary name to a sound entry and then reference the sound with that name. The reason you can't just put the file name in the tables is that the file name alone is not enough information for a full sound entry.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Re: Sound modularity (departure from sounds.tbl)
Everything you described is already possible :nervous:

The wiki article has documentation for all the features but if you use one of the two new sound entry formats you can assign an arbitrary name to a sound entry and then reference the sound with that name. The reason you can't just put the file name in the tables is that the file name alone is not enough information for a full sound entry.

So?
Set other values to defaults.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline m!m

  • 211
Re: Sound modularity (departure from sounds.tbl)
In most cases there are no "default" values. For example, some times you need a 3D sound and some times you need a 2D sound. In your example which uses $LaunchSnd a 3D sound would be appropriate but in the case of a HUD sound a 2D sound is needed (which can then contain stereo sound). FSO cannot determine at the point at which the sound file name is parsed if the sound should be a 2D or 3D sound except if a preference would be hard-coded into the parser code and I am strongly opposed to that since it would require a lot of work for practically no benefit.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Re: Sound modularity (departure from sounds.tbl)
Then add that value in too

$LaunchSnd:       "trp_photon_muzzle.wav"
+3DSound:          YES
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Sound modularity (departure from sounds.tbl)
And then, once we're done adding all the fields that are required to properly set up a sound effect for the engine to use, we arrive at something that is indistinguishable from the current format.

Seriously, do you think we would be asking for all that information if we didn't need to?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Re: Sound modularity (departure from sounds.tbl)
It's two.

I can't even recall the last time anyone changed the other values (0, 1.00, 2, 500, 1000). This would be most useful for weapons anyway.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Re: Sound modularity (departure from sounds.tbl)
Actually, thinking about it there may be an even better way.

The ID and file names are both unique - after all, you can' have two files with the exact same name in the sounds folder.

so if you put:

Code: [Select]
$LaunchSnd:                             93
OR
$LaunchSnd:       "trp_photon_muzzle.wav"

the game could check the sounds.bl for EITHER

$Name:   209   trp_photon_muzzle.wav,   0, 1.00, 2, 500, 1000

And effectively return the ID for that filename.

That means that even if different sounds.tbl have different number of entries and different ID's for the same sound, the game will always return the right ID without the modders having to worry about it.



Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline m!m

  • 211
Re: Sound modularity (departure from sounds.tbl)
The file name is not unique since two sound entries can use the same sound file with different values.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Sound modularity (departure from sounds.tbl)
I don't understand why you aren't just giving your sounds names and calling it a day.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Re: Sound modularity (departure from sounds.tbl)
I don't understand why you aren't just giving your sounds names and calling it a day.

Because it's still not modular.

.tbm's allow of merging of different ship and weapons, bu sounds are still all in one file.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

  

Offline Axem

  • 211
Re: Sound modularity (departure from sounds.tbl)
Quote
This table is one of the Modular Tables and can be extended with xxx-snd.tbm

Not anymore. :)