ClashBat
ClashBat is a project created for the Bowled App available for download on the Android and Apple App stores. This game was designed to be more engaging and competitive than the other hyper-casual games featured on the app. It was heavily inspired from the HeadBall2 game but redesigned to fit a Cricket themed format.
It features two player competitive gameplay (Player Vs Bot or Player Vs Player) where each player tries to hit a cricket ball into the other player's wickets. The player with the higher score at the end of the time limit is the winner.
The game was made entirely by me acting as a solo developer from ideation to execution. Some of the challenges I tackled include:
-
Gameplay design
-
Player Movement and Animation
-
Opponent AI Logic
-
Peer to Peer PvP Multiplayer functionality using Photon PUN 2
-
Full Player Visual Customization System

Opponent AI Logic
One of the challenges I faced when creating was creating opponent logic that would closely resemble real player gameplay. This would include creating different logical systems for determining where to move, when to jump and which type of shot to play.
To do this I created different movement patterns for different situations:
-
When the ball is far away from the AI player
-
When the ball is somewhat close to the AI player
-
When the ball is within hitting distance of the AI player
These two situations are determined by the bot using two overlap circles of differing radii centered around the opponent player character.


The overlap circles are responsible for detecting whether the ball is within its boundaries each frame and determines the situation according to whether:
-
The ball is outside the outer circle's range
-
The ball is within the outer circle's range but outside the inner circle's range
-
The ball is inside the inner circle's range
1. Ball Outside Outer Circle Range
Periodically, the bot script determines a random point within two given extremities and sets that point as the bot's current destination. If the ball is not nearby the opponent bot moves towards that random point and jumps sporadically after a randomly determined time period.


2. Ball Inside Outer Circle Range
When the ball is within the range of the outer overlap circle the AI starts to move towards the ball instead of the randomly assigned target destination. If the ball is above a certain height the player jumps while moving towards the ball. The player continues to move towards the ball until the ball is within the range of the inner circle.

3. Ball Inside Inner Circle Range
When the ball is within the range of the inner overlap circle the AI logic stops moving and waits for the ball to reach striking distance. We determine the relative position of the ball each frame and accordingly determine whether to hit a overhead shot or an underarm shot.
One specific case that needed to be accounted for was in the situation if the ball is behind the bot player which means it can't be hit. In this situation we make the bot jump over the ball so that it is back in front of the player.
