EDCD / EDDI

Companion application for Elite Dangerous
Other
444 stars 81 forks source link

System stations numbers incorrect #2250

Closed Darkcyde13 closed 3 years ago

Darkcyde13 commented 3 years ago

What's Wrong (please be as specific as possible)

Expected

The number of stations listed under system.planetarystations and system.orbitalstations to be correct.

Observed

The numbers do not correlate to the number of stations in a system.

Steps to reproduce

  1. Run the 'System report' for any system.
  2. Check the reported number of stations (orbital and/or planetary) and compare with what is actually in the system.
  3. Observe that they are very wrong.

Configuration

My Investigation

Investigation Notes

I'd noticed this some time ago, and while it was annoying, it didn't really affect my play (and I kept forgetting to do anything about it). However, I've now got to the point where it's starting to irritate me, and now I need to "scratch the itch" so to speak.... AND I've finally remembered to report it! ;-)

So, I've looked into it. I can see that the system.stations is based off EDSM data (or it appears to be anyway), and this is correct for the number of stations listed on that site. However, EDSM is missing several stations for any system I've looked at while checking this out.

When it comes to the number of system.planetarystations and system.orbitalstations, there is a large discrepancy. Even taking the EDSM inaccuracy into account, the numbers are still way out. I've run some tests calculating ground and orbital stations, counting the types, etc., and I've found that EDDI seems to be counting the ground based 'Unknown Stations' as orbital stations instead of ground stations. Consequently, EDDI says there are way more orbital stations than there are, and way fewer ground stations.

Take HIP 19157 for example...

I get similar results from HIP 18843. Now, I know the number of Fleet Carriers are counted in system.stations, even though some have moved on and others have arrived, making the number incorrect in that respect. But even discounting this, the numbers are not accurate. I assume that getting the data from EDSM means that this will never be 100% accurate anyway.

TLDR; It seems that 'Unknown Stations' are being counted as orbital stations, when they should be ground stations. Plus other stations seem to be missed out too, both ground and orbital (but I think that part is down to EDSM). To fix (as best as possible) 'Unknown Stations' need to be counted as the ground stations they are.

This is the code I've used to test out (please excuse the mess :-P ):

{set sysStations to SystemDetails("HIP 19157")}

{set orbitalPorts to [
"AsteroidBase",
"Bernal",
"Coriolis Starport",
"Fleet Carrier",
"Mega-ship",
"Ocellus Starport",
"Orbis Starport",
"Outpost"]}

{set groundPorts to [
"CraterOutpost",
"OnFootSettlement",
"Settlement",
"Surface Station",
"Unknown Station"]}

{set orbit to 0}
{set ground to 0}
{set orbit2 to 0}
{set ground2 to 0}

{set listing to []}

{for sta in sysStations.stations:
    {if find(listing, sta.model) = -1:
        {set listing to cat(listing, [sta.model])}
    }
{_ sta.model}
    {if sta.model = "Unknown Station" || sta.model = "Surface Station":
        {set ground to ground + 1}
    |elif sta.model != "Fleet Carrier":
        {set orbit to orbit + 1}
    }

    {if find(groundPorts, sta.model) > -1:
        {set ground2 to ground2 + 1}
    |elif find(orbitalPorts, sta.model) > -1:
        {set orbit2 to orbit2 + 1}
    }
}

{set ground3 to len(sysStations.planetarystations)}
{set orbit3 to len(sysStations.orbitalstations)}

{_ List(listing)}

Ground: {ground}, {ground2}, {ground3}.
Orbital: {orbit}, {orbit2}, {orbit3}.

If: {ground + orbit}.
Find: {ground2 + orbit2}.
Len: {ground3 + orbit3}.

System Totals: {len(sysStations.stations)}, {len(sysStations.planetarystations)}, {len(sysStations.orbitalstations)}.

This is the output:

Ground: 13, 13, 1. Orbital: 3, 8, 15. If: 16. Find: 21. Len: 16. System Totals: 21, 1, 15.

This is the list of stations in HIP 19157:

Fleet Carrier, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Surface Station, Coriolis Starport, Outpost, Fleet Carrier, Outpost, Fleet Carrier, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Unknown Station, Fleet Carrier, Fleet Carrier

5 Fleet Carriers 12 Unknown Stations (ground stations according to EDSM) 1 Surface Station 1 Coriolis Starport 2 Outposts

EDDI Logs

N/A

Player journals

N/A

Tkael commented 3 years ago

Ref. https://www.edsm.net/api-system-v1/stations?systemName=HIP%2019157

This is a consequence of EDSM using aliases rather than the same variable names given by the player journal (meaning that we aren't able to match the names and they default to Unknown). I'll catch up our internal definitions.