Over 10 Million Study Resources Now at Your Fingertips

Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Pages: 2

Chapter designing the the ball down the field else player-

168 |

Chapter 4

Designing the AI

When a player obtains control of the ball he immediately requests support by calling the PlayerBase::FindSupport method. FindSupport examines each team member in turn to determine which player is closest to the best supporting spot (calculated every few time steps by SupportSpot-Calculator) and messages that player to change state to SupportAttacker.

On entering this state, the player’s arrive behavior is switched on and its steering target is set to the location of the BSS.

If a player’s team loses control, the player should change state to move back toward its home position.

//if the best supporting spot changes, change the steering target if (player->Team()->GetSupportSpot() != player->Steering()->Target()) {

As you have seen, the position of the best supporting spot changes accord-ing to many factors, so any supporting player must always make sure its steering target is kept updated with the latest position.

//if this player has a shot at the goal AND the attacker can pass //the ball to him the attacker should pass the ball to this player if( player->Team()->CanShoot(player->Pos(),
Prm.MaxShootingForce) )

//if not threatened by another player request a pass if (!player->isThreatened())

Finally, if the supporting player reaches the position of the BSS, it waits and makes sure it’s always facing the ball. If there are no opponents within its immediate vicinity and it doesn’t feel threatened, it requests a pass from the controlling player.

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Make payment
Document download
Download File
PageId: ELI11776D9
Uploaded by :
Page 1 Preview
chapter designing the the ball down the field else
Sell Your Old Documents & Earn Wallet Balance