Rigid Body Tick

John Simon edited this page Oct 8, 2018 · 2 revisions

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}
        },
    }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.