top of page
Search

1/29 - 2/2

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

This week I got some more progress done on my video game project. Firstly, I finished coding for all of the abilities, and I made all the assets for them as well. The first picture below is the updated abilities menu, with all of the abilities on it.

ree

Next, I started making a single-player mode. To do this, I had to make different player characters and different scripts. I made new character behavior scripts and new game manager scripts, because I had to change the references in them to the new character behavior and game manager scripts. The single-player scripts are mostly just the two-player script's code with the script references changed to the new ones for the single-player mode. I then disabled the normal player characters, backgrounds, and game managers, so only the single-player components are active. I did this so I could test out the code for the AI character, and the player character, in sort of a sandbox. For the AI's logic, I used a copy of the player two behavior scripts, and made some edits to it. I first changed all the inputs to be controlled by different variables. These variables are then controlled by different circumstances that the player will find itself in. I started coding the logic on Thursday, and about an hour after I started coding, I recorded the video below. The white square is being controlled by Cormac, a fellow classmate (as seen in the video), and the red square is being controlled purely by the AI script and logic that I coded for.

Since I recorded that video, I made some of the logic be affected by some different aspects. For example, there is a difficulty variable, that, if increased, will make it so the AI character has faster reaction time, and less likely to be faked out by pump fakes.


If you go to 8 seconds in the video, you will notice that there is a certain point where the AI will start playing defense, but before that, it just kinda sits there, waiting for the player to reach it. I did this because if the AI plays "press defense" 24/7, it will be incredibly easy for the player to just blow by it and get to the basket. I made it so where the point where the AI will start playing defense will be further out if the player makes more 3 pointers, and it will start playing defense closer to the basket if the player makes more 2 point shots. Also, if the score is tied or if the AI is losing, and the time left is below 3 seconds, the AI character will shoot the ball no matter what, instead of just holding it, or trying to drive for a dunk, which could waste time, and result in a missed opportunity for the AI character. Furthermore, if the time left is below 10 seconds, and the AI character is on defense, it will automatically disregard the point where it starts playing defense, and it will play "press defense", so-to-speak.


I still have a lot to do, since this was after just 1 day of coding, and only resulted in a couple hundred lines of code. I also have to make the scenes for the single player mode leading up to, and after the game scene.

 
 
 

Comments


© 2035 by TheHours. Secured by NM inc.

bottom of page