Ice Cube is based on the creation of a behavioural and visceral design based RPG game. The real motivation behind this project is creation of a juicy RPG game with only primitive shapes of Unity. The project only uses icons and music from third party sources. Except these all the assets, including animations, developed inside Unity.
This game is developed based on the MDA design framework. In order to create a balance between mechanics and aesthetics, primitive models used in this project. This created a significant impact on the art style of the game.
Component based Design is used in this Unity project. Each big class has sub classes focusing on specialized jobs and becoming the component of the big class such as but not limited to: player camera, player animation etc.
Player gameobject moves based on the rotate around method of the Unity game engine. After the player gives an input for vertical and horizontal directions, the player gameobject is being rotated to the desired move direction. This calculation is necessary, since dynamic pivot calculation requires a very detailed approach and time. After the player is rotated, based on the direction of the player facing, a pivot point is being selected and the player is being rotated towards that direction. This creates a cube-rotating movement, just like a dice rolling.
Since primitive shapes are being used, custom animations are used as it is stated above. Custom animations are being handled by the components of both player and enemy (PlayerAnimation and EnemyAnimation). On the enemy side, enemy animations (attacking a player with a hammer or using projectiles to attack) are handled much more easily than the player. There is a mock hand position generated for enemy models. Weapons prepared are placed in this hand slot and rotate around. In enemy animations, there are different kinds of additional calculations such as but not limited to making a hammer to get faster while rotating to give much more juice.
On the other hand, the player side is much more complicated and requires a lot of detailed thinking. Since the player is being rotated around all the time, the player's rotation values are changed all the time, including look vectors of the game object itself. In order to solve this problem two main approaches are being used: player equipments are being held outside of the player class for making sure that, player’s weapons are not affected from the rotations and an another dynamic game object that is specially prepared for taking input locations from orthogonal camera since orthogonal camera creates parallel raycasts, additional calculations are being done here as stated above.
An optimized pooling system is used for enemy parts destruction which is the biggest source of draw calls and object generation. The pooling system enhances the optimization greatly, especially in WebGL builds.
Enemies are built on top of Finite State Machines. A very basic FSM supports idle, patrol, chase and attack behaviors.
An intermediate inventory system is implemented for allowing players to manage the items for themselves. Although the game supports a very small amount of items for limited gameplay, the inventory system can be expanded for any kind of item. Inventory system also supports world representation of the items, which is very crucial for items such as weapons etc. Enemies are also very dynamic, they have their own inventory implemented.