Programmer, Developer | Core / Systems
(Android , Made with Unity3D )
The Mini Car Racing game offers two different game modes: The Endless Runner and The Arcade Racing Mode. Initially, I worked in a team of two developers to create the necessary systems for the endless mode. In this mode, traffic and obstacles are generated dynamically across five lanes, ensuring that no dead ends are created and there is always enough space for the player to navigate through the traffic. To handle the behavior of the traffic, we implemented a Finite State Machine, which reduced the chances of bugs related to the states and also made the code more modular and readable.
The Finite State Machine utilized a state pattern, as there were a limited number of states that were not overly complex, making it a suitable choice. We applied a similar approach to the player controls, although we designed the states in a way that they didn’t complicate the Finite State Machine. For example, power-ups like boost, magnet, and turning left/right didn’t have their own separate states.
To ensure smooth gameplay in the endless mode, we minimized the use of physics and avoided dynamic rigid bodies. We believed that even the slightest stutter could negatively impact the player’s experience and potentially end their game abruptly. To achieve this, we employed techniques such as pooling, caching, and carefully optimizing lighting.
On the other hand, the arcade mode focused on racing and required completing laps in various environments. To implement this mode, we first developed the lap system. We utilized waypoints to track the current position of the cars, including reverse detection. By using vector projection along with the waypoints, we were able to determine the cars’ positioning accurately.
In the arcade mode of the game, a key feature was the power-up system, which enabled players to collect various power-ups while racing, much like the power-ups in Mario Kart. However, we encountered a challenge when it came to managing the stacking of power-ups, as there were numerous possible combinations.
To overcome this challenge, we implemented a solution by categorizing the power-ups. This approach not only resolved the issue of managing the different combinations but also accelerated the process of adding new power-ups to the game. By categorizing the power-ups, we were able to effectively handle their interactions and ensure a smooth and balanced gameplay experience for the players.