Warzone2100 / warzone2100

Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
https://wz2100.net
GNU General Public License v2.0
3.2k stars 531 forks source link

Conflicting Data (Single Player vs Multiplayer) #1936

Closed jasonkhanlar closed 2 years ago

jasonkhanlar commented 3 years ago

Describe the bug This is not really a bug. It's more a question of concern.

To Reproduce See additional context for details

Expected behavior Duplicate redundant data should be (or graphically/visually appear) the same in single player and multiplayer, but there seem to be some differences

Additional context Here are a coupl examples of differences I have noticed:

  1. 
    # cd data/mp
    # for i in $(find ./components/ ./effects/ ./structs/ -type f);do cmp $i ../base/$i;done

./components/prop/prslvtl1.pie ../base/./components/prop/prslvtl1.pie differ: byte 5, line 1 ./components/prop/prsrvtl1.pie ../base/./components/prop/prsrvtl1.pie differ: byte 5, line 1 ./components/bodies/drtrans.pie ../base/./components/bodies/drtrans.pie differ: byte 83, line 6


2. (note: this is **horrible** and slow, but it's easy placing the script in a single message to identify the minor JSON object differences, otherwise previously I found this useful: https://www.npmjs.com/package/lodash.isequal)
```bash
# cd data/mp
# for file in $(find ./ -iname "*.json");do if [ -f ../base/$file -a "$file" != "./ruleset.json" ];then echo $file;while read -r json1;do obj1=$(echo $json1|sed 's|^"\([^"]*\)".*|\1|');while read -r json2;do obj2=$(echo $json2|sed 's|^"\([^"]*\)".*|\1|');if [ "$obj1" = "$obj2" -a "$json1" != "$json2" ];then echo Object $obj1;fi;done < <(sed -n '/^\t"[^"]*": {$/{:start /}/!{N;b start};/^\t"[^"]*": {\n.*\n\t},\?$/p}' ../base/$file|tr -d '\n'|sed 's|,\t"|,\n"|g'|tr -d '\t');done < <(sed -n '/^\t"[^"]*": {$/{:start /}/!{N;b start};/^\t"[^"]*": {\n.*\n\t},\?$/p}' $file|tr -d '\n'|sed 's|,\t"|,\n"|g'|tr -d '\t');echo;fi;done

//((((The output returned from this showing all the minor differences is too long to post here in full, but here is a sample from a few files that have a few differences))))

./messages/resmessagesall.json
Object RES_SY_SU1
  mp JSON: "RES_SY_SU1": {"id": "RES_SY_SU1","imdName": "MICAPSUL.PIE","sequenceName": "res_systech.ogg","text": ["Sensors Improved","New Thermal Emissions detection","Sensor Range +25%","All sensors upgraded automatically"]},
base JSON: "RES_SY_SU1": {"id": "RES_SY_SU1","imdName": "MICAPSUL.PIE","sequenceName": "res_systech.ogg","text": ["Sensors Improved","New Thermal Emissions detection","Extends Sensor Range","All sensors upgraded automatically"]},
Object RES_W_CNAC2
  mp JSON: "RES_W_CNAC2": {"id": "RES_W_CNAC2","imdName": "MICAPSUL.PIE","sequenceName": "res_weapons.ogg","text": ["Cannon Upgrade","Laser designator paints and guides rounds to the target","Cannon accuracy +10%","All cannons upgraded automatically"]},
base JSON: "RES_W_CNAC2": {"id": "RES_W_CNAC2","imdName": "MICAPSUL.PIE","sequenceName": "res_weapons.ogg","text": ["Cannon Upgrade","Laser designator paints and guides rounds to the target","Increases Cannon accuracy","All cannons upgraded automatically"]},

./stats/propulsiontype.json
Object Hover
  mp JSON: "Hover": {"flightName": "GROUND","multiplier": 100},
base JSON: "Hover": {"flightName": "GROUND","multiplier": 120},
Object Lift
  mp JSON: "Lift": {"flightName": "AIR","multiplier": 140},
base JSON: "Lift": {"flightName": "AIR","multiplier": 130},

./stats/sensor.json
Object CCSensor
  mp JSON: "CCSensor": {"buildPoints": 1,"buildPower": 1,"hitpoints": 200,"id": "CCSensor","location": "TURRET","mountModel": "TRLSNSR1.PIE","name": "*CC Sensor*","power": 1000,"range": 2304,"sensorModel": "misensor.PIE","type": "STANDARD","weight": 1},
base JSON: "CCSensor": {"buildPoints": 1,"buildPower": 1,"hitpoints": 200,"id": "CCSensor","location": "TURRET","mountModel": "TRLSNSR1.PIE","name": "*CC Sensor*","power": 1000,"range": 2048,"sensorModel": "misensor.PIE","type": "STANDARD","weight": 1},
Object DefaultSensor1Mk1
  mp JSON: "DefaultSensor1Mk1": {"id": "DefaultSensor1Mk1","droidType": "DROID_SENSOR","location": "DEFAULT","name": "*Default Sensor*","power": 500,"range": 1024,"type": "STANDARD"},
base JSON: "DefaultSensor1Mk1": {"id": "DefaultSensor1Mk1","location": "DEFAULT","name": "*Default Sensor1 Mk1*","power": 500,"range": 1024,"type": "STANDARD"},
Object NavGunSensor
  mp JSON: "NavGunSensor": {"id": "NavGunSensor","location": "DEFAULT","name": "*Nexus Sensor*","power": 500,"range": 2048,"type": "STANDARD"},
base JSON: "NavGunSensor": {"id": "NavGunSensor","location": "DEFAULT","name": "*NavGunSensor*","power": 500,"range": 2048,"type": "STANDARD"},
Object UplinkSensor
  mp JSON: "UplinkSensor": {"buildPoints": 1,"buildPower": 1,"hitpoints": 200,"id": "UplinkSensor","location": "TURRET","mountModel": "TRLSNSR1.PIE","name": "Uplink Sensor","power": 1000,"range": 2304,"sensorModel": "miupdish.PIE","type": "SUPER","weight": 1},
base JSON: "UplinkSensor": {"buildPoints": 1,"buildPower": 1,"hitpoints": 200,"id": "UplinkSensor","location": "TURRET","mountModel": "TRLSNSR1.PIE","name": "Uplink Sensor","power": 1000,"range": 2048,"sensorModel": "miupdish.PIE","type": "STANDARD","weight": 1},

./stats/ecm.json
Object RepairCentre
  mp JSON: "RepairCentre": {"id": "RepairCentre","location": "TURRET","name": "Repair Center Turret","sensorModel": "GNHREPAR.PIE"},
base JSON: "RepairCentre": {"id": "RepairCentre","location": "TURRET","name": "*RepairCenter*","sensorModel": "GNHREPAR.PIE"},

./stats/propulsion.json
Object CyborgLegs
  mp JSON: "CyborgLegs": {"buildPoints": 50,"buildPower": 10,"deceleration": 450,"hitpointPctOfBody": 50,"id": "CyborgLegs","name": "Cyborg Propulsion","speed": 400,"spinAngle": 45,"spinSpeed": 450,"turnSpeed": 225,"type": "Legged","weight": 50},
base JSON: "CyborgLegs": {"buildPoints": 50,"buildPower": 10,"deceleration": 450,"hitpointPctOfBody": 50,"id": "CyborgLegs","name": "Cyborg Propulsion","speed": 400,"spinAngle": 45,"spinSpeed": 450,"turnSpeed": 225,"type": "Legged","weight": 100},
Object ZNULLPROP
  mp JSON: "ZNULLPROP": {"id": "ZNULLPROP","model": "MIBNKDRL.PIE","name": "ZNULLPROP","type": "Wheeled"},
base JSON: "ZNULLPROP": {"id": "ZNULLPROP","model": "MIBNKDRL.PIE","name": "Z NULL PROP","type": "Wheeled"},
Object hover01
  mp JSON: "hover01": {"buildPoints": 100,"buildPower": 150,"designable": 1,"hitpointPctOfBody": 100,"id": "hover01","model": "PRLHOV1.PIE","name": "Hover","skidDeceleration": 120,"speed": 300,"type": "Hover","weight": 200},
base JSON: "hover01": {"buildPoints": 100,"buildPower": 100,"designable": 1,"hitpointPctOfBody": 150,"id": "hover01","model": "PRLHOV1.PIE","name": "Hover","skidDeceleration": 120,"speed": 200,"type": "Hover","weight": 200},
Object tracked01
  mp JSON: "tracked01": {"buildPoints": 125,"buildPower": 125,"designable": 1,"hitpointPctOfBody": 300,"id": "tracked01","model": "PRLRTRK1.PIE","name": "Tracks","speed": 125,"spinAngle": 45,"type": "Tracked","weight": 650},
base JSON: "tracked01": {"buildPoints": 125,"buildPower": 125,"designable": 1,"hitpointPctOfBody": 400,"id": "tracked01","model": "PRLRTRK1.PIE","name": "Tracks","speed": 125,"spinAngle": 45,"type": "Tracked","weight": 650},

./stats/construction.json
Object Spade1Mk1
  mp JSON: "Spade1Mk1": {"buildPoints": 85,"buildPower": 17,"constructPoints": 8,"designable": 1,"droidType": "DROID_CONSTRUCT","hitpoints": 25,"id": "Spade1Mk1","name": "Truck","sensorModel": "TRLCON.PIE","weight": 800},
base JSON: "Spade1Mk1": {"buildPoints": 85,"buildPower": 17,"constructPoints": 10,"designable": 1,"droidType": "DROID_CONSTRUCT","hitpoints": 80,"id": "Spade1Mk1","name": "Truck","sensorModel": "TRLCON.PIE","weight": 600},

./stats/body.json
Object B1BaBaPerson01
  mp JSON: "B1BaBaPerson01": {"armourHeat": 1,"armourKinetic": 1,"buildPoints": 20,"buildPower": 1,"class": "Babas","droidType": "PERSON","hitpoints": 29,"id": "B1BaBaPerson01","model": "exbloke.pie","name": "*BaBa Body*","powerOutput": 125,"size": "LIGHT","weaponSlots": 1,"weight": 100},
base JSON: "B1BaBaPerson01": {"armourHeat": 1,"armourKinetic": 1,"buildPoints": 20,"buildPower": 1,"droidType": "PERSON","hitpoints": 29,"id": "B1BaBaPerson01","model": "exbloke.pie","name": "*BaBa Body*","powerOutput": 125,"size": "LIGHT","weaponSlots": 1,"weight": 100},
Object B2JeepBody
  mp JSON: "B2JeepBody": {"armourHeat": 1,"armourKinetic": 4,"buildPoints": 75,"buildPower": 4,"class": "Babas","hitpoints": 120,"id": "B2JeepBody","model": "exjeep.pie","name": "*Baba Jeep Body*","powerOutput": 2200,"size": "LIGHT","weaponSlots": 1,"weight": 900},
base JSON: "B2JeepBody": {"armourHeat": 1,"armourKinetic": 4,"buildPoints": 75,"buildPower": 4,"class": "Babas","hitpoints": 120,"id": "B2JeepBody","model": "exjeep.pie","name": "*Jeep Body*","powerOutput": 2200,"size": "LIGHT","weaponSlots": 1,"weight": 900},
Object B2RKJeepBody
  mp JSON: "B2RKJeepBody": {"armourHeat": 1,"armourKinetic": 4,"buildPoints": 75,"buildPower": 4,"class": "Babas","hitpoints": 120,"id": "B2RKJeepBody","model": "exjeeprk.pie","name": "*Baba Jeep Body*","powerOutput": 2200,"size": "LIGHT","weaponSlots": 1,"weight": 900},
base JSON: "B2RKJeepBody": {"armourHeat": 1,"armourKinetic": 4,"buildPoints": 75,"buildPower": 4,"class": "Babas","hitpoints": 120,"id": "B2RKJeepBody","model": "exjeeprk.pie","name": "*Rocket Jeep Body*","powerOutput": 2200,"size": "LIGHT","weaponSlots": 1,"weight": 900},
Object CyborgLightBody
  mp JSON: "CyborgLightBody": {"armourHeat": 6,"armourKinetic": 12,"buildPoints": 95,"buildPower": 25,"class": "Cyborgs","droidType": "CYBORG","hitpoints": 200,"id": "CyborgLightBody","model": "cybd_std.pie","name": "Cyborg Light Body","powerOutput": 500,"size": "LIGHT","weaponSlots": 1,"weight": 150},
base JSON: "CyborgLightBody": {"armourHeat": 6,"armourKinetic": 12,"buildPoints": 115,"buildPower": 25,"class": "Cyborgs","droidType": "CYBORG","hitpoints": 200,"id": "CyborgLightBody","model": "cybd_std.pie","name": "Cyborg Light Body","powerOutput": 500,"size": "LIGHT","weaponSlots": 1,"weight": 150},

./stats/repair.json
Object LightRepair1
  mp JSON: "LightRepair1": {"buildPoints": 250,"buildPower": 50,"designable": 1,"droidType": "DROID_REPAIR","id": "LightRepair1","location": "TURRET","model": "GNMREPAR.PIE","mountModel": "TRMECM1.PIE","name": "Repair Turret","repairPoints": 15,"time": 7,"weight": 800},
base JSON: "LightRepair1": {"buildPoints": 250,"buildPower": 50,"designable": 1,"droidType": "DROID_REPAIR","hitpoints": 100,"id": "LightRepair1","location": "TURRET","model": "GNMREPAR.PIE","mountModel": "TRMECM1.PIE","name": "Repair Turret","repairPoints": 15,"time": 7,"weight": 800},

Summary:

In ./messages/resmessagesall.json Object RES_SY_SU1 has 2 different descriptions: "Sensor Range +25%" "Extends Sensor Range"

In ./messages/resmessagesall.json Object RES_W_CNAC2 has 2 different descriptions: "Cannon accuracy +10%" "Increases Cannon accuracy"

In ./stats/propulsiontype.json Object Hover has 2 different multiplier values 100 120

In ./stats/propulsiontype.json Object Lift has 2 different multiplier values 140 130

In ./stats/sensor.json Object CCSensor has 2 different ranges 2304 2048

In ./stats/sensor.json Object DefaultSensor1Mk1 is missing "droidType" parameter and has 2 different names "*Default Sensor*" "*Default Sensor1 Mk1*"

In ./stats/sensor.json Object NavGunSensor has 2 different names "*Nexus Sensor*" "*NavGunSensor*"

In ./stats/sensor.json Object UplinkSensor has 2 different ranges 2304 2048

etcetera

vaut commented 3 years ago

Run this experiment on an older version. The result will probably surprise you a lot. MP balance has nothing to do with campaign balance. They have tried to keep the campaign in its original state since the 199s. The only major campaign rebalance I know was made this year. Before him, even the classes of weapons were different.

Chewbakka-Wakka commented 3 years ago

Having different values for Solo VS MP is not a problem I'd have thought, but is this showing different values within MP exclusively?

KJeff01 commented 2 years ago

Closing as multiplayer and campaign just have different stats.