Thunderbots Project
Loading...
Searching...
No Matches
Play and Tactic FSM Diagrams

PlaySelectionFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> Halt
Halt --> Stop : [gameStateStopped]
setupStopPlay Halt --> Playing : [gameStatePlaying]
setupOffensePlay Halt --> SetPlay : [gameStateSetupRestart]
setupSetPlay Stop --> Halt : [gameStateHalted]
setupHaltPlay Stop --> Playing : [gameStatePlaying]
setupOffensePlay Stop --> SetPlay : [gameStateSetupRestart]
setupSetPlay Playing --> Halt : [gameStateHalted]
setupHaltPlay Playing --> Stop : [gameStateStopped]
setupStopPlay Playing --> SetPlay : [gameStateSetupRestart]
setupSetPlay SetPlay --> Halt : [gameStateHalted]
resetSetPlay, setupHaltPlay SetPlay --> Stop : [gameStateStopped]
resetSetPlay, setupStopPlay SetPlay --> Playing : [gameStatePlaying]
resetSetPlay, setupOffensePlay SetPlay --> SetPlay : [gameStateSetupRestart]
setupSetPlay Terminate:::terminate --> Terminate:::terminate

BallPlacementPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> StartState
StartState --> AlignPlacementState : [!shouldKickOffWall]
alignPlacement StartState --> KickOffWallState : [shouldKickOffWall] KickOffWallState --> KickOffWallState : [!kickDone && shouldKickOffWall]
kickOffWall KickOffWallState --> KickOffWallState : [kickDone] KickOffWallState --> AlignPlacementState : [!kickDone] AlignPlacementState --> KickOffWallState : [shouldKickOffWall] AlignPlacementState --> AlignPlacementState : [!alignDone]
alignPlacement AlignPlacementState --> PlaceBallState : [alignDone] PlaceBallState --> PlaceBallState : [!ballPlaced]
placeBall PlaceBallState --> WaitState : [ballPlaced]
startWait WaitState --> WaitState : [!waitDone] WaitState --> RetreatState : [waitDone] RetreatState --> Terminate:::terminate : [retreatDone && ballPlaced] RetreatState --> RetreatState : [ballPlaced]
retreat

CreaseDefensePlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> DefenseState
DefenseState --> DefenseState : defendDefenseArea
Terminate:::terminate --> Terminate:::terminate

DefensePlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> DefenseState
DefenseState --> DefenseState : defendAgainstThreats
Terminate:::terminate --> Terminate:::terminate

EnemyBallPlacementPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> WaitState
WaitState --> AvoidState : [hasPlacementPoint]
setPlacementPoint WaitState --> WaitState : [!hasPlacementPoint] AvoidState --> AvoidState : [!isNearlyPlaced]
avoid AvoidState --> DefenseState : [isNearlyPlaced] DefenseState --> DefenseState : [isNearlyPlaced]
enterDefensiveFormation DefenseState --> AvoidState : [!isNearlyPlaced]

EnemyFreeKickPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> BlockEnemyKickerState
BlockEnemyKickerState --> BlockEnemyKickerState : blockEnemyKicker
Terminate:::terminate --> Terminate:::terminate

FreeKickPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> SetupPositionState
SetupPositionState --> SetupPositionState : [!setupDone]
setupPosition SetupPositionState --> ShootState : [shotFound] ShootState --> ShootState : [!shotDone]
shootBall ShootState --> Terminate:::terminate : [shotDone] SetupPositionState --> AttemptPassState : startLookingForPass AttemptPassState --> ChipState : [timeExpired] AttemptPassState --> AttemptPassState : [!passFound]
lookForPass AttemptPassState --> PassState : [passFound] PassState --> AttemptPassState : [shouldAbortPass] PassState --> PassState : [!passDone]
passBall PassState --> Terminate:::terminate : [passDone] ChipState --> ChipState : [!chipDone]
chipBall ChipState --> Terminate:::terminate : [chipDone]

HaltPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> HaltState
HaltState --> HaltState : updateStop
Terminate:::terminate --> Terminate:::terminate : updateStop

OffensePlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> OffensiveState
OffensiveState --> DefensiveState : [enemyHasPossession]
setupDefensiveStrategy OffensiveState --> OffensiveState : setupOffensiveStrategy DefensiveState --> OffensiveState : [!enemyHasPossession]
setupOffensiveStrategy DefensiveState --> DefensiveState : setupDefensiveStrategy Terminate:::terminate --> Terminate:::terminate

PenaltyKickPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> SetupPositionState
SetupPositionState --> SetupPositionState : [!setupPositionDone]
setupPosition SetupPositionState --> PerformKickState : [setupPositionDone] PerformKickState --> PerformKickState : [!kickDone]
performKick PerformKickState --> Terminate:::terminate : [kickDone] Terminate:::terminate --> Terminate:::terminate

PenaltyKickEnemyPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> SetupPositionState
SetupPositionState --> SetupPositionState : [!setupPositionDone]
setupPosition SetupPositionState --> DefendKickState : [setupPositionDone]
defendKick DefendKickState --> DefendKickState : defendKick Terminate:::terminate --> Terminate:::terminate

ShootOrPassPlayFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> StartState
StartState --> AttemptShotState : startLookingForPass
AttemptShotState --> TakePassState : [passFound]
takePass AttemptShotState --> Terminate:::terminate : [tookShot] AttemptShotState --> AttemptShotState : [!passFound]
lookForPass TakePassState --> AttemptShotState : [shouldAbortPass]
startLookingForPass TakePassState --> TakePassState : [!passCompleted]
takePass TakePassState --> Terminate:::terminate : [passCompleted]
takePass Terminate:::terminate --> AttemptShotState : startLookingForPass

AttackerFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> DribbleFSM
DribbleFSM --> PivotKickFSM : [shouldKick]
pivotKick DribbleFSM --> DribbleFSM : [!shouldKick]
keepAway PivotKickFSM --> PivotKickFSM : pivotKick PivotKickFSM --> Terminate:::terminate Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

ChipFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> GetBehindBallFSM
GetBehindBallFSM --> GetBehindBallFSM : updateGetBehindBall
GetBehindBallFSM --> ChipState
ChipState --> GetBehindBallFSM : [shouldRealignWithBall]
updateGetBehindBall ChipState --> ChipState : [!ballChicked]
updateChip ChipState --> Terminate:::terminate : [ballChicked]
SET_STOP_PRIMITIVE_ACTION Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

CreaseDefenderFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> MoveFSM
MoveFSM --> DribbleFSM : [ballNearbyWithoutThreat]
prepareGetPossession MoveFSM --> MoveFSM : blockThreat MoveFSM --> Terminate:::terminate DribbleFSM --> MoveFSM : [!ballNearbyWithoutThreat]
blockThreat DribbleFSM --> DribbleFSM : prepareGetPossession Terminate:::terminate --> DribbleFSM : [ballNearbyWithoutThreat]
prepareGetPossession Terminate:::terminate --> MoveFSM : blockThreat

DribbleFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> GetPossession
GetPossession --> Dribble : [havePossession]
dribble GetPossession --> GetPossession : [!havePossession]
getPossession Dribble --> LoseBall : [shouldLoseBall]
loseBall Dribble --> GetPossession : [lostPossession]
getPossession Dribble --> Dribble : [!dribblingDone]
dribble Dribble --> Terminate:::terminate : [dribblingDone]
dribble LoseBall --> LoseBall : [shouldLoseBall]
loseBall LoseBall --> GetPossession : [!shouldLoseBall]
getPossession Terminate:::terminate --> GetPossession : [lostPossession]
getPossession Terminate:::terminate --> Dribble : [!dribblingDone]
dribble Terminate:::terminate --> Terminate:::terminate : dribble

GetBehindBallFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> GetBehindBallState
GetBehindBallState --> GetBehindBallState : [!behindBall]
updateMove GetBehindBallState --> Terminate:::terminate : [behindBall]
updateMove Terminate:::terminate --> GetBehindBallState : [!behindBall]
updateMove Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

GoalieFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> PositionToBlock
PositionToBlock --> MoveToGoalLine : [shouldMoveToGoalLine]
moveToGoalLine PositionToBlock --> DribbleFSM : [shouldEvacuateCrease]
retrieveFromDeadZone PositionToBlock --> Panic : [shouldPanic]
panic PositionToBlock --> PivotKickFSM : [shouldPivotChip]
updatePivotKick PositionToBlock --> PositionToBlock : positionToBlock DribbleFSM --> PivotKickFSM : [retrieveDone]
updatePivotKick DribbleFSM --> MoveToGoalLine : [shouldMoveToGoalLine]
moveToGoalLine DribbleFSM --> DribbleFSM : [ballInInflatedDefenseArea]
retrieveFromDeadZone DribbleFSM --> PositionToBlock : [!ballInInflatedDefenseArea]
positionToBlock Panic --> MoveToGoalLine : [shouldMoveToGoalLine]
moveToGoalLine Panic --> PivotKickFSM : [shouldPivotChip]
updatePivotKick Panic --> PositionToBlock : [panicDone]
positionToBlock Panic --> Panic : panic PivotKickFSM --> MoveToGoalLine : [shouldMoveToGoalLine]
moveToGoalLine PivotKickFSM --> PivotKickFSM : [ballInInflatedDefenseArea]
updatePivotKick PivotKickFSM --> PositionToBlock : [!ballInInflatedDefenseArea]
positionToBlock MoveToGoalLine --> MoveToGoalLine : [shouldMoveToGoalLine]
moveToGoalLine MoveToGoalLine --> PositionToBlock : [!shouldMoveToGoalLine]
positionToBlock Terminate:::terminate --> Terminate:::terminate

HaltFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> StopState
StopState --> StopState : [!stopDone]
updateStop StopState --> Terminate:::terminate : [stopDone]
updateStop Terminate:::terminate --> StopState : [!stopDone]
updateStop Terminate:::terminate --> Terminate:::terminate : [stopDone]
updateStop

KickFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> GetBehindBallFSM
GetBehindBallFSM --> GetBehindBallFSM : updateGetBehindBall
GetBehindBallFSM --> KickState
KickState --> GetBehindBallFSM : [shouldRealignWithBall]
updateGetBehindBall KickState --> KickState : [!ballChicked]
updateKick KickState --> Terminate:::terminate : [ballChicked]
SET_STOP_PRIMITIVE_ACTION Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

MoveFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> MoveState
MoveState --> MoveState : [!moveDone]
updateMove MoveState --> Terminate:::terminate : [moveDone]
updateMove Terminate:::terminate --> MoveState : [!moveDone]
updateMove Terminate:::terminate --> Terminate:::terminate : updateMove

PassDefenderFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> BlockPassState
BlockPassState --> InterceptBallState : [passStarted]
interceptBall BlockPassState --> BlockPassState : blockPass InterceptBallState --> BlockPassState : [ballDeflected]
blockPass InterceptBallState --> DribbleFSM : [ballNearbyWithoutThreat]
prepareGetPossession DribbleFSM --> BlockPassState : [!ballNearbyWithoutThreat]
blockPass DribbleFSM --> DribbleFSM : prepareGetPossession InterceptBallState --> InterceptBallState : interceptBall Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

PenaltyKickFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> DribbleFSM
DribbleFSM --> DribbleFSM : [!takePenaltyShot]
updateApproachKeeper DribbleFSM --> KickFSM : [timeOutApproach]
shoot DribbleFSM --> DribbleFSM : adjustOrientationForShot DribbleFSM --> KickFSM KickFSM --> KickFSM : shoot KickFSM --> Terminate:::terminate Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

PivotKickFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> StartState
StartState --> DribbleFSM : getPossessionAndPivot
DribbleFSM --> DribbleFSM : getPossessionAndPivot
DribbleFSM --> KickState
KickState --> KickState : [!ballKicked]
kickBall KickState --> Terminate:::terminate : [ballKicked]
SET_STOP_PRIMITIVE_ACTION Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

ReceiverFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> WaitingForPassState
WaitingForPassState --> WaitingForPassState : [!passStarted]
updateReceive WaitingForPassState --> OneTouchShotState : [passStarted && onetouchPossible]
updateOnetouch WaitingForPassState --> ReceiveAndDribbleState : [passStarted && !onetouchPossible]
updateReceive ReceiveAndDribbleState --> ReceiveAndDribbleState : [!passFinished]
adjustReceive OneTouchShotState --> OneTouchShotState : [!passFinished && !strayPass]
updateOnetouch OneTouchShotState --> ReceiveAndDribbleState : [!passFinished && strayPass]
adjustReceive ReceiveAndDribbleState --> Terminate:::terminate : [passFinished]
adjustReceive OneTouchShotState --> Terminate:::terminate : [passFinished]
updateOnetouch Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION

ShadowEnemyFSM


stateDiagram-v2
classDef terminate fill:white,color:black,font-weight:bold
direction LR
[*] --> MoveFSM
MoveFSM --> BlockPassState : [!enemyThreatHasBall]
blockPass MoveFSM --> MoveFSM : blockShot MoveFSM --> StealAndChipState BlockPassState --> BlockPassState : [!enemyThreatHasBall]
blockPass BlockPassState --> MoveFSM : [enemyThreatHasBall]
blockShot StealAndChipState --> StealAndChipState : [enemyThreatHasBall]
stealAndChip StealAndChipState --> Terminate:::terminate : [!enemyThreatHasBall]
blockPass Terminate:::terminate --> BlockPassState : [!enemyThreatHasBall]
blockPass Terminate:::terminate --> MoveFSM : [enemyThreatHasBall]
blockShot Terminate:::terminate --> Terminate:::terminate : SET_STOP_PRIMITIVE_ACTION