Author Topic: Feature Request: "Speed of sound" script  (Read 6747 times)

0 Members and 2 Guests are viewing this topic.

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Feature Request: "Speed of sound" script
I know it's a bit controversial for a space sim, but how hard is to delay a sound depending on the distance between the player and the source of the sound itself?

If istantaneous sounds are hard-coded and basically impossible to delay in a conventional way, what about "fooling" the code by telling it to play an empty sound (like our beloved none.wav) and then use a script to play the real sound after x seconds (where x = t = v/d)? If it is too hard to delay all sounds, how about limiting this to explosions and even beams? I believe a "Speed of sound" script would significantly improve the gaming experience by boosting the player's perception of distances.

I'm afraid it wouldn't work properly in multi, but limiting its use to the single player mode is enough.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Feature Request: "Speed of sound" script
Not a scripting issue.

Also, new sound code has been added to trunk already. See the test builds forum for examples.
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 Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
Does that mean that I don't need a script to feature the speed of sound effect? :confused:
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Feature Request: "Speed of sound" script
No, it means that a) the scripting API can't do what you want it to do at the moment, which b) means someone needs to code something like it in, which of course means that you could just as well do it in a way that doesn't need scripting to do it.

All of which combines to "Not a scripting issue", as it means that someone on the SCP or some other coder needs to make the necessary additions to the engine.
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 Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
Are you sure it can't be done? Would you like to explain it?

I thought it was possible: scripting can manage sounds and it can also check distances between ships. I fail to understand how these features can't be combined... :confused:
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Feature Request: "Speed of sound" script
Yes, BUT: Scripting can't cancel or delay sounds. Which is what you'd need in order to do this properly.

In addition, something like this is better handled directly by the engine and additions to sounds.tbl instead of being handled by scripting (imho, of course).

Third, OpenAL already has functions built in to handle doppler effects and other stuff that is based on the relative positioning of objects in a 3D space. I imagine it would be easier to enhance sounds.tbl than it would be to enhance the scripting API.
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 Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
It kills the purpose of my request, though: that feature is not meant to become mainstream, it's just an hypothetic option people may or may not use. I don't need scripting to cancel istantaneous (and almost certainly hard-coded) sounds: editing sounds.tbl would be enough.

Here's an example. All these entries in sounds.tbl...


Code: [Select]
[...]
$Name: 6 breakup.wav, 0, 0.60, 1, 100, 800 ; ship death roll (3d sound)
[...]
$Name: 7 boom_3.wav, 0, 0.90, 2, 600, 1200 ; * ship explosion 1 (3d sound)
[...]
$Name: 49 boom_1.wav, 0, 0.90, 1, 600, 1200 ; * ship explosion 2 (3d sound)
[...]
$Name: 59 atomic.wav, 0, 0.90, 1, 2000, 4000 ; * captial ship explosion (3d sound)
[...]

...would all have their sound filenames changed to "none.wav". At that point, playing the delayed sounds would be up to the script (time delay = speed of sound / distance). I'm not a coder and, without considering who knows how many hours I spent working on an alternate version (which isn't that great) of Wanderer's flashy deaths, I've never ventured deeper into scripting... so please correct me if I got it wrong.  :)


That said (and no offense here!), I believe you rushed a thread move which probably wasn't necessary. :sigh:
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Feature Request: "Speed of sound" script
I would still argue that an effect like this is best left as a tbl/mission specs option.

You will also notice that there's a "Sound Environment" dialogue in .13 FRED where an option like this would be right at home.
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 Sushi

  • Art Critic
  • 211
Re: Feature Request: "Speed of sound" script
I would still argue that an effect like this is best left as a tbl/mission specs option.


I agree... really all you need is a parameter that defines "speed of sound" in the current mission environment. Attaching it to the mission and defaulting it to "infinite" makes the most sense to me.

I think it would be a really cool effect, especially for a mod like Wings.

It's definitely a code change, but IMO a worthy feature to have.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
That sounds convincing, thanks. :)
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Feature Request: "Speed of sound" script
Considering how the only viable explanation of any sounds apart from collisions and your own ship's activity is that they're produced by speakers in the cabin to better utilize the pilot's aural sensory organs to increase situational awareness, I don't think this feature should be used in space missions.

However, I fully endorse adding this in the sound engine to be used for future atmospheric missions. If it is at all possible to code it in within human resources.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
Atmospheric flight would definitely need this, but I wouldn't exclude its use in space missions for the sake of realism. At this point, I'd also say that speed of sound would boost situational awareness by adding the perception of distance to the perception of events.

Eyecandy and good gaming experience come before realism, anyway: this principle has been already applied to sounds in space, physics and many other things. Let's add something to the series. ;)
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Feature Request: "Speed of sound" script
Atmospheric flight would definitely need this, but I wouldn't exclude its use in space missions for the sake of realism. At this point, I'd also say that speed of sound would boost situational awareness by adding the perception of distance to the perception of events.

Eyecandy and good gaming experience come before realism, anyway: this principle has been already applied to sounds in space, physics and many other things. Let's add something to the series. ;)


Mixing realism with Rule of Perception is just unnecessary. I can understand simulating doppler effect on the fly-by sounds because that just sounds cool and people expect it (thus, rule of perception).

However, as having sounds in space is far enough detached from reality, making the sounds have delays because sounds normally have delays would just be confusing logic. Having delays in the sounds like distant explosions wouldn't increase situational awareness or immersiveness because when you already breach the laws of physics to fulfill Role of Perception, then introducing this kind of pseudorealistic delays in space missions would just work to counter that because people would not expect them.

In other words you would just have bug reports claiming that a lot of sounds are out of synch and delayed.


I have to say, though, that a fully articulating sound physics engine including speed of sound, doppler effects and sound barrier (have fun with singularities though - phear the div by zero!) would be magnificent resource for any atmospheric missions.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Feature Request: "Speed of sound" script
Let me clarify: the effect, at least according to my original concept, would be fully optional. No one will be forced to have sounds in space as long as the script isn't used (or the effect is activated in FRED, since people are suggesting a code change rather than an actual script).

I like the flight sims that feature those delays: whenever I destroy a target, I feel the distance between me and the explosion... just like I do with thunders. Shouldn't that work in FreeSpace, too? IMHO, it will. The game features very big ships and feeling their dimensions whenever they explode is a real boost to immersion. :)
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Feature Request: "Speed of sound" script
Doppler effect on sounds was recently tried and apparently it made everything sound awful.

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Re: Feature Request: "Speed of sound" script
I disagree, it wasn't awful--it just made certain sounds ****ty (such as the warpin-out sound)
Who uses forum signatures anymore?

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Feature Request: "Speed of sound" script
Delay in sound arrival, I think, would actually be kind of cool.  I think anyone who enjoys watching thunderstorms might agree.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

  

Offline sigtau

  • 29
  • unfortunate technical art assclown
Re: Feature Request: "Speed of sound" script
Delay in sound arrival, I think, would actually be kind of cool.  I think anyone who enjoys watching thunderstorms might agree.

At about 1:15 in this video, this is about the effect I think of.
Who uses forum signatures anymore?

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Feature Request: "Speed of sound" script
I disagree, it wasn't awful--it just made certain sounds ****ty (such as the warpin-out sound)

It wasn't awful, it just made things sound awful?

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Re: Feature Request: "Speed of sound" script
You nitpicky bastard.  :rolleyes:

I was referring to how only some sounds were ****ty in the new sound code, and the rest sounded fine.
Who uses forum signatures anymore?