EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
988 stars 155 forks source link

Frontier isn't localising Suit names above Grade 1 #1102

Open Athanasius opened 3 years ago

Athanasius commented 3 years ago

Ref: https://forums.frontier.co.uk/threads/elite-dangerous-market-connector-edmc.548869/post-9189160

My guess is that if playing in English the 'name' is the same as 'locName' and not symbol-based, but in any other language the 'name' suddenly is the symbol one. So perhaps we should just always be using the locName, if it's set.

e.g. $UtilitySuit_Class1_Name for name.

Athanasius commented 3 years ago

Except now I look at my journals and the code, and we are explicitly using the localised suit names from journal events. The CAPI-sourced data also has that (in fact we fake the CAPI locName from the journal Name_Localised).

So, yes, I'll need journals, and maybe also File > Save Raw Data (CAPI) data to see what's going on for anyone seeing the $symbol names.

Athanasius commented 3 years ago

My journals have e.g.

{ "timestamp":"2021-05-21T11:26:23Z", "event":"SwitchSuitLoadout", "SuitID":1700217809818876, "SuitName":"utilitysuit_class1", "SuitName_Localised":"Maverick Suit", "LoadoutID":4293000005, "LoadoutName":"PA/KS", "Modules":[ { "SlotName":"PrimaryWeapon1", "SuitModuleID":1700216182854765, "ModuleName":"wpn_m_assaultrifle_plasma_fauto", "ModuleName_Localised":"Manticore Oppressor" }, { "SlotName":"SecondaryWeapon", "SuitModuleID":1700217869872834, "ModuleName":"wpn_s_pistol_kinetic_sauto", "ModuleName_Localised":"Karma P-15" } ] }

and the suit part of my CAPI data is:

    "suit": {
      "locName": "Maverick Suit",
      "name": "UtilitySuit_Class1",
      "suitId": 1700217809818876
    }
Athanasius commented 3 years ago

We explicitly do this for SuitLoadout, SwitchSuitLoadout, CreateSuitLoadout:

        new_suit = {
            'name':    entry['SuitName'],
            'locName': entry.get('SuitName_Localised', entry['SuitName']),
            'suitId':  entry['SuitID'],
        }
Athanasius commented 3 years ago

And it's similar for BuySuit:

                self.state['Suits'][entry['SuitID']] = {
                    'name':      entry['Name'],
                    'locName':   entry.get('Name_Localised', entry['Name']),
                    'id': None,  # Is this an FDev ID for suit type ?
                    'suitId':    entry['SuitID'],
                    'slots':     [],
                }
Athanasius commented 3 years ago

So, yes, we need to see Journal files (and CAPI output to be sure) from anyone running in a language other than English.

We might end up having to check if the Name / SuitName is a $symbol, and if so map it back to the English name as a better fallback.

DarkmanReturns commented 3 years ago

EDMarketConnector.log EDMarketConnector-debug.log

Mav G3

Logs and suit stats attached as requested. Windows display language is English (United Kingdom).

Athanasius commented 3 years ago

@DarkmanReturns we also need the latest Journal file from shell:SavedGames\Frontier Developments\Elite Dangerous when this happens to see what your game client is telling us.

Athanasius commented 3 years ago

@DarkmanReturns never mind, we got an example from someone else:

{ "timestamp":"2021-05-21T21:52:08Z", "event":"SuitLoadout", "SuitID":1700399142082453, "SuitName":"tacticalsuit_class2", "SuitName_Localised":"$TacticalSuit_Class1_Name;", "LoadoutID":4293000002, "LoadoutName":"Dom1",

So we're simply using what the game tells us. The best we could do is detect the $ at the start of $TacticalSuit_Class1_Name; (and the ; at the end) and then ... well, either use the tacticalsuit_class2 or start building a lookup table to what we think is the English name. And even then it's possible that this is broken in other languages too and we'd then get user complaints about it being the wrong language.

In essence this is a Frontier bug.

Athanasius commented 3 years ago

Looking more closely ... I've only personally tested with grade 1, not upgraded, suits. They all seem fine.

The example above appears to be a grade 2 (bought or upgraded) suit.

At this stage I'm going to assume Frontier have broken localisation for anything but grade 1 suits (and weapons?).

Athanasius commented 3 years ago

Ideas for working around this, and indeed generally improving the UI/UX of this.

  1. Find/put together a mapping from not only the $symbol; versions, but also the other two forms; tacticalsuit_class2 and Dominator Suit, and our preferred form.
  2. That preferred form should be the shortest that is unique for a given type of suit. So just Dominator not Dominator Suit. It's already on our Suit: line, we know it's a suit.
  3. Decide how best to denote the grade of the suit. Dominator @ 3, Dominator (3), Dominator g3, Dominator 3, ...
Athanasius commented 3 years ago

NB: There doesn't appear to be such a mapping on https://github.com/EDCD/FDevIDs yet. If we end up being the people to make one then it should be PR'd to there for everyone's benefit.

DarkmanReturns commented 3 years ago

Journal from yesterday evening is the Maverick suit I referenced previously.

Journal.210521191701.01.log

I also have the same issue with a pre-engineered (Night Vision) G3 Dominator Suit:

Journal.210522162440.01.log EDMarketConnector.log EDMarketConnector-debug.log

In both cases clicking on the Update button results in the Suit line changing from $UtilitySuit_Class1_Name to the correct Suit type, e.g.: Maverick Suit, or Dominator Suit.

@DarkmanReturns we also need the latest Journal file from shell:SavedGames\Frontier Developments\Elite Dangerous when this happens to see what your game client is telling us.

Athanasius commented 3 years ago

In both cases clicking on the Update button results in the Suit line changing from $UtilitySuit_Class1_Name to the correct Suit type, e.g.: Maverick Suit, or Dominator Suit.

That will be because 'Update' pulls your commander profile from the Frontier CAPI, and that actually has the name correct. It will go incorrect again on any event where we use the Journal name(s). Currently we do that blindly, to ensure we have the latest data for the given suit and loadout (last CAPI pull could now be of stale data).