aussig / BGS-Tally

A tool to track and report your Background Simulation (BGS) and Thargoid War (TW) activity in Elite Dangerous, implemented as an EDMC plugin. BGS Tally counts all the work you do for any faction, in any system.
https://discord.gg/YDNVtjPnnm
MIT License
31 stars 9 forks source link

BGS-Tally underreports Exploration Data values -- or is it Elite's fault? #125

Closed Jessidhia closed 1 year ago

Jessidhia commented 1 year ago

Describe the bug BGS-Tally seems to consistently underreport the value of sold exploration data to me, but when I tried to read the code to see why there would be an underreport, I found that BGS-Tally simply reads the TotalEarnings value from the log, which led to a realization that Elite itself underreports earnings in TotalEarnings.

I suspected this is could be potentially related to having a hired NPC crew member, but even if I add back the Amount in the NpcCrewPaidWage lines, they don't match the expected value from the game UI, or from the BaseValue (with or without Bonus).

To Reproduce Steps to reproduce the behavior:

  1. Make note of the value of the exploration data to be sold
  2. Sell exploration data
  3. Click on Latest BGS Tally
  4. Check the corresponding faction's line item
  5. See mismatch

Expected behavior BGS-Tally should add the correct earning from exploration data sold.

However, I am not 100% certain that this is an ED client bug. I have no idea how to verify, but it's not impossible that what goes in TotalEarnings is what's really counted for BGS during the tick, and not the value in the UI.

Screenshots

BGS-Tally report line: image

{,Multi}SellExplorationData as they appear in EDDiscovery: image

Note how BGS-Tally sees 15.3 million while EDDiscovery reports ~16.8 million (the non-Multi sales were done in a different system). EDDiscovery itself appears to have a workaround for this issue, which is why their reported Total does not match the log line, but it's only active in the MultiSellExplorationData lines, not the single sales.

Raw log entries for the screenshotted events (plus Npc line, minus system names for space)

{"timestamp":"2023-07-18T10:47:32Z","event":"MultiSellExplorationData","Discovered":[],"BaseValue":16796132,"Bonus":65457,"TotalEarnings":15344070}
{"timestamp":"2023-07-18T10:47:32Z","event":"NpcCrewPaidWage","NpcCrewName":"Rosaline Mcpherson","NpcCrewId":147605184,"Amount":1256679}
{"timestamp":"2023-07-18T10:37:41Z","event":"SellExplorationData","Systems":[],"Discovered":[],"BaseValue":24270,"Bonus":0,"TotalEarnings":22086}
{"timestamp":"2023-07-18T10:37:41Z","event":"NpcCrewPaidWage","NpcCrewName":"Rosaline Mcpherson","NpcCrewId":147605184,"Amount":1808}
{"timestamp":"2023-07-18T10:37:27Z","event":"SellExplorationData","Systems":[],"Discovered":[],"BaseValue":19348,"Bonus":8087,"TotalEarnings":17607}
{"timestamp":"2023-07-18T10:37:27Z","event":"NpcCrewPaidWage","NpcCrewName":"Rosaline Mcpherson","NpcCrewId":147605184,"Amount":1442}
{"timestamp":"2023-07-18T10:37:19Z","event":"SellExplorationData","Systems":[],"Discovered":[],"BaseValue":30940,"Bonus":0,"TotalEarnings":28156}
{"timestamp":"2023-07-18T10:37:19Z","event":"NpcCrewPaidWage","NpcCrewName":"Rosaline Mcpherson","NpcCrewId":147605184,"Amount":2305}

Desktop (please complete the following information):

aussig commented 1 year ago

Many thanks for the detailed report, and your research into the problem. I wasn't aware that TotalEarnings can sometimes be incorrect, or missing altogether.

This could also explain an occasional issue where BGST doesn't report an exploration data sale at all.

I'll take a look at adjusting TotalEarnings if it is less than BaseValue + Bonus

Jessidhia commented 1 year ago

Out of curiosity I double-checked which of the values is what appears on the game's UI when you are picking what to sell, and it is the BaseValue. The Bonus is paid separately. I could not confirm if the Bonus is a portion of the BaseValue ("tax included" price-style) or if it is added as a separate payout, as the credit balance in EDD desynced from the game, probably because of this journal issue...

aussig commented 1 year ago

Well I suppose, as you say, the core question is which value is used in the BGS. We'll never know that as we don't know the game's internal formulas.

However, note that the two code examples from EDD you referenced do have the same logic: If TotalEarnings is less than BaseValue + Bonus then report and tally BaseValue + Bonus instead.

I think I'll switch to implementing that, at least it's consistent with EDD.