[Question] How do they calculate RoF?

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

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

Post Reply
Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

[Question] How do they calculate RoF?

Post by Newsparta » Thu, 3. Jan 19, 03:47

Quick question maybe someone can help me understand. I am trying to mod weapons but am having a hard time figuring out their Rate of Fire calculator to get an effective DPS for weapons.

For example:

If I make a pulse laser that has 1 ammo magazine with a 0 second reload and 6 rounds per second reload rate, the DPS in game shows 6 round per second with the corresponding DPS

However if I make it have a 6 ammo magazine with a 1 second reload and 6 rounds per second reload rate, the DPS in game is 0.97 rounds per second, but I calculate it to 3 rounds per second.
(one second to discharge the magazine, one second to reload the next makes 6 rounds in 2 seconds)

Can someone please help me, idk if I am having a brain fart or if there is a bug in the game calculations.

MutantDwarf
Posts: 711
Joined: Tue, 20. Jun 06, 02:29
x4

Re: [Question] How do they calculate RoF?

Post by MutantDwarf » Thu, 3. Jan 19, 04:51

I'm pretty sure your second weapon is being calculated as if it fires 1 round, 'reloads' for 1 second, fires another round, 'reloads', and so on until the magazine is empty and then the magazine is filled up over the course of 1 second, or something similar. How does the weapon actually behave in-game?

Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] How do they calculate RoF?

Post by Newsparta » Thu, 3. Jan 19, 05:03

MutantDwarf wrote:
Thu, 3. Jan 19, 04:51
I'm pretty sure your second weapon is being calculated as if it fires 1 round, 'reloads' for 1 second, fires another round, 'reloads', and so on until the magazine is empty and then the magazine is filled up over the course of 1 second, or something similar. How does the weapon actually behave in-game?
the way i saw it behave in game was the "reload rate" governed how fast each bullet was fired from the barrel, and the "ammunition reload" is the delay between salvos. So it wont wait 1 second in between shots if the ammunition reload is 1 second, it shoots as fast as the reload rate lets it and then stops once the magazine value has been reached

Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] How do they calculate RoF?

Post by Newsparta » Thu, 3. Jan 19, 05:14

This is what the code would look like with the replaced values

Code: Select all

<macros>
  <macro name="bullet_gen_turret_m_laser_01_mk1_macro" class="bullet">
    <component ref="bullet_gen_s_laser_01_mk1" />
    <properties>
      <ammunition value="6" reload="1" />
      <bullet speed="4600" lifetime="1.25" amount="1" barrelamount="2" icon="weapon_laser_mk1" timediff="0.018" angle="0.18" maxhits="1" ricochet="0" scale="0" attach="0" />
      <reload rate="6" />
      <damage value="37.5" repair="0" />
      <effects>
        <impact ref="impact_gen_s_laser_01_mk1" />
        <launch ref="muzzle_gen_s_laser_01_mk1" />
      </effects>
      <weapon system="turret_midrange" />
    </properties>
  </macro>
</macros>

The RoF in game for this reads 0.97 rounds per second and 72MW dps, but this shoots 6 rounds in one second and then reloads for one second, that's 1 salvo of 6 shots every 2 seconds

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: [Question] How do they calculate RoF?

Post by SirNukes » Thu, 3. Jan 19, 05:34

The game's calculation is bugged, last I checked.
viewtopic.php?f=146&t=409379

Also, the X4_Customizer has built in RoF and DPS calculations that will update as you edit weapon fields, if you are interested.

Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] How do they calculate RoF?

Post by Newsparta » Thu, 3. Jan 19, 05:45

SirNukes wrote:
Thu, 3. Jan 19, 05:34
The game's calculation is bugged, last I checked.
viewtopic.php?f=146&t=409379

Also, the X4_Customizer has built in RoF and DPS calculations that will update as you edit weapon fields, if you are interested.
Gotcha, thanks, i thought it might be.

Heretics End Guvna
Posts: 1
Joined: Fri, 29. Mar 24, 11:48
x4

Re: [Question] How do they calculate RoF?

Post by Heretics End Guvna » Sun, 14. Apr 24, 15:48

Apologies for resurrecting an ancient thread but I was just checking to see if the way the game calculates RoF has been fixed. Didn't spot any definitive outcome on this thread viewtopic.php?f=146&t=409379

Post Reply

Return to “X4: Foundations - Scripts and Modding”