• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

My world-builder JSON string

robject

SOC-14 10K
Admin Award
Marquis
Duplicated from the IISS discussion thread.

My program serves world data as a service via a JSON string. An example is below.

Note the extraneous/redundant "orbit", "greenhouse" and "density" entries, pointing at some dead code I need to trim.

Note that I should also sequester the UWP digits in a sub-structure.

Code:
{
  "albedo": "0.3",
  "star": "G2 V",
  "name": "Dert",
  "uwp": "D867973-8",
  "density": "",
  "greenhouse": "1.2",
  "orbit": "",
  "data": {
    "albedo": "0.3",
    "pressure": "1.17",
    "law": 3,
    "gov_desc": "Balkanization",
    "tilt": 7,
    "primaryLuminosity": "1.05",
    "hyd_desc": "70% water",
    "tl_desc": "the space age",
    "mass": "0.97",
    "law_desc": "prohibit of Acid, Fire, Gas weapons",
    "temperature": 28,
    "tl": 8,
    "starting_orbit": "1.2",
    "satellites": [
      {
        "tl": 8,
        "law": 7,
        "hyd": 0,
        "_uwp": "F000247-8    As    'Hospitable'",
        "starport": "F",
        "gov": 4,
        "siz": 0,
        "orbit": "s",
        "atm": 0,
        "pop": 2
      }
    ],
    "name": "Dert",
    "worldname": "Dert",
    "edgeZone": "32.50",
    "density": "0.97",
    "temperatureKelvin": 301,
    "siz": 8,
    "type": "Rocky",
    "starting_temp": 20,
    "gravity": "0.97",
    "innerZone": "0.01",
    "idealOrbit": "1.22",
    "continental_positions": "One Pole covered, one encircled",
    "world_desc": "Dert (D867973-8)\n\nDert is a medium-sized planet, with a diameter of 12800 km and a circumference of 40210 km. It has a standard atmosphere with a standard gas mixture and a pressure of 1.17.  It has seas of water covering 70% of its surface, and its surface gravity is 0.97 G. It has a year of 438 24-hour days; its actual day length is 13.8 hours. There are no satellites. Average temperature is 28 C, with a temperature change of -3 C per kilometre altitude.\n\nDert has a population of  billion. It is a balkanization, and its laws prohibit of acid, fire, gas weapons. Its tech is equivalent to the space age.\n\n",
    "outerZone": "2.44",
    "primary": "G2 V",
    "midZone": "1.42",
    "orbitalRadius": "1.13",
    "orbitalTrack": 3,
    "siz_desc": 12800,
    "starport": "D",
    "trade_codes": "Ga Hi Pr",
    "greenhouse": "1.2",
    "pop_desc": "billions",
    "starport_desc": "Poor quality",
    "continental_scatter": "Large Continents",
    "primaryRadius": "0.0",
    "satellites_stringified": "Satellite(S) F000247-8    As    'Hospitable'",
    "hyd": 7,
    "hadley_latitude": 29,
    "habZone": "1.00",
    "uwp": "D867973-8",
    "orbitalEccentricity": 0,
    "gov": 7,
    "nightTempIndex": -1,
    "rotationalPeriod": "0.57853982300885",
    "primaryMass": 1,
    "hoursPerDay": "13.8",
    "atm": 6,
    "seasonalTempIndex": 0,
    "atm_desc": "Standard",
    "pop": 9,
    "air": "Oxygen",
    "orbitalPeriod": 438
  }
}
 
This would be better:

Code:
{
  "primary": "G2 V",
  "id": "Dert"
  "worldname": "Dert",
  "uwp": "D867973-8",
  "trade_codes": "Ga Hi Pr",
  "uwp_data": {
        "starport": "D",
        "siz": 8,
        "atm": 6,
        "hyd": 7,
        "pop": 9,
        "gov": 7,
        "law": 3,
        "tl": 8
  },
  "uwp_desc": {
        "starport_desc": "Poor quality",
        "siz_desc": 12800,
        "atm_desc": "Standard",
        "hyd_desc": "70% water",
        "pop_desc": "billions",
        "gov_desc": "Balkanization",
        "law_desc": "prohibit of Acid, Fire, Gas weapons",
        "tl_desc": "the space age"
  },
  "primary_data": {
        "primaryLuminosity": "1.05",
        "edgeZone": "32.50",
        "innerZone": "0.01",
        "idealOrbit": "1.22",
        "outerZone": "2.44",
        "midZone": "1.42",
        "primaryRadius": "0.0",
        "habZone": "1.00"
  },
  "world_data": {
    "density": "0.97",
    "temperatureKelvin": 301,
    "type": "Rocky",
    "starting_temp": 20,
    "starting_orbit": "1.2",
    "orbitalRadius": "1.13",
    "orbitalTrack": 3,
    "gravity": "0.97",
    "continental_positions": "One Pole covered, one encircled",
    "greenhouse": "1.2",
    "continental_scatter": "Large Continents",
    "hadley_latitude": 29,
    "orbitalEccentricity": 0,
    "nightTempIndex": -1,
    "rotationalPeriod": "0.57853982300885",
    "primaryMass": 1,
    "hoursPerDay": "13.8",
    "seasonalTempIndex": 0,
    "air": "Oxygen",
    "orbitalPeriod": 438
    "world_desc": "Dert (D867973-8)\n\nDert is a medium-sized planet, with a diameter of 12800 km and a circumference of 40210 km. It has a standard atmosphere with a standard gas mixture and a pressure of 1.17.  It has seas of water covering 70% of its surface, and its surface gravity is 0.97 G. It has a year of 438 24-hour days; its actual day length is 13.8 hours. There are no satellites. Average temperature is 28 C, with a temperature change of -3 C per kilometre altitude.\n\nDert has a population of  billion. It is a balkanization, and its laws prohibit of acid, fire, gas weapons. Its tech is equivalent to the space age.\n\n",
    "albedo": "0.3",
    "pressure": "1.17",
    "tilt": 7,
    "mass": "0.97",
    "temperature": 28,
  },
  "satellites_stringified": "Satellite(S) F000247-8    As    'Hospitable'",
  "satellites": [
      {
        "tl": 8,
        "law": 7,
        "hyd": 0,
        "_uwp": "F000247-8    As    'Hospitable'",
        "starport": "F",
        "gov": 4,
        "siz": 0,
        "orbit": "s",
        "atm": 0,
        "pop": 2
      }
    ],
  }
}
 
Back
Top