How to change the player names through a mod

I had an idea for a mod that makes players anonymous to each other by randomizing their colors and names. I was able to randomly select a color without too much difficulty (although I am unsure if the colors are the same between players), but changing the names of players has been difficult.

I found a setting that hides player's names already built into FAF called options.options_show_player_names. I used a mod to force it to 'off', but this breaks the chat. This seems to affect only PostprocessArmiesTable in /lua/ui/override/ArmiesTable.lua and PostprocessClients in /lua/ui/override/SessionClients.lua. However, when a chat message is sent, the engine has the sender as your original name, which causes GetArmyData in /lua/ui/game/chat.lua to be unable to find the correct army data and the chat message is ignored.

The ideal time to change the names of all the players would be just as the lobby is launched, but I am not sure that mods are loaded at this point. Alternately, if I can find a way to add some extra information to the army tables that can tie each player's original name back to them, that could also work.

If anyone has any ideas on how to get this to work, please let me know.

I've also looked into this, to allow players to play the game without knowing who they're playing with or against. But I'm afraid that certain parts of the UI are hardcoded as you found out yourself too. The game option will likely be removed again, as it may need to be enforced in the lobby instead.

I do not have the time at this moment to investigate it further, but feel free to create a development environment and toy around, see what the behavior is.

A work of art is never finished, merely abandoned

If you want it for yourself, go for it. But for others it's always easy to figure out who plays/played via client, ice adapter debug view or replay information

"Nerds have a really complicated relationship with change: Change is awesome when WE'RE the ones doing it. As soon as change is coming from outside of us it becomes untrustworthy and it threatens what we think of is the familiar."
ā€“ Benno Rice