Teams were originally implemented around TeamColor. Usually if given either team object or team color, you can find the other, but this breaks down if two team objects have the same team color. This is a non-issue if everything uses object references since Team objects are unique, but the only place in our codebase that’s been upgraded to do so is Player.Team. There are still issues with:
- Setting the Team property to another team of the same teamcolor does not work
- The playerlist only shows one of the teams instead of both
- There is no way to specify which team to use in SpawnLocations since it only has TeamColor
This is a problem because in my game I want teams of the same faction (e.g. humans, dwarves, elves vs goblins, orcs, demons) to have the same team color per faction but function as unique teams in-game.
- Allow Player.Team property to differentiate between two teams of the same teamcolor and be set to either of them
- Playerlist should show all teams, even if they have the same teamcolor, and show players under the appropriate team based on the Player.Team property
- Add SpawnLocation.Team and deprecate SpawnLocation.TeamColor in favor of SpawnLocation.Team.TeamColor
- Deprecate Player.TeamColor in favor of Player.Team.TeamColor
Ultimately TeamColor should be a visual property of teams only and not be used in any way to identify an object’s team.