Discussion Commanders log manual and data sample

A noob question: how do you link scanned bodies to their systems using journal entries?

Journal scan event does not contain a "system" field, so how do you infer the system the scanned body belongs to?

Option 1: refer to the last jump event
Option 2: infer it from the body name

Both these options seem a bit weak to me, so I'd like to know your opinion.

Thanks.

Option 1, with variations. You can track current system with a combination of Location and FSDJump journal entries.
 

hchalkley

Senior Programmer
Frontier
example of new body scan:
{ "timestamp":"2017-02-01T15:31:21Z", "event":"Scan", "BodyName":"HIP 96493 A 1 c", "DistanceFromArrivalLS":1286.367432, "TidalLock":true, "TerraformState":"", "PlanetClass":"Rocky body", "Atmosphere":"", "AtmosphereType":"None", "Volcanism":"", "MassEM":0.003289, "Radius":1043017.937500, "SurfaceGravity":1.205061, "SurfaceTemperature":152.892029, "SurfacePressure":94.048325, "Landable":true, "Materials":[ { "Name":"iron", "Percent":19.562843 }, { "Name":"sulphur", "Percent":19.128872 }, { "Name":"carbon", "Percent":16.085402 }, { "Name":"nickel", "Percent":14.796515 }, { "Name":"phosphorus", "Percent":10.298150 }, { "Name":"manganese", "Percent":8.079254 }, { "Name":"germanium", "Percent":5.629005 }, { "Name":"arsenic", "Percent":2.517368 }, { "Name":"cadmium", "Percent":1.519144 }, { "Name":"ruthenium", "Percent":1.208130 }, { "Name":"tin", "Percent":1.175312 } ], "SemiMajorAxis":2950186240.000000, "Eccentricity":0.002621, "OrbitalInclination":-0.138484, "Periapsis":191.252548, "OrbitalPeriod":3824831.250000, "RotationPeriod":3824930.250000 }
 
example of new body scan:
{ "timestamp":"2017-02-01T15:31:21Z", "event":"Scan", "BodyName":"HIP 96493 A 1 c", "DistanceFromArrivalLS":1286.367432, "TidalLock":true, "TerraformState":"", "PlanetClass":"Rocky body", "Atmosphere":"", "AtmosphereType":"None", "Volcanism":"", "MassEM":0.003289, "Radius":1043017.937500, "SurfaceGravity":1.205061, "SurfaceTemperature":152.892029, "SurfacePressure":94.048325, "Landable":true, "Materials":[ { "Name":"iron", "Percent":19.562843 }, { "Name":"sulphur", "Percent":19.128872 }, { "Name":"carbon", "Percent":16.085402 }, { "Name":"nickel", "Percent":14.796515 }, { "Name":"phosphorus", "Percent":10.298150 }, { "Name":"manganese", "Percent":8.079254 }, { "Name":"germanium", "Percent":5.629005 }, { "Name":"arsenic", "Percent":2.517368 }, { "Name":"cadmium", "Percent":1.519144 }, { "Name":"ruthenium", "Percent":1.208130 }, { "Name":"tin", "Percent":1.175312 } ], "SemiMajorAxis":2950186240.000000, "Eccentricity":0.002621, "OrbitalInclination":-0.138484, "Periapsis":191.252548, "OrbitalPeriod":3824831.250000, "RotationPeriod":3824930.250000 }

Thank you!
 
example of new body scan:
{ "timestamp":"2017-02-01T15:31:21Z", "event":"Scan", "BodyName":"HIP 96493 A 1 c", "DistanceFromArrivalLS":1286.367432, "TidalLock":true, "TerraformState":"", "PlanetClass":"Rocky body", "Atmosphere":"", "AtmosphereType":"None", "Volcanism":"", "MassEM":0.003289, "Radius":1043017.937500, "SurfaceGravity":1.205061, "SurfaceTemperature":152.892029, "SurfacePressure":94.048325, "Landable":true, "Materials":[ { "Name":"iron", "Percent":19.562843 }, { "Name":"sulphur", "Percent":19.128872 }, { "Name":"carbon", "Percent":16.085402 }, { "Name":"nickel", "Percent":14.796515 }, { "Name":"phosphorus", "Percent":10.298150 }, { "Name":"manganese", "Percent":8.079254 }, { "Name":"germanium", "Percent":5.629005 }, { "Name":"arsenic", "Percent":2.517368 }, { "Name":"cadmium", "Percent":1.519144 }, { "Name":"ruthenium", "Percent":1.208130 }, { "Name":"tin", "Percent":1.175312 } ], "SemiMajorAxis":2950186240.000000, "Eccentricity":0.002621, "OrbitalInclination":-0.138484, "Periapsis":191.252548, "OrbitalPeriod":3824831.250000, "RotationPeriod":3824930.250000 }

Thanks for the info and the example. Now we have plenty of time to adapt to the new format in our parser.
 
Thanks for the info and the example. Now we have plenty of time to adapt to the new format in our parser.
Now, how about versioning the journal files (in the initial header event), so people can trigger different code based on that, rather than either having to write code that can cater to all possibilities (apps might need to read any live journal file, so all old formats as well), or keep a list of 'release version' numbers for each journal change ?
 
there is a "gameVersion" field in the "FileHeader" event, which is (supposed to be) outputted at the beginning of each file, it's possible to check the version here as well as if the version is a beta

Code:
{ "timestamp":"2016-12-02T12:04:33Z", "event":"Fileheader", "part":1, "language":"English\\UK", "gameversion":"2.2", "build":"r126898/r0 " }

I said "supposed to be" because I've seen case where this event wasn't there
 
there is a "gameVersion" field in the "FileHeader" event, which is (supposed to be) outputted at the beginning of each file, it's possible to check the version here as well as if the version is a beta

Code:
{ "timestamp":"2016-12-02T12:04:33Z", "event":"Fileheader", "part":1, "language":"English\\UK", "gameversion":"2.2", "build":"r126898/r0 " }

I said "supposed to be" because I've seen case where this event wasn't there
Yes, game version. That can increment when there are no journal changes. It's what I was referring to with "keep a list of 'release version' numbers for each journal change".

I'm asking for a journal version element to be in that Fileheader event, incremented whenever there are any changes to the journal format.
 
I don't think they introduce breaking changes to the logs without changing the game version & build number in that header file ; did that happen in the past?
 
I don't think they introduce breaking changes to the logs without changing the game version & build number in that header file ; did that happen in the past?

I would not trust the header journal version anyway even if they had one. Its not to hard to look into the content of the json line and handle it different depending on content.
I have already made 2.3 compatibility in EDDiscovery and tested with the supplied examples. Works fine with both 2.2 and 2.3 journals for me now.

Here is how i did test the different content now in C#.

Code:
  JToken mats = (JToken)evt["Materials"];
            if (mats != null)
            {
                if (mats.Type == JTokenType.Object)
                {
                    Materials = mats?.ToObject<Dictionary<string, int>>();
                }
                else
                {
                    Materials = new Dictionary<string, int>();
                    foreach (JObject jo in (JArray)mats)
                    {
                        Materials[(string)ja["Name"]] = JSONHelper.GetInt(jo["Count"]);
                    }
                }
            }
 
Last edited:
I would not trust the header journal version anyway even if they had one. Its not to hard to look into the content of the json line and handle it different depending on content.
I have already made 2.3 compatibility in EDDiscovery and tested with the supplied examples. Works fine with both 2.2 and 2.3 journals for me now.

Here is how i did test the different content now in C#.

Code:
  JToken mats = (JToken)evt["Materials"];
            if (mats != null)
            {
                if (mats.Type == JTokenType.Object)
                {
                    Materials = mats?.ToObject<Dictionary<string, int>>();
                }
                else
                {
                    Materials = new Dictionary<string, int>();
                    foreach (JObject jo in (JArray)mats)
                    {
                        Materials[(string)ja["Name"]] = JSONHelper.GetInt(jo["Count"]);
                    }
                }
            }


Heh. Here's what I wrote for CL2 in Python a couple of days ago...

Code:
    @staticmethod
    def convert_or_return_materials_dict(matsline):
        if isinstance(matsline, list):
            matsdict = {}
            for item in matsline:
                name = item['Name']
                pc = item['Percent']
                matsdict[name] = pc
            return matsdict
        else:
            return matsline

Kind of similar - I need a dictionary so I can feed it straight to SQLALchemy, which matches up the material name with the field name in my material table.

So in this case I either pass the dict straight back if the journal scan entry is already a dictionary as in 2.2 and below, or I convert 2.3 and above's list into a dict. Simples. ;)
 
Here is how i did test the different content now in C#.

Code:
  JToken mats = (JToken)evt["Materials"];
  if (mats != null)
  {
    if (mats.Type == JTokenType.Object)
    {
      Materials = mats?.ToObject<Dictionary<string, int>>();
    }
    else
    {
      Materials = new Dictionary<string, int>();
      foreach (JObject jo in (JArray)mats)
      {
        Materials[(string)ja["Name"]] = JSONHelper.GetInt(jo["Count"]);
      }
    }
  }

I hope that's jo["Name"] otherwise I've found the first bug without using the program ;)
 
Good job and thx FD Devs.
I have a couple of requests, i don't know if there is a place for API requests or not but i'll go with it anyways:

Could u add the ShipType when the following events happen?
Interdicted and Interdiction.

also can we get an log for getting attacked? it will also be gr8 to get the following keys from it:
Attacker: pilot name
IsPlayer: whether player or npc
CombatRank: if player
Faction: if npc
Power: if npc working for a power
ShipType: (ship model name)
 
Good job and thx FD Devs.
I have a couple of requests, i don't know if there is a place for API requests or not but i'll go with it anyways:

Could u add the ShipType when the following events happen?
Interdicted and Interdiction.

also can we get an log for getting attacked? it will also be gr8 to get the following keys from it:
Attacker: pilot name
IsPlayer: whether player or npc
CombatRank: if player
Faction: if npc
Power: if npc working for a power
ShipType: (ship model name)

Requests should be raised as bug reports.
 
Go to windows explorer and type "%USERPROFILE%\Saved Games\Frontier Developments\Elite Dangerous" in to the location bar.

Thank you! Finally found it.

Frontier loves to write its <censored> all over the place it seems...

(Looks like you can't delete posts here, or I'm too blind to find it)
 

hchalkley

Senior Programmer
Frontier
The new version of the Player Journal reference manual (v9) for 2.3 beta 1 is now available.

updated document:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual.doc

now also available as a PDF:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual_v9.pdf


Here's a summary of the changes:

• The code for various nested arrays of records within an event record has been rewritten for consistency. Some events are affected, they now have an array of records with an entry for each material, rather than a record with material names used as value names. All Json key names should now be fixed strings, not material or commodity names. This also allows localisation of the material names. Affected data:
o EngineerCraft/Ingredients
o Scan/Materials
o Synthesis/Materials
• Add Latitude and Longitude info to "Location" event, if starting game in SRV
• Fix bug when storing old Item in "ModuleBuy" event
• Add new "StartJump" event at the start of a hyperspace jump
• If you do not have a Detailed Surface Scanner, a basic scan will now add some info in the journal. A basic "Scan" on a planet will include body name, planet class, orbital data, rotation period, mass, radius, surface gravity; but will exclude tidal lock, terraform state, atmosphere, volcanism, surface pressure and temperature, available materials, and details of rings
• Scanning a planet with rings, if you have a DSS, new include ReserveLevel info
• When accepting a mission, ("MissionAccepted") include info on the effect on influence and reputation
• Include faction info in the RedeemVoucher event
• When ship takes off when dismissed by player in SRV, or lands when recalled via SRV, save a Liftoff/Touchdown event, with PlayerControlled=false
• Add "SetUserShipName" event
• Add events for Muticrew: JoinACrew, QuitACrew, CrewMemberJoins, CrewMemberQuits, KickCrewMember, ChangeCrewRole
• A detailed scan of a planet with atmosphere will now include detailed atmospheric composition
• When accepting a "massacre" mission, the target faction and kill count are now logged
• Add ShipName, ShipIdent, FuelLevel and FuelCapacity info to the "LoadGame" event
• Add info at startup with new events for Cargo, Materials, Passengers, and Loadout
• Added "Scanned" event
 
The new version of the Player Journal reference manual (v9) for 2.3 beta 1 is now available.

updated document:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual.doc

now also available as a PDF:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual_v9.pdf


Here's a summary of the changes:

• The code for various nested arrays of records within an event record has been rewritten for consistency. Some events are affected, they now have an array of records with an entry for each material, rather than a record with material names used as value names. All Json key names should now be fixed strings, not material or commodity names. This also allows localisation of the material names. Affected data:
o EngineerCraft/Ingredients
o Scan/Materials
o Synthesis/Materials
• Add Latitude and Longitude info to "Location" event, if starting game in SRV
• Fix bug when storing old Item in "ModuleBuy" event
• Add new "StartJump" event at the start of a hyperspace jump
• If you do not have a Detailed Surface Scanner, a basic scan will now add some info in the journal. A basic "Scan" on a planet will include body name, planet class, orbital data, rotation period, mass, radius, surface gravity; but will exclude tidal lock, terraform state, atmosphere, volcanism, surface pressure and temperature, available materials, and details of rings
• Scanning a planet with rings, if you have a DSS, new include ReserveLevel info
• When accepting a mission, ("MissionAccepted") include info on the effect on influence and reputation
• Include faction info in the RedeemVoucher event
• When ship takes off when dismissed by player in SRV, or lands when recalled via SRV, save a Liftoff/Touchdown event, with PlayerControlled=false
• Add "SetUserShipName" event
• Add events for Muticrew: JoinACrew, QuitACrew, CrewMemberJoins, CrewMemberQuits, KickCrewMember, ChangeCrewRole
• A detailed scan of a planet with atmosphere will now include detailed atmospheric composition
• When accepting a "massacre" mission, the target faction and kill count are now logged
• Add ShipName, ShipIdent, FuelLevel and FuelCapacity info to the "LoadGame" event
• Add info at startup with new events for Cargo, Materials, Passengers, and Loadout
• Added "Scanned" event

Very exciting set of changes here, many thanks for publishing it in advance.
 
The new version of the Player Journal reference manual (v9) for 2.3 beta 1 is now available.

updated document:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual.doc

now also available as a PDF:
http://hosting.zaonce.net/community/journal/v9/Journal_Manual_v9.pdf


Here's a summary of the changes:

• The code for various nested arrays of records within an event record has been rewritten for consistency. Some events are affected, they now have an array of records with an entry for each material, rather than a record with material names used as value names. All Json key names should now be fixed strings, not material or commodity names. This also allows localisation of the material names. Affected data:
o EngineerCraft/Ingredients
o Scan/Materials
o Synthesis/Materials
• Add Latitude and Longitude info to "Location" event, if starting game in SRV
• Fix bug when storing old Item in "ModuleBuy" event
• Add new "StartJump" event at the start of a hyperspace jump
• If you do not have a Detailed Surface Scanner, a basic scan will now add some info in the journal. A basic "Scan" on a planet will include body name, planet class, orbital data, rotation period, mass, radius, surface gravity; but will exclude tidal lock, terraform state, atmosphere, volcanism, surface pressure and temperature, available materials, and details of rings
• Scanning a planet with rings, if you have a DSS, new include ReserveLevel info
• When accepting a mission, ("MissionAccepted") include info on the effect on influence and reputation
• Include faction info in the RedeemVoucher event
• When ship takes off when dismissed by player in SRV, or lands when recalled via SRV, save a Liftoff/Touchdown event, with PlayerControlled=false
• Add "SetUserShipName" event
• Add events for Muticrew: JoinACrew, QuitACrew, CrewMemberJoins, CrewMemberQuits, KickCrewMember, ChangeCrewRole
• A detailed scan of a planet with atmosphere will now include detailed atmospheric composition
• When accepting a "massacre" mission, the target faction and kill count are now logged
• Add ShipName, ShipIdent, FuelLevel and FuelCapacity info to the "LoadGame" event
• Add info at startup with new events for Cargo, Materials, Passengers, and Loadout
• Added "Scanned" event


Thanks! Very interesting read even for those who don't build 3rd party apps.

Btw. Page 16 typo, "missions of years" :D
 
Back
Top Bottom