// Constants related to the arena dimensions
constexpr float SIDE_WALL_X = 4096.0f;
constexpr float CLOSE_DISTANCE = 10.0f;        // Distance threshold for proximity to the walls
constexpr float NEAR_WALL_DISTANCE = 4077.0f;  // Threshold for x close to the wall
constexpr float Z_THRESHOLD = 256.0f;           // Threshold for z axis proximity to the ground
constexpr float EPSILON = 1e-3f;               // Small value for floating point comparison
float calculateTimeToSideWalls(const PlayerData& player) {
    float current_x = player.phys.pos.x;
    float current_z = player.phys.pos.z;        // Player's z coordinate
    float velocity_x = player.phys.vel.x;
    // Check if the player's z is below the threshold (under 17 units)
    if (current_z <= Z_THRESHOLD) {
        return 0.0f; // Player is too close to the ground
    }
    // Check if the player is very close to the positive or negative side wall (within ±4077 units)
    if (std::abs(current_x) >= NEAR_WALL_DISTANCE && std::abs(current_x) <= SIDE_WALL_X) {
        return 0.0f; // Player is very close to the side walls
    }
    // Initialize time to infinity
    float timeToWall = std::numeric_limits::infinity();
    // Calculate time to positive side wall (x = +4096.0f)
    if (velocity_x > 0.0f) {
        float distanceToPositiveWall = SIDE_WALL_X - current_x;
        // Ensure the wall is ahead
        if (distanceToPositiveWall > 0.0f) {
            float time = distanceToPositiveWall / velocity_x;
            if (time > 0.0f) {
                timeToWall = time; // Update only if time is positive
            }
        }
    }
    // Calculate time to negative side wall (x = -4096.0f)
    else if (velocity_x < 0.0f) {
        float distanceToNegativeWall = (-SIDE_WALL_X) - current_x;
        // Since velocity_x is negative, distanceToNegativeWall should be negative
        // To get a positive time, divide two negatives
        if (distanceToNegativeWall < 0.0f) {
            float time = distanceToNegativeWall / velocity_x; // This will be positive
            if (time > 0.0f) {
                timeToWall = time; // Update only if time is positive
            }
        }
    }
    // At this point, timeToWall is either the time to the nearest wall or infinity
    return timeToWall;
} add exstra polation logic liek this too better calculate the time to the walls float goalY = RLConst::SOCCAR_GOAL_SCORE_BASE_THRESHOLD_Y * (player.team == Team::BLUE ? 1 : -1);
float distToGoalY = std::abs(ball.pos.y - goalY);
float extrapScoreTime = distToGoalY / std::max(std::abs(ball.vel.y), 0.01f);
Vec extrapScorePos = ball.pos + ball.vel * extrapScoreTime;
extrapScorePos.z += CommonValues::GRAVITY_Z * (extrapScoreTime * extrapScoreTime) / 2; also assume the player is going the max speed wen it can     if (curVel < MAX_TOTAL_SPEED && t == 0) {
        // Flip force
        curVel += FLIP_FORCE;
    }
    if (curVel < 0) {
        curVel += (BREAK_ACCEL + BOOST_ACCEL * hasRotated) * STEP_INTERVAL;
    }
    else if (curVel < MAX_DRIVE_SPEED) {
        curVel += (DRIVE_ACCEL + BOOST_ACCEL * hasRotated) * STEP_INTERVAL;
    }
    else if (curVel < MAX_TOTAL_SPEED) {
        curVel += BOOST_ACCEL * hasRotated * STEP_INTERVAL;
    }
    else {
        return t + (curDist / curVel);
    }
}
return t;  constexpr float DIST_REACH_THRESH = 80.0f;
constexpr float STEP_INTERVAL = 1.0f / 60.0f;
constexpr float FLIP_FORCE = 495.0f;
constexpr float AIR_ACCEL = 66.66667f;
constexpr float BOOST_ACCEL_AIR = 1058.33333f;
constexpr float MAX_TOTAL_SPEED = 2300.0f;
constexpr float BRAKE_ACCEL = 3500.0f;
constexpr float BOOST_ACCEL_GROUND = 991.66667f;
constexpr float DRIVE_ACCEL = 1600.0f;
constexpr float MAX_DRIVE_SPEED = 1410.0f;