[Question] When I want to have engine sound while flying

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

[Question] When I want to have engine sound while flying

Post by Max Bain » Thu, 10. Sep 20, 17:58

Does anyone know what I have to do to make engines make sound not only when you accelerate or deaccelerate but also when you just fly? It takes a lot of immersion to me if you are flying but you dont hear your engines. Its like driving a car and you only hear it when you start and stop.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [Question] When I want to have engine sound while flying

Post by Neloth23 » Fri, 11. Sep 20, 02:22

Max Bain wrote:
Thu, 10. Sep 20, 17:58
Does anyone know what I have to do to make engines make sound not only when you accelerate or deaccelerate but also when you just fly? It takes a lot of immersion to me if you are flying but you dont hear your engines. Its like driving a car and you only hear it when you start and stop.
Basically, you have to change the type of volume curve used by engine sounds to "forwardspeed" instead of "forwardspeeddiff". You can try something like this:

Code: Select all

<replace sel="//group[@id='enginedetail_ship_03']/sound[@id='enginedetail_ship_03_jet_01']/volume">
		<volume start="1.0" distance="2">
			<customcurve input="forwardspeed">
				<point position="-1" value="0.6"/>
				<point position="-0.8" value="0.4"/>
				<point position="-0.2" value="0.2"/>
				<point position="0" value="0"/>
				<point position="0.2" value="0.2"/>
				<point position="0.8" value="0.5"/>
				<point position="1" value="0.8"/>
			</customcurve>
		</volume>
	</replace>
In a "forwardspeed" curve, "point position" corresponds to your speed indicator (0 is full stop, 1 is full forward), while "value" corresponds to the volume of your sound. With this command, I have a sound playing at 0.8 volume while the ship flies at full speed.

Hope this helps a bit.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Question] When I want to have engine sound while flying

Post by Max Bain » Fri, 11. Sep 20, 08:24

Thank you very much!

Wow, I just checked the sound__library and hell there are so many sounds that are beeing played depending on the engine...
Do you know what lfe and pitch means in the sound library? I found something like that:

Code: Select all

      <pitch>
        <customcurve input="forwardspeed">
          <point position="-1" value="0"/>
          <point position="0" value="-0.3"/>
          <point position="1" value="0"/>
        </customcurve>
      </pitch>
      <lfe>
        <customcurve input="forwardspeeddiff">
          <point position="-0.75" value="1"/>
          <point position="0" value="0"/>
          <point position="0.5" value="1"/>
        </customcurve>
      </lfe>

edit: I think the sound you pointed me at should exactly be like what you suggested (so input should be speed and not diff) because below there is already a specific sound for accelerarion and deacceleration what is the sound you hear in game when you accelerate or deaccelerate.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Rastuasi
Posts: 461
Joined: Mon, 1. Oct 18, 16:28
x4

Re: [Question] When I want to have engine sound while flying

Post by Rastuasi » Fri, 11. Sep 20, 14:31

Yet on space you don't keep the engines going like a car, I'd say the graphics is wrong and not audio. Unless changing speed or direction, we should not see ANY engine graphics.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Question] When I want to have engine sound while flying

Post by Max Bain » Fri, 11. Sep 20, 16:02

Rastuasi wrote:
Fri, 11. Sep 20, 14:31
Yet on space you don't keep the engines going like a car, I'd say the graphics is wrong and not audio. Unless changing speed or direction, we should not see ANY engine graphics.
If you follow this arguementation we will never ever have a proper space game ;).
I would say "if its cool, implement it!"
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Rastuasi
Posts: 461
Joined: Mon, 1. Oct 18, 16:28
x4

Re: [Question] When I want to have engine sound while flying

Post by Rastuasi » Fri, 11. Sep 20, 16:54

Max Bain wrote:
Fri, 11. Sep 20, 16:02
Rastuasi wrote:
Fri, 11. Sep 20, 14:31
Yet on space you don't keep the engines going like a car, I'd say the graphics is wrong and not audio. Unless changing speed or direction, we should not see ANY engine graphics.
If you follow this arguementation we will never ever have a proper space game ;).
I would say "if its cool, implement it!"
Perhaps, but I was simply stating that having sound all the time will break immersion for those that know how space works.

Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [Question] When I want to have engine sound while flying

Post by Neloth23 » Fri, 11. Sep 20, 18:25

Max Bain wrote:
Fri, 11. Sep 20, 08:24
Thank you very much!

Wow, I just checked the sound__library and hell there are so many sounds that are beeing played depending on the engine...
Yes engine sound in the sound_library uses 6 sounds per reactor type:
  • "thrusters_accel" and "thrusters_break" are used for the acceleration/deceleration and they are not looped;
  • "jet_01" is the main reactor sound. I'd say this is the one you want to modify. "jet_02" is an additional reactor sound that you can edit if you like. Both are looped sounds.
  • "lfe" and "stutter" are additional looped sounds that play when the ship steers or has brutal speed changes.
There are also sounds for boosters and travel mode, but that's another matter.
Do you know what lfe and pitch means in the sound library? I found something like that:

Code: Select all

      <pitch>
        <customcurve input="forwardspeed">
          <point position="-1" value="0"/>
          <point position="0" value="-0.3"/>
          <point position="1" value="0"/>
        </customcurve>
      </pitch>
      <lfe>
        <customcurve input="forwardspeeddiff">
          <point position="-0.75" value="1"/>
          <point position="0" value="0"/>
          <point position="0.5" value="1"/>
        </customcurve>
      </lfe>

edit: I think the sound you pointed me at should exactly be like what you suggested (so input should be speed and not diff) because below there is already a specific sound for acceleration and deacceleration what is the sound you hear in game when you accelerate or deaccelerate.
The pitch command allows you to modify the tonality of the sound (think of it as raising or lowering the pitch of a music note).
LFE stands for Low Frequency Effect. I believe this command is used to increase the amount of bass frequencies of the sound, or to direct it to a subwoofer. I'm not entirely sure though, as I've never messed with this command.

If you want a constant sound to play while your ship flies regularly, a "forwardspeed" curve is the way to go, as "forwardspeeddiff" is used to play sounds when your actual speed is different from that of your speed indicator.

In your lfe example, "point position" 0 is used when your speed reticle and the actual speed of your ship are identical. Point positions of -0.75 and 0.5 mean that your actual speed is lower or higher than what your reticle indicates (because you are strongly steering the ship or entering travel drive for instance). That's when the effect plays.

I hope all of this can be helpful and not too boring.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Question] When I want to have engine sound while flying

Post by Max Bain » Fri, 11. Sep 20, 18:46

That was very helpful. Thank you man :)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Post Reply

Return to “X4: Foundations - Scripts and Modding”