CSV Files

From PlanetsWiki

Jump to: navigation, search

Contents

[edit] Overview

The Planets4 client allows to export the current data of a game as CSV-files.

[edit] CSV: Base - Structures & Build Req

The Stuctures and Build Req values from the Base.CSV exported file contain the bitfield below, which I've displayed as a set of macros for C/C++.

#define STRUCT_POD        (1 << 0)  // Pod Launch Pad
#define STRUCT_AIRATTACK  (1 << 1)  // Air Attack Base
#define STRUCT_MILITARY   (1 << 2)  // Military Space Port
#define STRUCT_ENGINE     (1 << 3)  // Engine Factory
#define STRUCT_MECH       (1 << 4)  // Assault Plant
#define STRUCT_FIGHTER    (1 << 5)  // Fighter Plant
#define STRUCT_MED        (1 << 6)  // Med Lab
#define STRUCT_GOV        (1 << 7)  // Government Center
#define STRUCT_SHIELD     (1 << 8)  // Base Shield
#define STRUCT_ORD        (1 << 9)  // Ordnance Plant
#define STRUCT_WEAPONS    (1 << 10) // Weapons Factory
#define STRUCT_REPAIR     (1 << 11) // Ship Repair Shop

[edit] CSV: Base - Switches

This was pulled from the newsgroup. These bits are in the same order that the stuctures are listed on the Struct tab of the Base screen but offset by 1 bit:

#0x0000 000F 
#   0x0000 0001 -- Appears to be unused 
#   0x0000 0002 Training Center 
#   0x0000 0004 Factory 
#   0x0000 0008 Farm 
#0x0000 00F0 
#   0x0000 0010 Smelter 
#   0x0000 0020 Mineral Mine 
#   0x0000 0040 City 
#   0x0000 0080 Pod Launch Pad 
#0x0000 0F00 
#   0x0000 0100 Military Space Port 
#   0x0000 0200 Raid Shelter 
#   0x0000 0400 Public Space Port 
#   0x0000 0800 Med Lab 
#0x0000 F000 
#   0x0000 1000 Engine Plant 
#   0x0000 2000 Fighter Plant 
#   0x0000 4000 Ship Repair Shop 
#   0x0000 8000 Weapons Factory 
#0x000F 0000 
#   0x0001 0000 Ordnance Plant 
#   0x0002 0000 Government Center 
#   0x0004 0000 Terraformer 
#   0x0008 0000 Scanner 
#0x00F0 0000 
#   0x0010 0000 Anti-Aircraft Gun 
#   0x0020 0000 Laser Cannon 
#   0x0040 0000 Air Attack Base 
#   0x0080 0000 Base Shield 
#0x0F00 0000 
#   0x0100 0000 Assault Plant 
#   0x0200 0000 Ion Cannon 
#   0x0400 0000 Undercity 
#   0x0800 0000 Resort 
#0xF000 0000 
#   ?? - Always set to 0x70000000

This was sent to me from Tim on 12/19/2005.

switchFlag AS LONG ' On or off switches
'bit 0  Medlab ON
'bit 1  Gov Center Share money with G. Bank
'bit 2  Factories ON
'bit 3  Base Shield ON
'bit 4  //OLD!!! Resorts ON
'bit 5  Cities ON
'bit 6  Public Space Ports ON
'bit 7  Ion Cannon ON
'bit 8  Laser Cannon ON
'bit 9  Mines ON
'bit 10 Training Centers ON
'bit 11 Smelters ON
'bit 12 Anti-air ON
'bit 13 Terraformer ON
'bit 14 scanner ON
'bit 15 Undercity ON
'bit 16 Ord plant ON
'bit 17 Farms ON
'bit 18 //OLD!!! Labor Camp ON
'bit 19 //OLD!!! Labor Mine ON
'bit 20 //OLD!!! Cantina ON
'bit 21 Struct 1 ON
'bit 22 Struct 2 ON
'bit 23 Struct 3 ON
'bit 24 Struct 4 ON
'bit 29 *** Reserve Levels active ***

[edit] CSV: Ship - Fleet Switch

'  bit 0 = fleet leader
'  bit 1 = in a fleet
'  NO/// bit 2 = follow ship we are escorting ///
'  bit 3 = share fuel
'  bit 4 = share ord
'  bit 5 = share repair
'  bit 6 = AUTO PILOT
'  bit 7 = recycle ship

[edit] CSV: Ship - Attack Switch

'  bit 0 = Attack all enemy races
'  bit 1 = flee all enemy races
'  bit 2 = Auto intercept enemy ships
'  Bit 3 = Auto Intercept enemy pods

[edit] CSV: Ship - Mission N1

' 0 bit = Short Range Scanner
' 1 bit = Mid Range Scanner
' 2 bit = Long Range Scanner
' 3 bit = Planetary Scanner
' 4 bit = Running Lights
' 5 bit = Auto Unload Metal
' 6 bit = D only
' 7 bit = T only
' 8 bit = M only

[edit] CSV: Ship - Attack Plan

'   bit 0 = Stay At Standoff Range
'   bit 1 = Stand At All Costs
'   bit 2 = Target Soft
'   bit 3 = Target Dangerous
'   bit 4 = Strike Through
'   bit 5 = RAM!
'   bit 6 = Delay Ship (Second Wave)
'   bit 7 = Fire At Ground Targets
'   bit 8 = Do not fire at disabled ships (clients prior to 65p)
'   bit 9 = AVOID ground base!
'   bit 10 = 
'   bit 11 = 
'   bit 12 = 
'   bit 13 = 
'   bit 14 = 
'   bit 15 = Do not fire at disabled ships (client 65p or later)
'   bit 16 = Do not fire at disabled Bases

[edit] CSV: Ship - Weapon Switches

'   bit 0 = fire ion cannon at ships with shields up
'   bit 1 = fire sand casters at enemy ships
'   bit 2 = fire sand casters at enemy fighters
'   bit 3 = hugeweapon ON

[edit] CSV: Ship - Switch1

[edit] CSV: Ship - Switch2

[edit] CSV: Ship - Switch3

[edit] CSV: Ship - Command Switch

'  0 Bit Lay Cloaked Mines
'  1 Bit Recover Mines
'  2 Bit Repeat Mine Lay
'  3 Bit Minefield Recharge

[edit] CSV: Ship - Device List 1

Most are stored as bits in these three longs:

Sflag1 As Long          '  Add-on hull goody 
Sflag2 As Long          '  Add-on hull goody 
SFlag3 As Long          '  Add-on hull goody 
'// sFlag1 
'Bit 0   Ram Scoop" 
'Bit 1   Particle Fountain" 
'Bit 2   Tachyon Emitter 
'Bit 3   Alchemy 
'Bit 4   Bioscanner 
'Bit 5   Gravitonic Mine Dropper 
'Bit 6   Barbitic Mine Dropper 
'Bit 7   Laser Mine Dropper 
'Bit 8   Web Mine Dropper 
'Bit 9   Mine Sweeper Array 
'Bit 10  Warp Chunneler 
'Bit 11  Gravitonic Accelerator 
'Bit 12  Ore Processing 
'Bit 13  Gravity Well Generator 
'Bit 14  Psi-Opps Hisser Unit 
'Bit 15  DTMS-N fuel converter 
'Bit 16  Siren HAARP 
'Bit 17  Mind Crusher 
'Bit 18  Reticulian Light Beam 
'Bit 19  Cloak 
'Bit 20  Laser Mining Drill 
'Bit 21  Global Warmer 
'Bit 22  Global Icer 
'Bit 23  Crystal Inferno Device 
'Bit 24  Spy Scanner 
'Bit 25  Glory Device 
'Bit 26  Boarding Laser 
'Bit 27  Assimilation Beam 
'Bit 28  Long Range Mine Detector 
'Bit 29  Mobile Ord Factory

[edit] CSV: Ship - Device List 2

'// sFlag2 
'Bit 0   Mobile Fighter(1) Factory 
'Bit 1   Mobile Fighter(2) Factory 
'Bit 2   Mobile Fighter(3) Factory 
'Bit 3   Scalar Wave Amp 
'Bit 4   "---" 
'Bit 5   Gambling Deck 
'Bit 6   Holodeck 
'Bit 7   Probe launcher 
'Bit 8   Clone Lab 
'Bit 9   Mobile Med Lab 
'Bit 10  Mobile Parts Plant 
'Bit 11  Agro-Dome 
'Bit 12  Soil Reformer 
'Bit 13  Scalar Wave Damper 
'Bit 14  Reticulian Med Lab 
'Bit 15  "---" 
'Bit 16  Food To Supply Converter 
'Bit 17  Fuel Robber 
'Bit 18  Cargo Grappler 
'Bit 19  Crew Abducter 
'Bit 20  Hacker Droid 
'Bit 21  Pyramid Lounge 
'Bit 22  Show Lounge 
'Bit 23  Minefield Destabilizer 
'Bit 24  Jumpgate Builder 
'Bit 25  Jumppoint Generator 
'Bit 26  Self Destruct 
'Bit 27  Ground Base Chunnel 
'Bit 28  Advanced Training 
'Bit 29  Ground Quake Trigger

[edit] CSV: Ship - Device List 3

The names of the wild card devices are now stored in the ship pack files (SPK). The 4 byte long at file location 201 points to the list of wildcard device names. The list of devices are in plain text, 6 records of 40 bytes each.

'// sFlag3 
'Bit 0   Soil Sterilizer 
'Bit 1   Recruting Center 
'Bit 2   Cloaking Field 
'Bit 3   Dust Off 
'Bit 4   Incarceration Beam 
'Bit 5   Holo Jamming Device 
'Bit 6   Warp Bubble Generater 
'Bit 7   Transport Inhibitor 
'Bit 8   Crystal X Field 
'Bit 9   Solar Gamma Ray 
'Bit 10  Nanovirus 
'Bit 11  Hull Plan Naper 
'Bit 12  Contraband Lockdown 
'Bit 13  Money Tap 
'Bit 14  Naive Dust Off 
'Bit 15  Contraband Dustoff 
'Bit 25  Wildcard 1 
 '// 111 Colonial Warrior Assault // 
 '    H111 
 '// 109 Robot Eye Of Madagon // 
 '// 110 Rebel Ground Assault // 
 '// 807 Mirvorari Gate Dial Out Device 
 '   H536 - H551 
 '// 808 Aczanny Security Device 
 '   H600 - H620 
 '// 806 Coal. Bio Computer 
 '   H516 - H525 
 '// 811 Solorian Stellar Targeter 
 '   H526 - H535   
'Bit 26  Wildcard 2 
 '// 111 Colonial Fuel Drill 
 '// H100 H101 
 '// 807 Mirvorari Parts Gate 
 '   H536 - H551 
 '// 808 Aczanny ECM Jammer 
 '   H600 - H620 
 '// 806 Coalition Rift Gen 
 '// H517 
 '// 811 Solorian Energy Transfer Beam 
 '   H526 - H535   
'Bit 27  Wildcard 3 
 '// 111 Colonial Unicom 
 '   H109   
 '// 807 Mirvorari Portable Gate 
 '   H536 - H551 
 '// 808 Aczanny Cargo Desk 
 '   H600 - H620 
 '// 811 Solorian Ragnarock Device 
 '   H526 - H535 
'Bit 28  Wildcard 4 
 '// 111 Colonial Light Speed // 
 '   H109 
 '// 807 Mirvorari Native Gate 
 '   H536 - H551 
'Bit 29  Wildcard 5 
 '// 111 Colonial GalBank // 
 '   H103 
 '// 807 Mirvorari Star Boiler 
 '   H536 - H551 
'Bit 30  Wildcard 6 
 '// 111 Colonial GalWithdraw // 
 '   H103 
 '// 807 Mirvorari Alchemy 
 '   H536 - H551

[edit] Ship: Repair / FlagFix

'  bit 0 = Damage to engines
'  bit 1 = Damage to HYPER Drive
'  bit 2 = Damage to hull
'  bit 3 = Damage to control systems
'  bit 4 = Damage to life support systems
'  bit 5 = Damage to shield generator
'  bit 6 = Damage to weapons systems
'  bit 7 = Repair Armor
'  bit 8 = Replenish Armor
'  bit 9 = Replemish Fighters

[edit] Ship: Transport Mode / transMode

'  bit 0 = hostal (Not(1) = friendly)
'  bit 1 = build fire base on planet
'  bit 2 = goto transTargetID before waypoint
'  bit 3 = Jettison cargo
'  bit 4 = Erase Plans
'  bit 5 = Transmit Plans
'  bit 6 = Receive Plans

[edit] CSV: Minefield - Flavor

'   bit 0 = Gravitonic Minefield
'   bit 1 = Barbitic Minefield
'   bit 2 = Laser Minefield
'   bit 3 = Web Minefield

[edit] Player: Exotic Tech A Switches

'Bit 0   +10 Pod Speed
'    1   +20 Pod Speed
'    2   +30 Pod Speed
'    3   20% less fuel burn
'    4   50% less fuel burn
'    5   +100 Shield Power
'    6   +300 Shield Power
'    7   +500 Shield Power
'    8   +100 Scan Range
'    9   +200 Scan Range
'    10  +300 Scan Range
'    11  +10 Attack Bonus
'    12  +20 Attack Bonus
'    13  +50 Attack Bonus
'    14  +10 Evasive Bonus
'    15  +20 Evasive Bonus
'    16  +2 Shield Drain
'    17  +5 Shield Drain
'    18  +2 Armor Drain
'    19  +5 Armor Drain
'    20  +10 Shield Drain
'    21  +25 Shield Drain
'    22  +5 Armor Drain
'    23  +10 Armor Drain

[edit] Player: Exotic Tech B Switches

' Bit 0  Ships Immune to Base Ion cannons
'     1  Self Repairing Ship Armor
'     2  Point Defense System Charge 50% Faster
'     3  World Crusher Missiles Pass Through Base Shields
'     4  10% Normal Fighter Wing Sensor Image
'     5  40% Normal Fighter Mine Sensor Image
'     6  Fighters Immune To Nemesis Torpedoes
'     7  Fighters Immune To Sand Casters
'     8  +10 Happy Your Natives (-10 Others)
'     9  Just Say No!"
'    10  Raid Colonists Homes
'    11  Poison Contraband Items
'    12  Hire Contraband Pirates
'    13  All Base Shields Fail On All Planets For 5 Turns
'    14  Zero Growth Rate All Planets
'    15  +20 Colonist Growth Rate
'    16  +50 Colonist Growth Rate
'    17  +70 Colonist Growth Rate
'    18  -5 Happiness All Planets
'    19  -10 Happiness All Planets
'    20  -20 Happiness All Planets
'    21  Super AntiFighter
'    22  Energized Sand
'    23  Fighter ECM Box

[edit] Other Data Interpretations

There are other pieces of data that are simply an index, such as 0 = No super weapon, 1 = Super Laser, 2 = Nemesis Torpedo, etc.

[edit] CSV: Base - Attack Mode

0 = Peaceful 
1 = Roaming defense 
2 = Deep Ground Patrols 
3 = Attack and Run 
4 = Crush, Kill, Destroy!
5 = Capture

[edit] CSV: Planet - state

0 = Planet
1 = Asteroid

[edit] CSV: Planet - star

1 = Brown Dwarf
2 = Neutron Star
3 = White Dwarf
4 = Blue Dwarf
5 = Binary Red
6 = Orange
7 = Orange Yellow
8 = Yellow
9 = Neutron Yellow Binary
10 = Red White
11 = Red Yellow Binary
12 = Yellow / Yellow Binary
13 = White
14 = White / Yellow Binary
15 = White / White Binary
16 = Yellow White
17 = Yellow Trinary
18 = Green
19 = Binary Green
20 = Red Giant
21 = Blue Giant

[edit] CSV: Ship - Huge Weapon

const char *super_weapon_names[] = {
  "Super Laser",           // 1
  "Nemesis Torpedo",       // 2
  "World Crusher Missile", // 3
  "Anti-Matter Maul",      // 4
  "Proto-Matter Cannon"    // 5
};

[edit] CSV: Ship - Hyper Switch

0 = OFF
1 = ON

[edit] CSV: Ship - Hyp Engine

const char *hyperdrive_names[] = {
  "Yoyodyne 88",   // 1
  "Microfold 200", // 2
  "Yoyodyne 300",  // 3
  "Keplan 450",    // 4
  "Keplan 505",    // 5
  "Keplan 660",    // 6
  "Yoyodyne 900",  // 7
  "Soleum H1000",  // 8
  "Warhop 2020",   // 9
  "Cydonia 3000"   // 10
};

[edit] CSV: Ship - Engine

const char *engine_names[] = {
  "N20 Fusion Drive",     // 1
  "N30 Fusion Drive",     // 2
  "Lasno-1 Ion Drive",    // 3
  "Lasno-2 Ion Drive",    // 4
  "R50 Mega-Fusion",      // 5
  "I-17 Impulse",         // 6
  "I-20 Impulse",         // 7
  "I-25 Impulse",         // 8
  "Electrogravitic",      // 9
  "Turbo Thruster",       // 10
  "Tylium Thruster",      // 11
  "Energy Conversion",    // 12
  "Scalar Wave Thruster", // 13
  "Lazar Drive",          // 14
  "FLT-1 Warp Drive",     // 15
  "FLT-2 Warp Drive",     // 16
  "FLT-3 Warp Drive",     // 17
  "FLT-4 Warp Drive",     // 18
  "FLT-5 Warp Drive",     // 19
  "Transwarp Drive"       // 20
};

[edit] CSV: Ship - Shield

const char *shield_names[] = {
  "Fleece-S30",      // 1
  "Crane X40",       // 2
  "Crane X80",       // 3
  "Corber 210",      // 4
  "Corber 350",      // 5
  "Corber 400",      // 6
  "Galefleck DT900", // 7
  "GS-SX 1000",      // 8
  "GX-LX 1500",      // 9
  "GS-BFS 3000"      // 10
};

[edit] CSV: Ship - Generator x

const char *generator_names[] = {
  "GF Prilldyne 10", // 1
  "GF Prilldyne 12", // 2
  "GF Prilldyne 14", // 3
  "Servodyne 600",   // 4
  "Servodyne 700",   // 5
  "Servodyne 800",   // 6
  "MicroQuad 950",   // 7
  "Firestorm 3000",  // 8
  "Tifuss KH4000",   // 9
  "GF Tokamak 8080"  // 10
};

[edit] CSV: Minefield - Command Switches

0 = Inactive (or unknow status)
1 = Active
2 = Cloaked 

[edit] Bitfields

Some of the data that ou get from the ship and race files as well as the exported CSV files from the Planets client contains condensed on/off data named bitfields. Any building structure that you can only have one of will be in a bitfield as well as whether or not a ship device is on or off.

Bitfield example using the Ship Devices by N/A from the newsgroup: Consider bit 0 to be the rightmost bit and bit 31 to be the leftmost bit. Like such:

000000000000000000000000000000­01 (binary) 
^ Bit 31                       ^ Bit 0 

If 'Sflag1' has bit 0 set (as above) then the hull has a Ram Scoop. So on for each bit in each of the fields.

Note that bits 30 and 31 aren't used in 'Sflag1' or 'Sflag2'

Bits 25-30 in 'Sflag3' are Wildcard devices (i.e. what they represent depends on which Hull you're looking at [or, maybe, it depends on the ship pack(?)- I never asked]).

Bit 31 in 'Sflag3' is currently not used (but, I presume, reserved as another 'Wildcard' device.

Personal tools