biqqles / flint

A parser and API for Freelancer and its formats
https://github.com/biqqles/flint/wiki
Mozilla Public License 2.0
8 stars 2 forks source link

Some System(Entity) objects don't return all of the bases with the bases method #9

Closed jmonty42 closed 1 year ago

jmonty42 commented 1 year ago

Using a fresh copy of Discovery 4.91.0, there are several bases that do not show up in the EntitySet when calling the bases method of their respective system. Each missing base is present in the appropriate system ini file and each base object retrieved by flint has the correct system identified by its system string attribute.

Here is the list of missing bases I've found:

  1. Liverpool Border Station (br02_04_base) in system br02
  2. Battleship Rocroi (ga02_12_base) in system br05
  3. Battlecruiser Blackrock (br04_03_base) in system br05
  4. Fort Albi (br08_05_base) in system br08
  5. Planet New London, Landing Site (ga01_02_base) in system br10
  6. Unknown Object (br14_01_base) in system br13
  7. Omega-48 Gate Construction Site (ga05_03_base) in system br16
  8. Object Unknown (bw01_01_base) in system bw01
  9. Planet Kurile, Samura Platform (bw06_01_base) in system bw06
  10. Solarius Station (bw08_02_base) in system bw08
  11. Carrier Helios (ga06_03_base) in system bw09
  12. Rodez Outpost (ew15_09_base) in system bw15
  13. Pentecost Outpost (ew18_01_base) in system ew02
  14. Primus Outpost (ew06_04_base) in system ew07
  15. Viernheim Base (ew07_03_base) in system ew07
  16. Planet Gran Canaria (ew19_03_base) in system ew07
  17. Rippon Tor Blacksite (br10_01_base) in system ew07
  18. Gap Station (ew14_04_base) in system ew13
  19. Fourchambault Shipyard (ga06_08_base) in system ew13
  20. Secundus Outpost (ga05_04_base) in system fp7_system
  21. Scarred Battleship (li14_02_base) in system hi10
  22. Battleship Betheny (br10_02_base) in system iw04
  23. Battleship Yukon (li02_03_base) in system iw04
  24. Battleship Delaware (li09_03_base) in system iw08
  25. Police Prison Station (iw09_01_base) in system iw09
  26. Navy Prison Station (iw09_02_base) in system iw09
  27. Guard Station (iw09_03_base) in system iw09
  28. Unknown Station (iw09_04_base) in system iw09
  29. Planet Tomioka, Blood Dragon Outpost (bw14_02_base) in system ku09
  30. Planet Pittsburgh, Xeno Hideout (ga06_05_base) in system li01
  31. Planet Manhattan, Landing Site (ew16_01_base) in system li01
  32. New Haven Station (li06_05_base) in system li06
  33. Toronto Station (li12_01_base) in system li12
  34. Fort McMurray (li08_01_base) in system li12
  35. Mulvane Outpost (iw08_01_base) in system li17
  36. Arecibo Complex (li16_02_base) in system li18
  37. The Shrine (no01_01_base) in system no01
  38. Planet New Berlin (rh01_01_base) in system rh01
  39. Wedel Mining Facility (rh02_08_base) in system rh02
  40. Planet Nuremberg (rh06_05_base) in system rh06
  41. Planet Nuremberg, Bundschuh Supplies Warehouse (ga06_06_base) in system rh06
  42. Heldrungen Military Prison (rh12_01_base) in system rh08
  43. The Ravine (st06_01_base) in system st06
  44. Nomad Lair (ga10_01_base) in system st07
  45. Nomad Lair (st39_03_base) in system st39
biqqles commented 1 year ago

Hmm OK, thanks for the report, I will look at this when I have time.

biqqles commented 1 year ago

Hi @jmonty42, I have pushed a fix in the fix-base-detection branch. The fix is a simple one relating to how base objects are detected. Previously, for example, br02_04 would have been erroneously identified as a generic Object, meaning it was present in .contents() but not .bases(), and this has been fixed:

>>> fl.systems['br02'].bases()['br02_04']
BaseSolar(nickname='br02_04', ids_name=196669, ids_info=65693, pos=pos(x=63489.6, y=-55862.5, z=-7596.8), rotate=rot(x=0, y=0, z=0), archetype='invisible_base', reputation='br_p_grp', base='br02_04_base')

However because I don't use the library or play the game anymore, I need you to check that this change hasn't resulted in any weirdness where things are now being classified as bases when they aren't. So please get back to me on that.

biqqles commented 1 year ago

Actually, yes, I can already see this is happening, and the space_costume option was quite helpful previously in discriminating against asteroid miners.

jmonty42 commented 1 year ago

Thanks for taking a look at this! I'll pull that branch and test it out soon.

biqqles commented 1 year ago

Planet New Berlin and possible some others fixed in d271a513395bc797dcdbc6284761e337c899d21c

biqqles commented 1 year ago

OK, the current logic in the branch uses a somewhat hacky heuristic but it works. Now, out of your list, the only solars that are not classified as bases are those with archetype = invisible_base (the two in ew13 differ slightly but are equivalent to this).