Player Input System
From the start, we aimed to move away from the outdated legacy input system and finally embrace the Unity Input System package. This shift allowed us to take advantage of a more flexible system, providing a solid foundation for the project.
Throughout development, we had to make some interesting adjustments to ensure the input system functioned correctly. Despite the challenges, the final product we landed on feels like a robust solution, one that should not only serve the current needs of the game but hopefully will also support networking functionality in future updates.
The project initially began with a very traditional implementation of the input system. The player prefab was directly tied to Unity's Input Manager, which allowed us to add and remove players relatively easily. However, this approach came with its limitations.
One significant issue arose when trying to set up players in the game menu, specifically during the ready-up phase. The system lacked flexibility for dynamically adding players or adapting to more complex scenarios. This limitation made it challenging to handle player setup seamlessly and highlighted the need for a more robust and adaptable approach to input management.
When we redeveloped the input system, we extracted the player inputs into a separate object. This object became the hub for critical information, such as the player's controller ID, input type, and other key data. By decoupling player inputs from the player prefab, we created a more flexible system.
When players needed to control a character, the system would spawn player objects based on the current player count and simply connect them to input events. This approach not only streamlined the process but also made the system more scalable. The resulting input system proved to be both effective and efficient, and we’re optimistic that it will simplify future tasks, such as implementing networking. By reducing the dependencies and centralizing input management, we’ve minimized the work required for future iterations or enhancements.
This system also laid the foundation for implementing persistent data, such as tracking winning streaks and player coloring. By leveraging the player ID, we were able to keep a record of each player's current victories, which led to the development of the crown system—one of my favorite small additions. Additionally, the player ID system enabled us to assign unique colors to players, a critical step in improving character identification. This enhancement significantly boosted gameplay clarity and ensured players could quickly distinguish their characters in fast-paced situations. These small yet impactful details contribute to a more polished and enjoyable player experience.