Author Topic: questions concerning sav-files  (Read 6072 times)

Offline Zharkov

  • Colonel
  • ****
  • Posts: 429
    • View Profile
questions concerning sav-files
« on: March 30, 2018, 10:02:38 pm »
Two questions concerning the sav-files:

Major:
Why are the files so confusing again?
e.g.:
Code: [Select]
     - hadPreviousFacility: false
        x: 0
        type: STR_ACCESS_LIFT
        disabled: false
        y: 2
      - disabled: false
        type: STR_HANGAR
        x: 0
        y: 0
        hadPreviousFacility: false
      - type: STR_ALIEN_CONTAINMENT
        x: 0
        y: 5
        hadPreviousFacility: false
        disabled: false
For my computer this doesn't matter, but for me as a human being it would be much easier to read and edit, if there was a clear and orderly sequence.

Minor:
What is the line
Code: [Select]
        hadPreviousFacility: falseabout?

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: questions concerning sav-files
« Reply #1 on: March 30, 2018, 10:23:37 pm »
Major:  Because its yaml, and as long as hierarchy is respected (indentation), yaml doesn't care what order things are in.

Minor:  That is a result of recent code additions in OXCE+ that allow for building facilities on top of each other, in effect upgrading a facility in place, etc.

Offline Zharkov

  • Colonel
  • ****
  • Posts: 429
    • View Profile
Re: questions concerning sav-files
« Reply #2 on: March 30, 2018, 10:42:04 pm »
Major:  Because its yaml, and as long as hierarchy is respected (indentation), yaml doesn't care what order things are in.
Yeah, I am aware that human friendly order is not necessary, nevertheless iirc, there were versions, when that was the case anyway.

Minor:  That is a result of recent code additions in OXCE+ that allow for building facilities on top of each other, in effect upgrading a facility in place, etc.
Cool!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: questions concerning sav-files
« Reply #3 on: March 31, 2018, 02:06:33 pm »
The sequence was always random.
If you saw it non-random, it was just a coincidence or perception bias.

PS: or more accurately... OpenXcom never ordered it explicitly... it might have been ordered by underlying YAML-CPP library... but I really doubt that... my best guess is still just a coincidence or perception bias

Offline Zharkov

  • Colonel
  • ****
  • Posts: 429
    • View Profile
Re: questions concerning sav-files
« Reply #4 on: March 31, 2018, 03:34:04 pm »
The sequence was always random.
If you saw it non-random, it was just a coincidence or perception bias.

PS: or more accurately... OpenXcom never ordered it explicitly... it might have been ordered by underlying YAML-CPP library... but I really doubt that... my best guess is still just a coincidence or perception bias

I took a look at an old sav-file:

Code: [Select]
      - type: STR_SOLDIER_S
        id: 80
        name: Hairy Dyonisia
        nationality: 0
        initialStats:
          tu: 90
          stamina: 116
          health: 81
          bravery: 30
          reactions: 47
          firing: 85
          throwing: 57
          strength: 72
          psiStrength: 52
          psiSkill: 0
          melee: 34
        currentStats:
          tu: 90
          stamina: 119
          health: 82
          bravery: 30
          reactions: 49
          firing: 86
          throwing: 66
          strength: 73
          psiStrength: 52
          psiSkill: 0
          melee: 99

I checked 20 str_soldier and as they were all sorted like this, I decided against statistical analysis.

And that is what the buildings looked like (p < .000001):
Code: [Select]
    facilities:
      - type: STR_ACCESS_LIFT
        x: 1
        y: 2
        disabled: false
      - type: STR_HANGAR
        x: 0
        y: 0
        disabled: false
      - type: STR_FIRE_PIT
        x: 2
        y: 2
        disabled: false
      - type: STR_LIVING_QUARTERS_LARGE
        x: 0
        y: 4
        disabled: false
      - type: STR_HYPER_WAVE_DECODER
        x: 2
        y: 3
        disabled: false
      - type: STR_ALIEN_CONTAINMENT
        x: 0
        y: 3
        disabled: false
      - type: STR_HANGAR
        x: 2
        y: 0
        disabled: false
      - type: STR_GENERAL_STORES_LARGE
        x: 2
        y: 4
        disabled: false
      - type: STR_MIND_SHIELD
        x: 3
        y: 3
        disabled: false
      - type: STR_LUXURY_SPA
        x: 4
        y: 4
        disabled: false
      - type: STR_HANGAR
        x: 4
        y: 0
        disabled: false
      - type: STR_STILL
        x: 4
        y: 3
        disabled: false
      - type: STR_MED_BAY
        x: 5
        y: 3
        disabled: false
      - type: STR_BURROW
        x: 1
        y: 3
        disabled: false


The other buildings lists, too.
« Last Edit: March 31, 2018, 03:51:45 pm by Zharkov »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: questions concerning sav-files
« Reply #5 on: March 31, 2018, 03:54:25 pm »
The sequence was always random.
If you saw it non-random, it was just a coincidence or perception bias.

PS: or more accurately... OpenXcom never ordered it explicitly... it might have been ordered by underlying YAML-CPP library... but I really doubt that... my best guess is still just a coincidence or perception bias
Even more, AFAIK you can't order nodes in yaml-cpp, probably this is effect of different implementation in that library between versions.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: questions concerning sav-files
« Reply #6 on: March 31, 2018, 03:55:04 pm »
Here is a save from November 2014 from official distribution of OpenXcom 1.0 for Windows:

Code: [Select]
    facilities:
      - y: 2
        x: 2
        type: STR_ACCESS_LIFT
      - x: 2
        y: 0
        type: STR_HANGAR
      - type: STR_GENERAL_STORES
        x: 0
        y: 4

You can check them yourself if you want here (bottom of the page): link broken
« Last Edit: October 12, 2019, 10:45:01 pm by Meridian »

Offline Zharkov

  • Colonel
  • ****
  • Posts: 429
    • View Profile
Re: questions concerning sav-files
« Reply #7 on: March 31, 2018, 04:18:20 pm »
And here are 2 sav-files with piratez ver: 0.99G.5 and OXCE+ 3.7a.

E.g.:
Code: [Select]
bases:
  - lon: 0.28034353199888262
    lat: -0.26993279583340346
    name: test
    facilities:
      - type: STR_ACCESS_LIFT
        x: 1
        y: 2
        disabled: false
      - type: STR_HANGAR
        x: 0
        y: 0
        disabled: false
      - type: STR_LIVING_QUARTERS
        x: 1
        y: 3
        disabled: false
      - type: STR_BURROW
        x: 2
        y: 3
        disabled: false
      - type: STR_CORRIDOR
        x: 3
        y: 3
        disabled: false
      - type: STR_WELL
        x: 4
        y: 3
        disabled: false
      - type: STR_STILL
        x: 5
        y: 3
        disabled: false
      - type: STR_GENERAL_STORES
        x: 0
        y: 3
        disabled: false
      - type: STR_ALIEN_CONTAINMENT
        x: 0
        y: 4
        disabled: false
      - type: STR_GENERAL_STORES_ARMORED
        x: 1
        y: 4
        disabled: false
      - type: STR_LABORATORY
        x: 2
        y: 4
        disabled: false
      - type: STR_SMALL_RADAR_SYSTEM
        x: 3
        y: 4
        disabled: false
    soldiers:
      - type: STR_SOLDIER
        id: 1
        name: Busty Calf
        nationality: 0
        initialStats:
          tu: 78
          stamina: 55
          health: 49
          bravery: 50
          reactions: 61
          firing: 62
          throwing: 41
          strength: 53
          psiStrength: 61
          psiSkill: 0
          melee: 79
        currentStats:
          tu: 78
          stamina: 55
          health: 49
          bravery: 50
          reactions: 61
          firing: 62
          throwing: 41
          strength: 53
          psiStrength: 61
          psiSkill: 0
          melee: 79
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 1
        look: 2
        lookVariant: 4
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0
      - type: STR_SOLDIER
        id: 2
        name: Vanilla Priss
        nationality: 0
        initialStats:
          tu: 72
          stamina: 36
          health: 59
          bravery: 60
          reactions: 60
          firing: 63
          throwing: 42
          strength: 10
          psiStrength: 58
          psiSkill: 0
          melee: 61
        currentStats:
          tu: 72
          stamina: 36
          health: 59
          bravery: 60
          reactions: 60
          firing: 63
          throwing: 42
          strength: 10
          psiStrength: 58
          psiSkill: 0
          melee: 61
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 0
        look: 1
        lookVariant: 1
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0
      - type: STR_SOLDIER
        id: 3
        name: Grumpy Jacket
        nationality: 0
        initialStats:
          tu: 66
          stamina: 42
          health: 53
          bravery: 30
          reactions: 70
          firing: 53
          throwing: 49
          strength: 16
          psiStrength: 62
          psiSkill: 0
          melee: 94
        currentStats:
          tu: 66
          stamina: 42
          health: 53
          bravery: 30
          reactions: 70
          firing: 53
          throwing: 49
          strength: 16
          psiStrength: 62
          psiSkill: 0
          melee: 94
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 0
        look: 3
        lookVariant: 12
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0
      - type: STR_SOLDIER
        id: 4
        name: Swingin Blaster
        nationality: 0
        initialStats:
          tu: 78
          stamina: 73
          health: 54
          bravery: 80
          reactions: 58
          firing: 67
          throwing: 53
          strength: 28
          psiStrength: 58
          psiSkill: 0
          melee: 95
        currentStats:
          tu: 78
          stamina: 73
          health: 54
          bravery: 80
          reactions: 58
          firing: 67
          throwing: 53
          strength: 28
          psiStrength: 58
          psiSkill: 0
          melee: 95
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 0
        look: 2
        lookVariant: 6
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0
      - type: STR_SOLDIER
        id: 5
        name: Boorish Minna
        nationality: 0
        initialStats:
          tu: 72
          stamina: 36
          health: 45
          bravery: 70
          reactions: 51
          firing: 57
          throwing: 40
          strength: 50
          psiStrength: 59
          psiSkill: 0
          melee: 65
        currentStats:
          tu: 72
          stamina: 36
          health: 45
          bravery: 70
          reactions: 51
          firing: 57
          throwing: 40
          strength: 50
          psiStrength: 59
          psiSkill: 0
          melee: 65
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 0
        look: 1
        lookVariant: 14
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0
      - type: STR_SOLDIER
        id: 6
        name: Hateful Kathy
        nationality: 0
        initialStats:
          tu: 75
          stamina: 62
          health: 49
          bravery: 80
          reactions: 65
          firing: 61
          throwing: 55
          strength: 43
          psiStrength: 59
          psiSkill: 0
          melee: 89
        currentStats:
          tu: 75
          stamina: 62
          health: 49
          bravery: 80
          reactions: 65
          firing: 61
          throwing: 55
          strength: 43
          psiStrength: 59
          psiSkill: 0
          melee: 89
        rank: 0
        craft:
          lon: 0.28034353199888262
          lat: -0.26993279583340346
          type: STR_AIRBUS
          id: 1
        gender: 1
        look: 1
        lookVariant: 2
        missions: 0
        kills: 0
        armor: STR_PIR_CASTAWAY_ARMOR_UC
        improvement: 0
        psiStrImprovement: 0
        diary:
          commendations:
            - commendationName: STR_MEDAL_ORIGINAL8_NAME
              noun: NoNoun
              decorationLevel: 0

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: questions concerning sav-files
« Reply #8 on: March 31, 2018, 04:33:47 pm »
I believe you... just saying OpenXcom never sorted it... it's either sorted by the library or by accident.

Offline Zharkov

  • Colonel
  • ****
  • Posts: 429
    • View Profile
Re: questions concerning sav-files
« Reply #9 on: March 31, 2018, 04:37:27 pm »
I believe you... just saying OpenXcom never sorted it... it's either sorted by the library or by accident.

Strange thing is, I am pretty sure this is no accident, but a feature you implemented.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: questions concerning sav-files
« Reply #10 on: March 31, 2018, 04:46:35 pm »
The only explicit sorting was implemented in March 2017 for options.cfg file: https://github.com/SupSuper/OpenXcom/commit/01f78550bdfb39f2a862f314d0fba32d683ca0d7

Everything else is handled by the library.