Skip to main content

get_enemy_threat_level

Es soll ein Wert in [0, 1] bestimmt werden, welcher angibt, wie gefährlich ein angegebener gegnerischer Roboter ist, wobei 0 ungefährlich und 1 gefährlich ist.

Hierzu werden sowohl Abstand des Roboters zu unserem Tor, wie auch zum Ball betrachtet. Beide Größen werden der Spielfeldgröße, berechnet über die Diagonale des Spielfeldes, relativiert und anschließend über eine Sigmoid-Funktion normalisiert:

threat = 1 - sigmoid(distance / field_scale) * sigmoid(distance / field_scale)

wobei field_scale = hypot(field_size.x, field_size.y), welches die Feld-Diagonale berechnet. Die Sigmoid-Funktion kommt aus create_sigmoid_fn(midpoint, steepness).

enemy_threat - Page 01.png

Neues Konzept:

Motivation: It is important to understand, at every moment of the game, whether the opponent is gaining a dangerous advantage. 

Description: This function evaluates how threatening the current game state is, based on immediate and near-future offensive possibilities.

Required Data

To compute the threat level, the following information is required:

  • Ball data
    • Position
    • Possession
    • Orientation
    • Maximum speed
  • Robot data (all robots)
    • Position
    • Orientation
    • Maximum speed (linear movement and turning)
  • Goal geometry
    • Goal position and width
  • Probabilistic models
    • Shot / goal probability
    • Pass probability

Core Idea:

The threat level is computed in two stages:

  1. Immediate Threat (direct shot from current position)
  2. Future Threat (pass followed by a shot in the near future)

The final threat level is defined as:

enemy_threat_level = max(Shot Threat, Future Threat)

 

Computing immediate threat (aka Shot Threat)

Motivation: If a successful shot can be made from the current position, this represents an immediate and serious threat.

Description

To compute the immediate threat, the system evaluates:

  1. Whether a shot is geometrically possible.
  2. Whether the shot can be intercepted.


Step 1 — Ball Possession

If the opponent does not have possession of the ball, the immediate threat is significantly reduced.

Without possession, an immediate shot is impossible.

Step 2 — Static Coverage (Geometric Blocking)

The static positions of defenders and the goalkeeper are analyzed.

This step determines how much of the goal area is covered by defenders based on:

  • Robot radius
  • Ball radius
  • Angular shadows relative to the ball

This produces available shooting gaps.

Step 3 — Dynamic Interception (Time-Based Blocking)

For each possible shooting direction, the system evaluates:

  • Time for the ball to reach a target point
  • Time for each defender to reach the interception region

If defenders can arrive in time, the shot probability is reduced accordingly.


Computing Future Threat (Pass + Shot)

Motivation: Even if there is no direct threat, it might be so that a shot can be delivered in very little amount of steps. To counter these, this function tries to predict if a pass and then a shot should be considered a real threat.

Description: This function will be similarly sliced into few steps.

  1. Pass feasibility
  2. Pass interception probability
  3. Immediate shot after pass

FutureThreat = P (pass success) * P (shot)

Final Output:

Value from [0, 1] representing how dangerous the current field situation is.

Higher values indicate greater immediate risk.