Hyper Casual Game
As of January 24th, I’ve decided to rework my Hyper Casual Game into something different as I wasn’t too confident in the earlier idea for it. For my Hyper Casual Game, I’ve now produced a game similar to Breakout.
This was an arcade game with a very simple gameplay premise similar to most Hyper Casual games on the mobile market, the gameplay input only involves moving a paddle left and right.
“In Breakout, a layer of bricks lines the top third of the screen and the goal is to destroy them all by repeatedly bouncing a ball off a paddle into them.”
So far I’ve managed to get the fundamentals of the game working, there is a controllable paddle, a ball and several blocks to break (See Figure 1).
How my game differs from Breakout however is that the physics of the game has changed, rather than the ball bouncing in diagonal lines it uses real simulated physics.
This is done by giving the ball itself a physics material with a high restitution setting – this gives it a stronger bounce when it hits objects.
“Physical Materials are used to define the response of a physical object when interacting dynamically with the world.”
As shown by Figure 2, this is the custom physics material I’ve applied to the ball.
However, to make sure the ball bounces more high enough to hit the blocks more consistently, I’ve added an overlap function to the paddle which will bounce the ball upwards by calling a function within it that adds an impulse going upwards.
It also takes the current force of the player’s right/left velocity to apply to the ball’s added impulse as well, this is so that when the player is moving left or right and hits the ball, it will bounce off in the corresponding direction as well (See Figure 3 & 5).
Included in Figure 3 is also a boolean that briefly disables itself once the overlap function happens. This boolean is part of the condition where if the ball hits, PaddleBounce has to be true as well.
This is to ensure that the overlap function only triggers once the PaddleBounce boolean is active as to avoid the ball having more than one impulse, at the end of the function a timer is set to re-enable the boolean via a seperate function after a second (See Figure 4).
As shown by Figure 6, this is what it looks like in-game. I’ve also added in some lines to demonstrate what forces are being shown.
The blocks in the game that the player destroys by propelling the ball towards has two important variables, a movement speed and a total of hitpoints (See Figure 7).
The speed is used as to determine the actor’s movement speed, this is in the tick function so the actor is moving every tick. In this function, we get the actor’s location and add onto it with the actor’s right vector multiplied by their speed – the new location is then set using this.
Another void displays a function which determines the condition on whether an actor should be destroyed or not, this is done very simply with an If and Else statement which will delete the actor if the amount of hitpoints is less than 1 – otherwise it will subtract the total by 1 (See Figure 8).
The destroyblock function is called within the ball’s code, using an OnCompHit function the ball is able to interact with any objects it hits. Using this, we cast to the block and check to see if the current component being hit is a block – if so, we then call the destroyblock function with the current block the player is colliding with (See Figure 9).
Included is also a debug message that gets the current name of the block hit by the ball, this is just to confirm to us that the OnCompHit function has worked (See Figure 10).
So far I managed to create a decent foundation for my game as of now, although it is not a complete game yet, I will need to set certain win and lose conditions.
I will need to implement a system which gives the player a set amount of lives and possibly a high score for how many blocks they destroy. I plan for the game to go as long as the player is able to play, once they run out of lives then the game will simply restart.
(En.wikipedia.org. 2022) Breakout (video game) – Wikipedia. [online] Available at: https://en.wikipedia.org/wiki/Breakout_(video_game) [Accessed 2 February 2022].
(Docs.unrealengine.com. 2022) Physical Materials. [online] Available at: https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Physics/PhysicalMaterials/ [Accessed 2 February 2022].
Docs.unrealengine.com. 2022. FTimerManager::SetTimer. [online] Available at: https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/FTimerManager/SetTimer/4/ [Accessed 4 February 2022].