Behind the Scenes of
Enemy AI
The first test pass of the AI consisted of three states: roam, chase, and attack. These states were indicated by the colors of green, blue, and red respectively. All enemies use a state machine and a different collection of states and state transitions to make their behavior unique. This allowed enemies to be easily added as I could reuse a generic state for multiple enemies.
The final ram enemy consisted of four states, idle, roam, chase, and charge.
![Idle](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/1628198915690-3N624IQOB37PMKRE8RB7/Screen+Shot+2021-05-07+at+3.45.18+PM.png)
![Chase](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/853c74ba-0a74-4dc0-9a00-dd836e4606af/Screen+Shot+2021-05-07+at+3.45.27+PM.png)
![Attack](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/db3e8742-9712-4e86-8e6b-fac426911435/Screen+Shot+2021-05-07+at+3.45.33+PM.png)
The Cat
The orange diamond represents the point on the player the cat moves to
Movement
I wasn’t entirely sure how I wanted to implement the cat. Initially I considered having the cat sprites and the character sprites connected, but I thought it would lead to the cat’s movement feeling too stiff. I also considered having the cat pathfind to the player, but it made the cat’s movement too unpredictable and I quickly realized this would mess with my plan to have the cat provide light in the depression area as the cat was constantly lagging behind. Therefore I attached a point to the player which I could animate to move with things like the players jump, and then created a script for the cat to move to this point, that means when the player turns from left to right, the cat will glide to its new location rather than snap with the flipping of the players sprite, and I could closely control where the cat would be at all times.
Lighting
The light on the cat is made up of two lights. One of them is a sprite light using a mask I created in order to have stylized beams of light. I use a secondary point light to tone down the mask effect and to strengthen the overall feel of the cat glowing.
Two lights attached to the cat
Light mask
Weather Effects
The rain in the anger area uses Unity’s particle system. It consists of white squares that are scaled down on the x axis and up on the y to be narrow. The particles are affected by gravity so I placed the emitter a bit above the scene so they are at max velocity by the time they are visible. The drops have varying starting sizes and I added particle trails to the drops to add variety in length and width. This creates a nice sporadic stormy feel and adds to the sense of depth.
The lightning is an animation of a strike that changes the global light intensity using a script. It sets the intensity to a high value and then a low value and then at the end back to the default. The low value is used to simulate your pupils dilating from the sudden brightness.
![The humble beginning](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/b115d29d-46ae-413f-95c5-eea9eef9d9df/Screen+Shot+2021-08-05+at+5.07.48+PM.png)
The humble beginning
![Early development](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/c3167856-1df4-4b73-ad16-1089315462a0/Screen+Shot+2021-02-21+at+8.50.47+PM.png)
Early development
![Testing player animations](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/89099e9e-6541-4061-9627-0f97f0234bc4/Screen+Shot+2021-05-07+at+2.02.00+PM.png)
Testing player animations
![Depression scene](https://images.squarespace-cdn.com/content/v1/5fd0ed6ae737402bc9bc6950/b403ccb3-3021-400e-a904-96d2a1c7b192/Screen+Shot+2021-04-18+at+10.58.51+PM.png)
Depression scene
My Beautiful Trailer Storyboard