Converting from INI to JSON

Discuss the future of Warzone 2100 with us.
User avatar
Fastdeath
Trained
Trained
Posts: 115
Joined: 16 Jan 2010, 08:52

Re: Converting from INI to JSON

Post by Fastdeath »

I work with Cowboy on the SharpFlame editor.
Can we use a new filextension for JSON maps, like .wzj?

This would help splitting up code in SharpFlame.
Nightly builds available here see buildbot for more infos about them
Lobby Server: here and here
SharpFlame the new WZ Map Editor
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

I'm a bit unsure about this. It will force a compatibility break, whereas I've been changing things one file at a time, allowing people to keep both old and new formats in the same map .wz file. If I could just finish all the conversions and be done with it, it would make sense, but things are progressing at a snail's pace right now, unfortunately...
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: Converting from INI to JSON

Post by vexed »

For what it is worth, I don't think simply having a new extension fixes anything.
The file in question still must be parsed, so, there really is no advantage of a new extension.

I rather all new maps have a ini file in the base directory, with all the needed info for the map (players, author, license, version of map, version of game, description, if it wants a mod to load, and anything extra like that).
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

I got a bit stuck with my idea of using real names for unique IDs rather than the cryptic IDs that we use now. Turns out, there are a lot of real name collisions. Some of these collisions seem to uncover real bugs, and should be fixed. Others may be harder to 'fix'. Not sure if I should go back to using the otherwise useless IDs instead. I made a collision log which is pasted below. Cryptic IDs in parentheses.

Code: Select all

--------- BASE -----------
VTOL CB Radar Tower (Sys-VTOLCBTower01) in sensor.ini is also defined in sensor.ini (Sys-VTOLRadarTower01)
Machinegun (MG1Mk1) in weapons.ini is also defined in weapons.ini (TUTMG)
Lancer (CyborgRocket) in weapons.ini is also defined in weapons.ini (Rocket-LtA-T)
Flamer (CyborgFlamer01) in weapons.ini is also defined in weapons.ini (Flame1Mk1)
Missile Silo (NX-CruiseSite) in structure.ini is also defined in structure.ini (NX-ANTI-SATSite)
Machinegun Bunker (PillBox1) in structure.ini is also defined in weapons.ini (MG1-Pillbox)
Twin Machinegun Bunker (PillBox2) in structure.ini is also defined in weapons.ini (MG2-Pillbox)
Heavy Machinegun Bunker (PillBox3) in structure.ini is also defined in weapons.ini (MG3-Pillbox)
Sensor Tower (Sys-SensoTower01) in structure.ini is also defined in sensor.ini (SensorTower1Mk1)
Hardened Sensor Tower (Sys-SensoTower02) in structure.ini is also defined in sensor.ini (SensorTower2Mk1)
VTOL Radar Tower (Sys-VTOL-RadarTower01) in structure.ini is also defined in sensor.ini (Sys-VTOLRadarTower01)
Tank Traps (TankTrapC) in structure.ini is also defined in structure.ini (A0TankTrap)
Assault Gun Guard Tower (Tower-RotMg) in structure.ini is also defined in structure.ini (GuardTower-RotMg)
*Cyborg Flamer* (CybFlamer01CGrd) in body.ini is also defined in body.ini (CyborgFlamerGrd)
Heavy Gunner (CyborgCannon01Grd) in templates.ini is also defined in weapons.ini (CyborgCannon)
Lancer Cobra Half-tracks (P0CobraLtATRktHtrack) in templates.ini is also defined in templates.ini (CobraLtA-Thalftrack)
Heavy Gunner (Cyb-Cannon-GROUND) in templates.ini is also defined in weapons.ini (CyborgCannon)
Command Turret Python Tracks (P0PythonComTracks) in templates.ini is also defined in templates.ini (PythonComTracks)
Truck (ConstructorDroid) in templates.ini is also defined in construction.ini (Spade1Mk1)
Cobra Truck (CobraSpadeTracks) in templates.ini is also defined in templates.ini (P0CobraSpadeTracks)
Flamer (CyborgFlamer01Grd) in templates.ini is also defined in weapons.ini (Flame1Mk1)
Machinegunner (CyborgChain01Ground) in templates.ini is also defined in weapons.ini (CyborgChaingun)
Truck (P0cam3CobCONTrk) in templates.ini is also defined in construction.ini (Spade1Mk1)
Machinegunner (Cyb-Chain-GROUND) in templates.ini is also defined in weapons.ini (CyborgChaingun)
Machinegun Viper Wheels (ViperMG01Wheels) in templates.ini is also defined in templates.ini (ViperLtMGWheels)
Lancer (Cyb-Rocket-GROUND) in templates.ini is also defined in weapons.ini (Rocket-LtA-T)
Lancer (CyborgRkt01Ground) in templates.ini is also defined in weapons.ini (Rocket-LtA-T)
Heavy Machinegun Cobra Half-tracks (P0CobraHvyMGHtrack) in templates.ini is also defined in templates.ini (CobraHMGHalfTrack)
Truck (ConstructionDroid) in templates.ini is also defined in construction.ini (Spade1Mk1)
---------- MP ----------
VTOL CB Radar Tower (Sys-VTOLCBTower01) in sensor.ini is also defined in sensor.ini (Sys-VTOLRadarTower01)
Lancer (CyborgRocket) in weapons.ini is also defined in weapons.ini (Rocket-LtA-T)
Flamer (CyborgFlamer01) in weapons.ini is also defined in weapons.ini (Flame1Mk1)
Laser Satellite Command Post (A0LasSatCommand) in structure.ini is also defined in weapons.ini (LasSat)
Machinegun Bunker (PillBox1) in structure.ini is also defined in weapons.ini (MG1-Pillbox)
Twin Machinegun Bunker (PillBox2) in structure.ini is also defined in weapons.ini (MG2-Pillbox)
Heavy Machinegun Bunker (PillBox3) in structure.ini is also defined in weapons.ini (MG3-Pillbox)
Hardened Sensor Tower (Sys-SensoTower02) in structure.ini is also defined in sensor.ini (SensorTower2Mk1)
Tank Traps (TankTrapC) in structure.ini is also defined in structure.ini (A0TankTrap)
Cannon Fortress (X-Super-Cannon) in structure.ini is also defined in weapons.ini (CannonSuper)
Missile Fortress (X-Super-Missile) in structure.ini is also defined in weapons.ini (MissileSuper)
Heavy Rocket Bastion (X-Super-Rocket) in structure.ini is also defined in weapons.ini (RocketSuper)
Baba Jeep Body* (B2RKJeepBody) in body.ini is also defined in body.ini (B2JeepBody)
Super Scourge Cyborg (Cyb-Hvy-A-T) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-A-T)
Super Pulse Laser Cyborg (Cyb-Hvy-PulseLsr) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-PulseLsr)
Super Rail-Gunner (Cyb-Hvy-RailGunner) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-RailGunner)
Heavy Gunner (Cyb-Cannon-GROUND) in templates.ini is also defined in weapons.ini (CyborgCannon)
Truck (ConstructorDroid) in templates.ini is also defined in construction.ini (Spade1Mk1)
Super Heavy-Gunner (Cyb-Hvy-Mcannon) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-Mcannon)
Flamer (CyborgFlamer01Grd) in templates.ini is also defined in weapons.ini (Flame1Mk1)
Machinegun Viper Wheels (ViperMG01Wheels) in templates.ini is also defined in templates.ini (A-Viper-Wheels-MG)
Lancer (Cyb-Rocket-GROUND) in templates.ini is also defined in weapons.ini (Rocket-LtA-T)
Truck (ConstructionDroid) in templates.ini is also defined in construction.ini (Spade1Mk1)
Medium Cannon Python Tracks (PythonMedCnTrks) in templates.ini is also defined in templates.ini (PythonMedCanTracks)
Needle Gunner (Cyb-Rail1-GROUND) in templates.ini is also defined in templates.ini (MP-Cyb-Needle-GRD)
Heavy Gunner (CyborgCannon01Grd) in templates.ini is also defined in weapons.ini (CyborgCannon)
Heavy Cannon Python Tracks (P0PythonHvyCnTrks) in templates.ini is also defined in templates.ini (A-Python-Trk-HC)
Heavy Machinegun Cobra Tracks (A-Cobra-Trk-HMG) in templates.ini is also defined in templates.ini (CobraHMGTracks)
Lancer (CyborgRkt01Ground) in templates.ini is also defined in weapons.ini (Rocket-LtA-T)
Assault Gunner (Cyb-RotMG-GROUND) in templates.ini is also defined in templates.ini (CyborgRotMgGround)
Twin Machinegun Viper Wheels (A-Viper-Wheels-TMG) in templates.ini is also defined in templates.ini (ViperMG02Wheels)
Super Auto-Cannon Cyborg (Cyb-Hvy-Acannon) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-Acannon)
Truck (P0cam3CobCONTrk) in templates.ini is also defined in construction.ini (Spade1Mk1)
Tank Killer Python Tracks (P0cam3PyHvyATTrk) in templates.ini is also defined in templates.ini (PythonTKTracks)
Heavy Machinegun Viper Tracks (ViperHMGTracks) in templates.ini is also defined in templates.ini (A-Viper-Trk-HMG)
Heavy Machinegun Viper Wheels (ViperHMGWheels) in templates.ini is also defined in templates.ini (A-Viper-Wheels-HMG)
Flashlight Gunner (Cyb-Laser1-GROUND) in templates.ini is also defined in templates.ini (MP-Cyb-Laser1-GRD)
Heavy Cannon Python Tracks (PythonHvyCnTrks) in templates.ini is also defined in templates.ini (A-Python-Trk-HC)
Super Tank-Killer Cyborg (Cyb-Hvy-TK) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-TK)
Super HPV Cyborg (Cyb-Hvy-HPV) in templates.ini is also defined in weapons.ini (Cyb-Hvywpn-HPV)
Machinegunner (Cyb-Chain-GROUND) in templates.ini is also defined in weapons.ini (CyborgChaingun)
Heavy Cannon Python Tracks (Sk-PythonHvCanTrack) in templates.ini is also defined in templates.ini (A-Python-Trk-HC)
Machinegunner (CyborgChain01Ground) in templates.ini is also defined in weapons.ini (CyborgChaingun)
Flamer Cobra Tracks (CobraFlameTracks) in templates.ini is also defined in templates.ini (P0CobraFlameTracks)
Command Turret Python Tracks (PythonComTracks) in templates.ini is also defined in templates.ini (P0PythonComTracks)
Cobra Truck (CobraSpadeTracks) in templates.ini is also defined in templates.ini (P0CobraSpadeTracks)
Scourge (Cyb-Atmiss-GROUND) in templates.ini is also defined in templates.ini (MP-Cyb-ATmiss-GRD)
Medium Cannon Cobra Tracks (P0CobraMedCnTrks) in templates.ini is also defined in templates.ini (CobraMedCnTrks)
Lancer Cobra Half-tracks (CobraLtA-Thalftrack) in templates.ini is also defined in templates.ini (P0CobraLtATRktHtrack)
Heavy Machinegun Cobra Half-tracks (P0CobraHvyMGHtrack) in templates.ini is also defined in templates.ini (CobraHMGHalfTrack)
Incendiary Howitzer (R-Wpn-Howitzer-Incenediary) in research.ini is also defined in weapons.ini (Howitzer-Incenediary)
Incendiary Howitzer Emplacement (R-Defense-Howitzer-Incenediary) in research.ini is also defined in structure.ini (Emplacement-Howitzer-Incenediary)
Plasmite Flamer (R-Wpn-Plasmite-Flamer) in research.ini is also defined in weapons.ini (PlasmiteFlamer)
Plasmite Flamer Bunker (R-Defense-PlasmiteFlamer) in research.ini is also defined in structure.ini (Plasmite-flamer-bunker)
Incendiary Mortar (R-Wpn-Mortar-Incenediary) in research.ini is also defined in weapons.ini (Mortar-Incenediary)
Incendiary Mortar Pit (R-Defense-MortarPit-Incenediary) in research.ini is also defined in structure.ini (Emplacement-MortarPit-Incenediary)
Cyborg Transport (R-Cyborg-Transport) in research.ini is also defined in templates.ini (Transporter)
Super Transport (R-SuperTransport) in research.ini is also defined in templates.ini (SuperTransport)
Heavy Repair Turret (R-Sys-MobileRepairTurretHvy) in research.ini is also defined in repair.ini (HeavyRepair)
Research Module (R-Struc-Research-Module) in research.ini is also defined in structure.ini (A0ResearchModule1)
Mini-Rocket Pod (R-Wpn-Rocket05-MiniPod) in research.ini is also defined in weapons.ini (Rocket-Pod)
Hardcrete Gate (R-Defense-HardcreteGate) in research.ini is also defined in structure.ini (A0HardcreteMk1Gate)
Light Cannon (R-Wpn-Cannon1Mk1) in research.ini is also defined in weapons.ini (Cannon1Mk1)
Factory Module (R-Struc-Factory-Module) in research.ini is also defined in structure.ini (A0FacMod1)
Machinegun (R-Wpn-MG1Mk1) in research.ini is also defined in weapons.ini (MG1Mk1)
Twin Machinegun (R-Wpn-MG2Mk1) in research.ini is also defined in weapons.ini (MG2Mk1)
Heavy Machinegun (R-Wpn-MG3Mk1) in research.ini is also defined in weapons.ini (MG3Mk1)
Medium Cannon (R-Wpn-Cannon2Mk1) in research.ini is also defined in weapons.ini (Cannon2A-TMk1)
Mini-Rocket Array (R-Wpn-Rocket02-MRL) in research.ini is also defined in weapons.ini (Rocket-MRL)
Mortar (R-Wpn-Mortar01Lt) in research.ini is also defined in weapons.ini (Mortar1Mk1)
Flamer (R-Wpn-Flamer01Mk1) in research.ini is also defined in weapons.ini (Flame1Mk1)
Power Module (R-Struc-PowerModuleMk1) in research.ini is also defined in structure.ini (A0PowMod1)
Sensor Tower (R-Sys-Sensor-Tower01) in research.ini is also defined in structure.ini (Sys-SensoTower01)
Light Cannon Hardpoint (R-Defense-WallTower02) in research.ini is also defined in structure.ini (WallTower02)
Heavy Machinegun Hardpoint (R-Defense-WallTower01) in research.ini is also defined in structure.ini (WallTower01)
Heavy Cannon Hardpoint (R-Defense-WallTower04) in research.ini is also defined in structure.ini (WallTower04)
Medium Cannon Hardpoint (R-Defense-WallTower03) in research.ini is also defined in structure.ini (WallTower03)
Sensor Turret (R-Sys-Sensor-Turret01) in research.ini is also defined in sensor.ini (SensorTurret1Mk1)
Repair Facility (R-Struc-RepairFacility) in research.ini is also defined in structure.ini (A0RepairCentre3)
Hyper Velocity Cannon (R-Wpn-Cannon4AMk1) in research.ini is also defined in weapons.ini (Cannon4AUTOMk1)
Heavy Cannon (R-Wpn-Cannon3Mk1) in research.ini is also defined in weapons.ini (Cannon375mmMk1)
Ripple Rockets (R-Wpn-Rocket06-IDF) in research.ini is also defined in weapons.ini (Rocket-IDF)
Howitzer (R-Wpn-HowitzerMk1) in research.ini is also defined in weapons.ini (Howitzer105Mk1)
Cyborg Factory (R-Struc-Factory-Cyborg) in research.ini is also defined in structure.ini (A0CyborgFactory)
Command Turret (R-Comp-CommandTurret01) in research.ini is also defined in weapons.ini (CommandTurret1)
Tank Traps (R-Defense-TankTrap01) in research.ini is also defined in structure.ini (A0TankTrap)
Machinegun Guard Tower (R-Defense-Tower01) in research.ini is also defined in structure.ini (GuardTower1)
Mini-Rocket Tower (R-Defense-Tower06) in research.ini is also defined in structure.ini (GuardTower6)
Machinegun Bunker (R-Defense-Pillbox01) in research.ini is also defined in weapons.ini (MG1-Pillbox)
Light Cannon Bunker (R-Defense-Pillbox04) in research.ini is also defined in structure.ini (PillBox4)
Flamer Bunker (R-Defense-Pillbox05) in research.ini is also defined in structure.ini (PillBox5)
Lancer Hardpoint (R-Defense-WallTower06) in research.ini is also defined in structure.ini (WallTower06)
Lancer Tower (R-Defense-Pillbox06) in research.ini is also defined in structure.ini (GuardTower5)
Nexus Link Turret (R-Sys-SpyTurret) in research.ini is also defined in weapons.ini (SpyTurret01)
VTOL Rearming Pad (R-Struc-VTOLPad) in research.ini is also defined in structure.ini (A0VtolPad)
VTOL Factory (R-Struc-VTOLFactory) in research.ini is also defined in structure.ini (A0VTolFactory1)
Assault Cannon (R-Wpn-Cannon5) in research.ini is also defined in weapons.ini (Cannon5VulcanMk1)
AA Flak Cannon (R-Wpn-AAGun02) in research.ini is also defined in weapons.ini (AAGun2Mk1)
Assault Gun (R-Wpn-MG4) in research.ini is also defined in weapons.ini (MG4ROTARYMk1)
Hurricane AA Turret (R-Wpn-AAGun03) in research.ini is also defined in weapons.ini (QuadMg1AAGun)
Whirlwind AA Turret (R-Wpn-AAGun04) in research.ini is also defined in weapons.ini (QuadRotAAGun)
Pulse Laser (R-Wpn-Laser02) in research.ini is also defined in weapons.ini (Laser2PULSEMk1)
Scourge Missile (R-Wpn-Missile2A-T) in research.ini is also defined in weapons.ini (Missile-A-T)
Needle Gun (R-Wpn-RailGun01) in research.ini is also defined in weapons.ini (RailGun1Mk1)
Rail Gun (R-Wpn-RailGun02) in research.ini is also defined in weapons.ini (RailGun2Mk1)
Gauss Cannon (R-Wpn-RailGun03) in research.ini is also defined in weapons.ini (RailGun3Mk1)
AA Flak Cannon Emplacement (R-Defense-AASite-QuadBof) in research.ini is also defined in structure.ini (AASite-QuadBof)
Hurricane AA Site (R-Defense-AASite-QuadMg1) in research.ini is also defined in structure.ini (AASite-QuadMg1)
Whirlwind AA Site (R-Defense-AASite-QuadRotMg) in research.ini is also defined in structure.ini (AASite-QuadRotMg)
Flashlight Emplacement (R-Defense-PrisLas) in research.ini is also defined in structure.ini (Emplacement-PrisLas)
Hellstorm Emplacement (R-Defense-RotHow) in research.ini is also defined in structure.ini (Emplacement-RotHow)
Pepperpot Pit (R-Defense-RotMor) in research.ini is also defined in structure.ini (Emplacement-RotMor)
Scourge Missile Tower (R-Defense-GuardTower-ATMiss) in research.ini is also defined in structure.ini (GuardTower-ATMiss)
Needle Gun Tower (R-Defense-GuardTower-Rail1) in research.ini is also defined in structure.ini (GuardTower-Rail1)
Howitzer Emplacement (R-Defense-Howitzer) in research.ini is also defined in structure.ini (Emplacement-Howitzer105)
Mortar Pit (R-Defense-MortarPit) in research.ini is also defined in structure.ini (Emplacement-MortarPit01)
Assault Gun Hardpoint (R-Defense-Wall-RotMg) in research.ini is also defined in structure.ini (Wall-RotMg)
Assault Cannon Hardpoint (R-Defense-Wall-VulcanCan) in research.ini is also defined in structure.ini (Wall-VulcanCan)
Pulse Laser Hardpoint (R-Defense-WallTower-PulseLas) in research.ini is also defined in structure.ini (WallTower-PulseLas)
Rail Gun Hardpoint (R-Defense-WallTower-Rail2) in research.ini is also defined in structure.ini (WallTower-Rail2)
Hardened Sensor Tower (R-Sys-Sensor-Tower02) in research.ini is also defined in sensor.ini (SensorTower2Mk1)
Sunburst AA Site (R-Defense-Sunburst) in research.ini is also defined in structure.ini (P0-AASite-Sunburst)
Inferno Bunker (R-Defense-HvyFlamer) in research.ini is also defined in structure.ini (Tower-Projector)
Avenger SAM Site (R-Defense-SamSite1) in research.ini is also defined in structure.ini (P0-AASite-SAM1)
Vindicator SAM Site (R-Defense-SamSite2) in research.ini is also defined in structure.ini (P0-AASite-SAM2)
Ground Shaker Emplacement (R-Defense-HvyHowitzer) in research.ini is also defined in structure.ini (Emplacement-Howitzer150)
Mini-Rocket Battery (R-Defense-MRL) in research.ini is also defined in structure.ini (Emplacement-MRL-pit)
Rotary MG Bunker (R-Defense-RotMG) in research.ini is also defined in structure.ini (Pillbox-RotMG)
Bombard Pit (R-Defense-HvyMor) in research.ini is also defined in structure.ini (Emplacement-MortarPit02)
Ripple Rocket Battery (R-Defense-IDFRocket) in research.ini is also defined in structure.ini (Emplacement-Rocket06-IDF)
Tank Killer Emplacement (R-Defense-HvyA-Trocket) in research.ini is also defined in structure.ini (Emplacement-HvyATrocket)
Hyper Velocity Cannon Emplacement (R-Defense-Emplacement-HPVcannon) in research.ini is also defined in structure.ini (Emplacement-HPVcannon)
Pulse Laser Tower (R-Defense-PulseLas) in research.ini is also defined in structure.ini (GuardTower-BeamLas)
Gauss Cannon Emplacement (R-Defense-Rail3) in research.ini is also defined in structure.ini (Emplacement-Rail3)
Seraph Missile Battery (R-Defense-MdArtMissile) in research.ini is also defined in structure.ini (Emplacement-MdART-pit)
Tank Killer Hardpoint (R-Defense-WallTower-HvyA-Trocket) in research.ini is also defined in structure.ini (WallTower-HvATrocket)
Hyper Velocity Cannon Hardpoint (R-Defense-WallTower-HPVcannon) in research.ini is also defined in structure.ini (WallTower-HPVcannon)
Scourge Missile Hardpoint (R-Defense-WallTower-A-Tmiss) in research.ini is also defined in structure.ini (WallTower-Atmiss)
CB Tower (R-Sys-CBSensor-Tower01) in research.ini is also defined in structure.ini (Sys-CB-Tower01)
VTOL CB Tower (R-Sys-VTOLCBS-Tower01) in research.ini is also defined in structure.ini (Sys-VTOL-CB-Tower01)
VTOL Strike Turret (R-Sys-VTOLStrike-Turret01) in research.ini is also defined in sensor.ini (Sys-VstrikeTurret01)
VTOL Strike Tower (R-Sys-VTOLStrike-Tower01) in research.ini is also defined in structure.ini (Sys-VTOL-RadarTower01)
Gauss Cannon Hardpoint (R-Defense-WallTower-Rail3) in research.ini is also defined in structure.ini (WallTower-Rail3)
Super HPV Cyborg (R-Cyborg-Hvywpn-HPV) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-HPV)
Mass Driver Fortress (R-Defense-MassDriver) in research.ini is also defined in structure.ini (X-Super-MassDriver)
Cannon Fortress (R-Defense-Super-Cannon) in research.ini is also defined in weapons.ini (CannonSuper)
Avenger SAM (R-Wpn-Missile-LtSAM) in research.ini is also defined in weapons.ini (Missile-LtSAM)
Vindicator SAM (R-Wpn-Missile-HvSAM) in research.ini is also defined in weapons.ini (Missile-HvySAM)
Seraph Missile Array (R-Wpn-MdArtMissile) in research.ini is also defined in weapons.ini (Missile-MdArt)
Archangel Missile (R-Wpn-HvArtMissile) in research.ini is also defined in weapons.ini (Missile-HvyArt)
Super Heavy-Gunner (R-Cyborg-Hvywpn-Mcannon) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-Mcannon)
Super Auto-Cannon Cyborg (R-Cyborg-Hvywpn-Acannon) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-Acannon)
Super Tank-Killer Cyborg (R-Cyborg-Hvywpn-TK) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-TK)
Twin Assault Cannon (R-Wpn-Cannon6TwinAslt) in research.ini is also defined in weapons.ini (Cannon6TwinAslt)
Twin Assault Cannon Bunker (R-Defense-Cannon6) in research.ini is also defined in structure.ini (PillBox-Cannon6)
Heavy Laser (R-Wpn-HvyLaser) in research.ini is also defined in weapons.ini (HeavyLaser)
Heavy Laser Emplacement (R-Defense-HeavyLas) in research.ini is also defined in structure.ini (Emplacement-HeavyLaser)
Wide Spectrum Sensor Tower (R-Sys-Sensor-WSTower) in research.ini is also defined in structure.ini (Sys-SensoTowerWS)
Satellite Uplink Center (R-Sys-Sensor-UpLink) in research.ini is also defined in structure.ini (A0Sat-linkCentre)
Laser Satellite Command Post (R-Wpn-LasSat) in research.ini is also defined in weapons.ini (LasSat)
Plasma Cannon (R-Wpn-PlasmaCannon) in research.ini is also defined in weapons.ini (Laser4-PlasmaCannon)
Super Pulse Laser Cyborg (R-Cyborg-Hvywpn-PulseLsr) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-PulseLsr)
Super Rail-Gunner (R-Cyborg-Hvywpn-RailGunner) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-RailGunner)
Super Scourge Cyborg (R-Cyborg-Hvywpn-A-T) in research.ini is also defined in weapons.ini (Cyb-Hvywpn-A-T)
Nexus Link Tower (R-Sys-SpyTower) in research.ini is also defined in structure.ini (Sys-SpyTower)
Plasma Cannon Emplacement (R-Defense-PlasmaCannon) in research.ini is also defined in structure.ini (Emplacement-PlasmaCannon)
EMP Cannon Tower (R-Defense-EMPCannon) in research.ini is also defined in structure.ini (WallTower-EMP)
Heavy Rocket Bastion (R-Defense-Super-Rocket) in research.ini is also defined in weapons.ini (RocketSuper)
Missile Fortress (R-Defense-Super-Missile) in research.ini is also defined in weapons.ini (MissileSuper)
EMP Mortar (R-Wpn-MortarEMP) in research.ini is also defined in weapons.ini (MortarEMP)
Stormbringer AA Laser (R-Wpn-AALaser) in research.ini is also defined in weapons.ini (AAGunLaser)
Stormbringer Emplacement (R-Defense-AA-Laser) in research.ini is also defined in structure.ini (P0-AASite-Laser)
EMP Mortar Pit (R-Defense-EMPMortar) in research.ini is also defined in structure.ini (Emplacement-MortarEMP)
Vindicator Hardpoint (R-Defense-WallTower-SamHvy) in research.ini is also defined in structure.ini (WallTower-SamHvy)
Whirlwind Hardpoint (R-Defense-WallTower-QuadRotAA) in research.ini is also defined in structure.ini (WallTower-QuadRotAAGun)
Wide Spectrum Sensor (R-Sys-Sensor-WS) in research.ini is also defined in sensor.ini (Sensor-WideSpec)
EMP Cannon (R-Wpn-EMPCannon) in research.ini is also defined in weapons.ini (EMP-Cannon)
AA Flak Cannon Hardpoint (R-Defense-WallTower-DoubleAAgun) in research.ini is also defined in structure.ini (WallTower-DoubleAAGun)
Avenger Hardpoint (R-Defense-WallTower-SamSite) in research.ini is also defined in structure.ini (WallTower-SamSite)
Twin Assault Gun (R-Wpn-MG5) in research.ini is also defined in weapons.ini (MG5TWINROTARY)
Twin Assault Gun Hardpoint (R-Defense-WallTower-TwinAGun) in research.ini is also defined in structure.ini (WallTower-TwinAssaultGun)
Radar Detector (R-Sys-RadarDetector01) in research.ini is also defined in sensor.ini (RadarDetector)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Converting from INI to JSON

Post by NoQ »

Lancer Cyborg's weapon can be renamed to "Cyborg Lancer" in contrast with standard tank "Lancer" and in consistency with "VTOL Lancer". And we need a special lancer variation for a bunker, we can call it "Bunker Lancer".

Most of the structure-specific weapons can be removed; probably only "Bunker Heavy Machinegun" and "Bunker Heavy Assault Gun" deserve it for skirmish, campaign also adds "Bunker Twin Machinegun". Yeah, and lassat.

The special sort of sensor for Hardened Sensor Tower could probably be renamed to "Hardened Sensor" or something like that; nobody cares actually.

Campaign-specific templates (eg. P0CobraSpadeTracks) should probably be cleaned up. After rewriting campaign in JS, we won't need any templates.ini at all. But since we want to solve it before rewriting campaign in JS, we can see if these templates are actually used in .slo/.vlo files and adjust these files to mention only one template of each kind. Same applies to Nexus/Semperfi AI scripts.

So i guess the only thing we need to sort out is research vs. weapon name collisions, right? :hmm:

By the way, do we really need to keep IDs unique, even across different json dictionaries?

Maybe add special tags into IDs, that would be auto-cropped before displaying (eg. "r_Flamer" and "w_Flamer" are both displayed as "Flamer" in-game)?

Or just rename "Flamer" technology to "Flamer Technology" :?
User avatar
Hesterax
Trained
Trained
Posts: 282
Joined: 11 Jan 2014, 13:32

Re: Converting from INI to JSON

Post by Hesterax »

NoQ wrote:Lancer Cyborg's weapon can be renamed to "Cyborg Lancer" in contrast with standard tank "Lancer" and in consistency with "VTOL Lancer". And we need a special lancer variation for a bunker, we can call it "Bunker Lancer".

Most of the structure-specific weapons can be removed; probably only "Bunker Heavy Machinegun" and "Bunker Heavy Assault Gun" deserve it for skirmish, campaign also adds "Bunker Twin Machinegun". Yeah, and lassat.

The special sort of sensor for Hardened Sensor Tower could probably be renamed to "Hardened Sensor" or something like that; nobody cares actually.

Campaign-specific templates (eg. P0CobraSpadeTracks) should probably be cleaned up. After rewriting campaign in JS, we won't need any templates.ini at all. But since we want to solve it before rewriting campaign in JS, we can see if these templates are actually used in .slo/.vlo files and adjust these files to mention only one template of each kind. Same applies to Nexus/Semperfi AI scripts.

So i guess the only thing we need to sort out is research vs. weapon name collisions, right? :hmm:

By the way, do we really need to keep IDs unique, even across different json dictionaries?

Maybe add special tags into IDs, that would be auto-cropped before displaying (eg. "r_Flamer" and "w_Flamer" are both displayed as "Flamer" in-game)?

Or just rename "Flamer" technology to "Flamer Technology" :?
The current "specific" naming can sound awkward in some cases but I think that most players are used to the naming scheme. The only ones that really need improvement are in the vehicle naming system which is almost impossible to change (I mean thinking of a better naming scheme would turn out to be extremely hard due to the large variety of units that could be possibly made). :|
Holocaust and Genocide, both linked to Mass Slaughter.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Converting from INI to JSON

Post by NoQ »

"Flamer Technology"
Or "Flamer Turret".
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

NoQ wrote:By the way, do we really need to keep IDs unique, even across different json dictionaries?
Good point. We don't really need that, except that component names need to be unique, since we have eg enableComponent(component, player) now that only takes a name (ID) and no type.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

Ok, I'm back on this work. I've given up on using proper names as unique indices, it was just too much work, and this is blocking everything else I want to do. So maybe I'll do that later.

However, a new problem arises. The messages are converted to INI format, and they are translated using _() gettext notations. I haven't thought about gettext markings yet. How to do that with JSON?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

Having been doing a bit of googling on the subject, it seems that there are no good ways to run gettext directly on JSON files. However, there exists tools that can transform multiple JSON files, each with content in a different language, into new gettext PO files, which can then be merged with existing PO files. I think this will do the job.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

Conversion to JSON is mostly done now. Implemented the JSON handling using Qt5, so basically solved two issues in one big changeset. The results are in the https://github.com/Warzone2100/warzone2 ... qt5andjson branch.

I did change the research results a bit, as I found a much nicer way to do it. The results value now contains an an array of JSON objects with the following mandatory values: class, parameter, and value. 'class' is the upgrade category (eg 'Weapon' or 'Building'), 'parameter' is the ability to change (eg 'Range'), while 'value' is the increase in percentage. Optional values are 'filterParameter' and 'filterValue' that narrow which entities to change down to matching parameter and value pairs only. So each result item is now as follows:

Code: Select all

"results": [
            {
                "class": "Body",
                "filterParameter": "BodyClass",
                "filterValue": "Cyborgs",
                "parameter": "Thermal",
                "value": 45
            }
        ],
The javascript code interpreting these became quite simple (at least in lines of code):

Code: Select all

function eventResearched(research, structure, player)
{
   for (var i = 0; i < research.results.length; i++)    // iterate over all results
   {
      var v = research.results[i];
      for (var cname in Upgrades[player][v['class']]) // iterate over all components of this type
      {
         var parameter = v['parameter'];
         var ctype = v['class'];
         var filterparam = v['filterParameter'];
         if ('filterParameter' in v && Stats[ctype][cname][filterparam] != v['filterValue']) // more specific filter
         {
            continue;
         }
         if (Stats[ctype][cname][parameter] > 0) // only applies if stat has above zero value already
         {
            Upgrades[player][ctype][cname][parameter] += Math.ceil(Stats[ctype][cname][parameter] * v['value'] / 100);
         }
      }
   }
}
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Converting from INI to JSON

Post by Goth Zagog-Thou »

Didn't know about this until last night. Looks yummy ... really yummy.

NoQ and I were discussing it a bit in the Contingency thread. And if what I see in the above code is what I think I'm seeing, thank you for the early Seasonal Gift. /happydance

How far will the dynamic loading of (and access to) the stats go with using JSON? And will it be possible to generate additional stats at runtime via script? If not that's fine, I'm asking more about capability than anything else. :)

As above, I worry about breaking compatibility with existing maps/tools, but I'm sure that can be sorted out. It's QT, JS and JSON .. nothing that can't be worked through.

At any rate, nicely done, Per. I'll help out however I'm able to.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Converting from INI to JSON

Post by Per »

Goth Zagog-Thou wrote:How far will the dynamic loading of (and access to) the stats go with using JSON? And will it be possible to generate additional stats at runtime via script? If not that's fine, I'm asking more about capability than anything else. :)
Not currently possible to generate additional stats at runtime, but that should not bee too hard to add with the new framework, and is something I would like to add eventually.

(Let me know when it starts being an issue, and I'll bump it up my priority list.)
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Converting from INI to JSON

Post by Goth Zagog-Thou »

Thanks Per. You're a gentleman and a scholar.

And I promise I won't tell anyone. :lol2:
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Converting from INI to JSON

Post by crab_ »

Hello per
May I ask you to implement more correct names of cyborgs weapons.
Currently it is uncomfortably when we see something like "*CyborgRotMG*".
I suggest to set correct names for all cyborgs weapons. These weapons listed here: http://betaguide.wz2100.net/weapons.php#cyborg_weapons

btw, I plan add links from cyborgs weapons to cyborgs templates in my Wz Guide.


[upd]
Since we are changing format of stats, i suggest to do some renaming
research.json: results -> effects

"results" and "resultComponents" are sound similar.
Warzone2100 Guide - http://betaguide.wz2100.net/
Post Reply