Jump to content

COM takes control movement logic summary


bruddog

Recommended Posts

THis is what happens after the COM has done there predefined moves and they are the ball carrier.  


 


From the source code this is the ENTIRE Com movement Logic (This example is from the COM is P1 perspectuve)


 


Is com near out of bounds? (YES, set direction to left or right depending on P1 or P2)


 


This is the first logic check so com will ALWAYS run straight once they are near (1/2 yd) of being out of bounds


 


Is there a defender the COM can collide with IN FRONT of the runner? (NO-> move towards middle of field)


 


If all the defenders are behind the com runner he will move towards the middle of the field at a very mild direction.


 


YES->ADJUST DIRECTION BASED ON THE LOCATION OF THE 4 HIGHEST PRIORITY PLAYERS IT CAN COLLIDE WITH


 


The collision check is biased in the RE to SS order. And it only puts the first 4 it finds as players to check. So the com's decisions MIGHT not always be optimal. It counts how many of the a possible 4 are above or below. Positive number = more above. Zero= even. Negative number equals more below. 


 


The com direction either gets adjusted  up or down 11 degrees per frame depending on the check above. If there are an equal number of players above and below it will mildly move towards the middle at a constant  169 degrees or   191 degress where 180 degrees = right. 


 


The com can never go straight up its max upwards direction is 112 degrees where 90= up 


The com can never go straight down its max upwards direction is 248 degrees where 270= down 


 


 


 


 


 


 


 


 


Link to comment
Share on other sites

  • 2 years later...
  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...