Skip to content

Game data objects

SWZ edited this page Jul 21, 2022 · 2 revisions

This part is from SuperVKs package but still applies to this package

Controller

{
  throttle: 0, /// -1 for full reverse, 1 for full forward
  steer: 0, /// -1 for full left, 1 for full right
  pitch: 0, /// -1 for nose down, 1 for nose up
  yaw: 0, /// -1 for full left, 1 for full right
  roll: 0, /// -1 for roll left, 1 for roll right
  jump: false, /// true if you want to press the jump button
  boost: false, /// true if you want to press the boost button
  handbrake: false, /// true if you want to press the handbrake button (powerslide)
  useItem: false, /// true if you want to use a rumble item
}
  • throttle: Default is 0. To go forward, change this to 1. To go backwards, change this to -1. Setting this to 0 will stop the throttle. NOTE: Setting this to 0 does not slow the car down very well. If you want to brake, change the throttle to the opposite from what it was. E.g. when this is set to 1, set this to -1 until the bot has slowed down.
  • steer: Default is 0. To steer right, change this to 1. To steer left, change this to -1. Setting this to 0 will steer forwards.
  • pitch: Default is 0. To tip the bot forwards, change this to -1. To tip the bot backwards, change this to 1. NOTE: Changing this is a way to dodge.
  • roll: Default is 0. To roll clockwise(relative to the back of the car), change this to -1. To roll anti-clockwise(relative to the back of the car), change this to 1. NOTE: Changing this is a way to dodge.
  • yaw: Default is 0. To rotate the bot clockwise(relative to the top of the car), change this to -1. To rotate the bot clockwise(relative to the top of the car), change this to 1. NOTE: Changing this is a way to dodge.
  • boost: Default is false. To use boost, change this to true. To not use boost, change this to false.
  • jump: Default is false. To jump, change this to true. To not jump, change this to false
  • handbrake: Default is false. To powerslide, change this to true. To not powerslide, change this to false.
  • useItem: Default is false. To use a rumble item, change this to true. To not use a rumble item, change this to false.

GameTickPacket

{
  "players": [
    {
      "physics": {
        "location": {
          "x": -256,
          "y": -3840,
          "z": 17.010000228881836
        },
        "rotation": {
          "pitch": -0.009587380103766918,
          "yaw": 1.5707963705062866,
          "roll": 0
        },
        "velocity": {
          "x": 0,
          "y": 0.010999999940395355,
          "z": 0.210999995470047
        },
        "angularVelocity": {
          "x": -0.0006099999882280827,
          "y": 0,
          "z": 0
        }
      },
      "scoreInfo": {
        "score": 0,
        "goals": 0,
        "ownGoals": 0,
        "assists": 0,
        "saves": 0,
        "shots": 0,
        "demolitions": 0
      },
      "isDemolished": false,
      "hasWheelContact": true,
      "isSupersonic": false,
      "isBot": true,
      "jumped": false,
      "doubleJumped": false,
      "name": "Bot",
      "boost": 34,
      "team": 0
    },
    [...] // Order based on index
  ],
  "boostPadStates": [
    {
      "isActive": true,
      "timer": 0
    },
    {
      "isActive": true,
      "timer": 0
    },
    [...] // Order can be found at the useful game values
  ],
  "ball": {
    "physics": {
      "location": {
        "x": -863.6399536132812,
        "y": 281.4499816894531,
        "z": 93.13999938964844
      },
      "rotation": {
        "pitch": 0.18158496916294098,
        "yaw": 0.04918326064944267,
        "roll": 0.06778277456760406
      },
      "velocity": {
        "x": -567.2109375,
        "y": 179.26100158691406,
        "z": 0
      },
      "angularVelocity": {
        "x": -1.809209942817688,
        "y": -5.720609664916992,
        "z": 0.011809999123215675
      }
    },
    "latestTouch": {
      "playerName": "SuperVK",
      "gameSeconds": 405.3416748046875,
      "location": {
        "x": -193.3159637451172,
        "y": 64.18572998046875,
        "z": 92.49647521972656
      },
      "normal": {
        "x": -0.9340062141418457,
        "y": 0.35719090700149536,
        "z": 0.006852129008620977
      },
      "team": 1,
      "playerIndex": 2
    },
    "dropShotInfo": {
      "absorbedForce": 0,
      "damageIndex": 0,
      "forceAccumRecent": 0
    }
  },
  "gameInfo": {
    "secondsElapsed": 406.2083435058594,
    "gameTimeRemaining": -396.08331298828125,
    "isOvertime": false,
    "isRoundActive": true,
    "isKickoffPause": false,
    "isMatchEnded": false,
    "worldGravityZ": -650,
    "gameSpeed": 0
  },
  "tileInformation": [], //for Dropshot
  "teams": [
    {
      "teamIndex": 0,
      "score": 0
    },
    {
      "teamIndex": 1,
      "score": 0
    }
  ]
}

BallPrediction

{
    "slices": [
        {
            "gameSeconds": 406.2083435058594,
            "physics": {
                "location": {
                    "x": -863.6399536132812,
                    "y": 281.4499816894531,
                    "z": 93.13999938964844
                },
                "rotation": null, // Ball prediction doesn't have rotation
                "velocity": {
                    "x": -567.2109375,
                    "y": 179.26100158691406,
                    "z": 0
                },
                "angularVelocity": {
                    "x": -1.809209942817688,
                    "y": -5.720609664916992,
                    "z": 0.011809999123215675
                }
            }
        },
        [...] // One slice represents one frame
    ]
}

quickChats

You can find all of the quickchats here

Clone this wiki locally