top of page
Search

2/5 - 2/9

  • Writer: Nathan Matarazzo
    Nathan Matarazzo
  • Feb 9, 2024
  • 2 min read

This week I did more work on my game project in Unity. I coded more for the AI logic on Monday, Tuesday, and Thursday, since I was out sick on Wednesday. I added some code so the AI player can steal, dash, shoot 3 pointers, hit step backs, and drive to the net. All of these are controlled by RNG probabilities that correspond to the AI's stats. So, for example, if the AI character has really good shooting stats, it will be more likely to shoot a 3 pointer, than if it had lower shooting stats. This is also true for stealing. If any player attempts a steal, its speed will decrease. So, I made it so the AI is more likely to steal more often if it has higher RNG than if it had lower stealing RNG. I did this so even AI players with less stealing can still stay in front of the ball, and not get cooked every time. Also I added some situational logic to the AI that will override some of the other logic. For example, if the AI is losing by more than 2 with less than 10 seconds left, it will go back to the 3 point line and attempt a 3 pointer. Also, if there is less than 10 seconds left, the AI will disregard the point where it starts playing defense, and start pressing the player, trying to steal the ball.


I also improved the difficulty modifier. It is now a number between 0-5 that will affect the reaction time and the probability that a player can fake out the AI with a pump-fake. The difficulty can be changed in the menu before you load into the game, by choosing a difficultly. It then increases gradually if the player keeps scoring a lot.


I also had to fix some of the net collisions. The net was colliding with some of the players who could jump really high. I turned off collisions with the net and the player characters so it wouldn't get messed up like that again.


This is a video of the AI hitting a step back.


 
 
 

Comments


© 2035 by TheHours. Secured by NM inc.

bottom of page