t2-demo-parser 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"DataBlockParsers.d.ts","sourceRoot":"","sources":["../src/DataBlockParsers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA0uExD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CA2NtE"}
1
+ {"version":3,"file":"DataBlockParsers.d.ts","sourceRoot":"","sources":["../src/DataBlockParsers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAkvExD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CA2NtE"}
@@ -440,23 +440,25 @@ function playerDataUnpack(bs) {
440
440
  splashEmitters.push(readDataBlockRef(bs));
441
441
  }
442
442
  result.splashEmitters = splashEmitters;
443
- // 17. 11× F32 for ground impact shake (offsets 0x3fc-0x424)
444
- // V12 has 9 fields; binary has 11 (2 extra Tribes 2-specific)
445
- result.groundImpactMinSpeed = bs.readF32(); // 0x3fc
443
+ // 17. 11× F32 (offsets 0x3fc-0x424). Names binary-verified against
444
+ // initPersistFields: the two leading fields are the Tribes 2 heat
445
+ // signature rates (retail player.cs: 1/4 and 1/3), then the ground
446
+ // impact shake block. Demo values confirm: 0.25, 0.333…
447
+ result.heatDecayPerSec = bs.readF32(); // 0x3fc
448
+ result.heatIncreasePerSec = bs.readF32(); // 0x400
449
+ result.groundImpactMinSpeed = bs.readF32(); // 0x404
446
450
  result.groundImpactShakeFreq = {
447
- x: bs.readF32(), // 0x400
448
- y: bs.readF32(), // 0x404
449
- z: bs.readF32(), // 0x408
451
+ x: bs.readF32(), // 0x408
452
+ y: bs.readF32(), // 0x40c
453
+ z: bs.readF32(), // 0x410
450
454
  };
451
455
  result.groundImpactShakeAmp = {
452
- x: bs.readF32(), // 0x40c
453
- y: bs.readF32(), // 0x410
454
- z: bs.readF32(), // 0x414
456
+ x: bs.readF32(), // 0x414
457
+ y: bs.readF32(), // 0x418
458
+ z: bs.readF32(), // 0x41c
455
459
  };
456
- result.groundImpactShakeDuration = bs.readF32(); // 0x418
457
- result.groundImpactShakeFalloff = bs.readF32(); // 0x41c
458
- result.boundingRadius = bs.readF32(); // 0x420 (Tribes 2 extra)
459
- result.moveBubbleSize = bs.readF32(); // 0x424 (Tribes 2 extra)
460
+ result.groundImpactShakeDuration = bs.readF32(); // 0x420
461
+ result.groundImpactShakeFalloff = bs.readF32(); // 0x424
460
462
  return result;
461
463
  }
462
464
  // ============================================================
@@ -479,6 +481,8 @@ function vehicleDataUnpack(bs) {
479
481
  result.softImpactSpeed = bs.readF32(); // 0x380
480
482
  result.hardImpactSpeed = bs.readF32(); // 0x384 (900 dec)
481
483
  result.minRollSpeed = bs.readF32(); // 0x388
484
+ // Registered in the retail binary as "maxSteerinAngle" (engine typo);
485
+ // we keep the corrected spelling.
482
486
  result.maxSteeringAngle = bs.readF32(); // 0x38c
483
487
  result.maxDrag = bs.readF32(); // 0x3a4
484
488
  result.minDrag = bs.readF32(); // 0x3a0
@@ -1222,9 +1226,10 @@ function debrisDataUnpack(bs) {
1222
1226
  result.gravModifier = bs.readF32(); // 0x78
1223
1227
  result.terminalVelocity = bs.readF32(); // 0x7c
1224
1228
  result.ignoreWater = readBool(bs); // 0x80 (8-bit bool)
1225
- // 2 readString
1226
- result.shapeFileName = bs.readString(); // 0x8c
1227
- result.skinName = bs.readString(); // 0x84
1229
+ // 2 readString — names binary-verified: 0x8c is registered as
1230
+ // `texture`, 0x84 as `shapeName` (read in that wire order)
1231
+ result.texture = bs.readString(); // 0x8c
1232
+ result.shapeName = bs.readString(); // 0x84
1228
1233
  // 2 emitter refs (loop at 0xa4, 0xa8) + 1 explosion ref (0x94)
1229
1234
  result.emitter0 = readDataBlockRef(bs);
1230
1235
  result.emitter1 = readDataBlockRef(bs);
@@ -1502,15 +1507,17 @@ function audioEnvironmentUnpack(bs) {
1502
1507
  result.reflectionsDelay = readRangedF32(bs, 0, 0.3, 9); // 0x5c
1503
1508
  result.reverbDelay = readRangedF32(bs, 0, 0.1, 7); // 0x60
1504
1509
  result.roomVolume = readRangedS32(bs, -10000, 0); // 0x64
1505
- result.effectVolume = readRangedF32(bs, 0, 1, 9); // 0x6c (9 bits, confirmed in binary)
1506
- result.damping = readRangedF32(bs, 0, 2, 10); // 0x70 (10 bits, confirmed in binary)
1507
- result.environmentSize = readRangedF32(bs, 1, 100, 8); // 0x74 (8 bits, confirmed in binary)
1508
- result.environmentDiffusion = readRangedF32(bs, 0, 1, 10); // 0x78 (10 bits, confirmed in binary)
1509
- // NOTE: No airAbsorption field in binary (V12 has it, Tribes 2 binary does not)
1510
+ // Names binary-verified: initPersistFields maps 0x6c damping,
1511
+ // 0x70 environmentSize, 0x74 environmentDiffusion, 0x78 airAbsorption.
1512
+ result.damping = readRangedF32(bs, 0, 1, 9); // 0x6c (9 bits, confirmed in binary)
1513
+ result.environmentSize = readRangedF32(bs, 0, 2, 10); // 0x70 (10 bits, confirmed in binary)
1514
+ result.environmentDiffusion = readRangedF32(bs, 1, 100, 8); // 0x74 (8 bits, confirmed in binary)
1515
+ result.airAbsorption = readRangedF32(bs, 0, 1, 10); // 0x78 (10 bits, confirmed in binary)
1510
1516
  result.flags = bs.readInt(6); // 0x7c
1511
1517
  }
1512
- // Trailing field: always present after both branches (binary line 23471, offset 0x68)
1513
- result.effectVolumeHF = readRangedF32(bs, 0, 1, 8);
1518
+ // Trailing field: always present after both branches (offset 0x68 =
1519
+ // effectVolume per initPersistFields)
1520
+ result.effectVolume = readRangedF32(bs, 0, 1, 8);
1514
1521
  return result;
1515
1522
  }
1516
1523
  // ============================================================
@@ -1697,20 +1704,22 @@ function stationFXVehicleDataUnpack(bs) {
1697
1704
  y: bs.readF32(), // 0x90
1698
1705
  z: bs.readF32(), // 0x94
1699
1706
  };
1700
- // 11 strings
1701
- result.glowTexture = bs.readString(); // 0x98
1702
- // 4×(2 readString) pad textures
1703
- result.padTexture00 = bs.readString();
1704
- result.padTexture01 = bs.readString();
1705
- result.padTexture10 = bs.readString();
1706
- result.padTexture11 = bs.readString();
1707
- result.padTexture20 = bs.readString();
1708
- result.padTexture21 = bs.readString();
1709
- result.padTexture30 = bs.readString();
1710
- result.padTexture31 = bs.readString();
1707
+ // 11 strings — names binary-verified (initPersistFields: 0x98
1708
+ // glowNodeName, 0x9c leftNodeName[4], 0xac rightNodeName[4], 0xbc
1709
+ // texture[2]) and demo-verified ("GLOWFX", LFX1/RFX1…, stationGlow).
1710
+ result.glowNodeName = bs.readString(); // 0x98
1711
+ // 4×(left, right) node name pairs, interleaved on the wire
1712
+ result.leftNodeName0 = bs.readString();
1713
+ result.rightNodeName0 = bs.readString();
1714
+ result.leftNodeName1 = bs.readString();
1715
+ result.rightNodeName1 = bs.readString();
1716
+ result.leftNodeName2 = bs.readString();
1717
+ result.rightNodeName2 = bs.readString();
1718
+ result.leftNodeName3 = bs.readString();
1719
+ result.rightNodeName3 = bs.readString();
1711
1720
  // 2 readString
1712
- result.lightStartColor = bs.readString();
1713
- result.lightEndColor = bs.readString();
1721
+ result.texture0 = bs.readString();
1722
+ result.texture1 = bs.readString();
1714
1723
  return result;
1715
1724
  }
1716
1725
  // ============================================================
@@ -1729,12 +1738,12 @@ function stationFXPersonalDataUnpack(bs) {
1729
1738
  result.bottomAlpha = bs.readF32();
1730
1739
  result.glowSpeed = bs.readF32();
1731
1740
  result.scrollSpeed = bs.readF32();
1732
- // 2 readString
1733
- result.glowTexture = bs.readString();
1734
- result.padTexture = bs.readString();
1735
- // 2 readString
1736
- result.lightStartColor = bs.readString();
1737
- result.lightEndColor = bs.readString();
1741
+ // 4 strings — demo-verified ("FX1", "FX2", "special/stationLight"):
1742
+ // the two attach node names, then texture[2]
1743
+ result.leftNodeName = bs.readString();
1744
+ result.rightNodeName = bs.readString();
1745
+ result.texture0 = bs.readString();
1746
+ result.texture1 = bs.readString();
1738
1747
  return result;
1739
1748
  }
1740
1749
  // ============================================================