After a lot of backend work, updating and reading, a player can now be assigned a random colour on connection.
1:15 PM (AEST), October 12th, 2021
Some major changes to An Infestation this week. Firstly, the project has been upgraded to the latest version of Unity from 2020.1.6f1 to 2021.1.24f1. This update allowed for the install of the latest version of MLAPI. The reason this update is necessary is that RPC calls and NetworkVariables weren't working correctly, turns out because I was accidentally using the version before Unity took over development. So after everything was updated and the code stitched back together, the script handling player colour changes is now working correctly and as intended, which leads directly into the next major change, and that's new colour variations for the players.
When a player connects, they will be assigned a colour for their player character at random. Each colour is unique and won't repeat unless every option has been exhausted to the available players, and thus, fresh colours are needed, and the List containing them refreshed. The reason this change took so long was because of the nature of its logic, this system needed to be run on the server so that all connecting players know what colours are remaining for assignment. Running code on the server is achieved using RPC calls and NetworkVariables, which ensure that altering the List of available colours or assigning colours to a player can only be performed by the server.
Unity update and some colour shifting are small changes in the grand scheme of things, but pretty decent changes to me. RPCs are something I will use more and more as time goes on with the development of An Infestation as a multiplayer game, so it's good to get a headstart.