lisongmechlab / lsml

Li Song Mech Lab

Home Page:http://lisongmechlab.github.io/lsml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SRMs reported with different eFP and rFP, in the weapons page.

sestrand opened this issue · comments

LSML version: 2.0.14
Screen resolution: 3440x1440
Java version: 8u333

Steps to reproduce issue:

  1. Open LSML
  2. Click on weapons page/tab
  3. compare eFP with rFP on the SRMs (or any other single volley missile)

Actual result:
eFP and rFP have different values.

Expected result:
because they are a single volley they should have the same value.

Summarising offline discussion here:

LSML is not correctly accounting for volley sizes of some weapons. For all weapons we need to determine the volley size. If it's not given in the XML files it should be assumed that all projectiles/missiles are fired in one volley. There's a delay between each volley, given in the XML. One odd observation from the game files is that IS-LRM20 has a volley delay of 0.5 seconds, I don't recall it firing in volleys does it? We need to confirm the actual firing period in game compare to LSML here.

For Historical context: volley size wasn't available as a parameter in the game files at the inception of LSML and some heuristics were used to determine if a weapon was "streaming" missiles.

So for all weapons the base computation of the raw firing period (rFP) should be updated to be:

double numVolleys = Math.Ceiling(numFiring / volleySize); // Use ceiling if volleySize doesn't evenly divide numFiring for some reason.
double firingDelay = (numVolleys - 1)* volleyDelay; // No delay after last volley
double coolDown = getCooldown(aModifiers);
return firingDelay + coolDown;

Obviously then depending on weapon type, burn duration of lasers and charge time for gauss etc needs to be added.

It has been noted that port size is now available in the game files and this would allow LSML to model the effect of the port size for missile launchers to better compute actual DPS of equipped launchers but this requires some careful UI design to make the user aware of this and to explain why the DPS might differ between the Weapons page and the Loadout page if equipped on a hardpoint that has a port size limit. We should file a follow-up FR to investigate the possibility of adding this but it's out of scope for this bug.

As for fixing the bug, I think a solid approach might be to let the Weapon class always have a volley size in addition to volley delay that's already present.
Then if volley size is not set for a weapon in the game files, we can just just set it to "num_firing" in the parsing code and then it will always be present in LSML and we can then push the function that L76 was supposed to perform down to Weapon.getRawFiringPeriod.

I'm a little bit worried about the possibility of other confusions also existing. In particular with num_firing compared to ammo_per_shot. It might be worthwhile auditing the implementations of the weapon classes and adding additional tests.

I filed #776 for port size limits.