Skip to content
Blocks edited this page Aug 4, 2019 · 3 revisions

NOTE: The RigidBodyTick is now outdated due to the Psyonix API. The GameTickPacket contains raw data from the game's physics engine now. Please use the normal GameTickPacket instead.

The RigidBodyTick contains the raw data used by Rocket League's physics engine. It updates at Rocket's League constant physics tick rate (120Hz). In contrast to the GameTickPacket, data in the RigidBodyTick is not interpolated to match the graphics refresh rate.

This is an advanced feature! You can still make a great bot without it, but having this data is quite nice for the physicists among us.

You can retrieve it with BaseAgent.get_rigid_body_tick().

Sample RigidBodyTick

rigid_body_tick = {
    'players': [
        {
            'state': {
                # `frame` is the number of physics ticks that have occurred for
                # a rigid body. It advances by one for each 120Hz tick, so you
                # can convert it to seconds (if desired) by dividing by 120.
                'frame': 34891,
                'location': {'x': 0.0, 'y': 0.0, 'z': 0.0},
                'rotation': {'x': 1.0, 'y': 0.0, 'z': 0.0, 'w': 0.0},  # This is a quaternion!
                'velocity': {'x': 0.0, 'y': 0.0, 'z': 0.0},
                'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.0}
            },
            'input': {  # This is just information about what input the car has received during this frame
                'throttle': 0.85,
                'steer': -1.0,
                'pitch': -0.9,
                'yaw': 1.0,
                'roll': 0.0,
                'jump': True,
                'boost': False,
                'handbrake': False
            },
        },
        { ... }
    ],
    'num_players': 2,
    'ball': {
        'state': {
            'frame': 34891,
            'location': {'x': 0.0, 'y': 0.0, 'z': 0.0},
            'rotation': {'x': 1.0, 'y': 0.0, 'z': 0.0, 'w': 0.0},  # This is a quaternion!
            'velocity': {'x': 0.0, 'y': 0.0, 'z': 0.0},
            'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.0}
        },
    }
}