About this mod
Dynamically swaps duplicate NPC appearances in crowds
- Requirements
- Permissions and credits
- Changelogs
Dynamically swap duplicate NPC appearances

The mod detects and swaps duplicate NPC appearances. What does it swap the duplicate appearance with? There are two strategies that can be configured:
- Unique appearance creation: the mod creates a unique NPC appearance by randomizing the appearance of each garment on the NPC (including skin color, hair color, garment, and other accessories). A typical NPC has 5-10 such "garment components" each having on average 5-10+ appearances, which is effectively tens of thousands of visually distinct combinations
- Existing appearance swaps: the mod swaps to an alternate appearance already defined in the base game for the NPC. This will be an appearance you probably have seen before but will not be a duplicate among the spawned NPCs
Both the strategies can be mixed and used at the same time in different proportions and controlled with a frequency slider via Mod Settings.
Unique appearance creation is possible only thanks to Codeware. It allows some interesting NPC appearances to show up time to time

In theory, with Unique Appearance Creation this means you should be seeing new unique NPCs each time for the swapped out NPCs. Note: the NPC itself is not swapped entirely, just their outfit/skin color so faces might be same if you look really hard.
"WOW - what's the catch?"
Unique Appearance creation is GPU/CPU intensive. Existing Appearance Swap is not.
Unique Appearance Creation cannot be used on lower end PCs (especially ones don't support RT) and WILL cause stuttering/freezes. So in this case, only Existing Appearance swaps must be used. I'm not sure what the exact threshold is but some amount of VRAM is required.
On first install - the mod will automatically detect your graphics setting and set a conservative swap strategy frequency
Both strategies work independently whether you choose only one or not, or decide to choose a mix between the both - you will see duplicates removed in either case so it's mostly a matter of preference. You can change the frequency as you like depending on your PC and whether or not if you're facing perf issues.

How the slider works
Use the slider to control how often "Unique appearance creation" v/s "Existing Appearance Swaps" is used as a strategy to prevent NPC duplication.

INCREASE this slider to INCREASE the frequency of Unique Appearance Creation. So higher the slider value, higher the proportion of Unique NPC appearances, and higher the GPU cost.
Conversely, Lower the slider to increase the frequency of Existing Appearance Swaps.
For lower-end PCs, on first install - the slider will be automatically configured to 0%. This means NO Unique Appearance is used, and ONLY Existing Appearance strategy is used. (0% does not mean mod is not working. It just means only Existing Appearances are used)

FAQs
Is this a magic bullet? Does it solve everything?
No. The mod tries its best and theres no 100% guarantee you won't see a duplicate ever, though should still be close to it. There are many failure modes including base game bugs, quirks of the base game crowd implementation, and other things in the way.
The mod also tries to solve the problem of "Didn't I just see this NPC at a different spot before?" - however this can't solved completely either due to the nature of the game's crowd implementation. But it tries to swap appearances for reappearing NPCs as much as possible.
Does it swap appearances for gangs, cops, etc?
No. Only crowd NPCs are swapped
Gangs, NCPD, armed NPCs, and quest NPCs are not altered. Dead NPCs or NPCs driving a vehicle are also not altered.

How to report issues
If you see issues or a lot of duplicate NPCs even after installing, please use the "Debug Overlay" in Mod Settings and take a screenshot of the duplicate NPC/in-game with the debug overlay visible.

You can turn on the debug overlay to see the mod working in real-time. It will update statistics and also overlay a yellow higlight over NPCs with swapped appearances. Include a screenshot of the debug overlay when posting a bug report.


Compatibility
NPC Appearance Mods ✅
Should be compatible with any other mods that introduce new appearances to crowds.
There are some archive changes included in the mod, however it is designed in a way that does not conflict with other mods performing archive changes.
However - results may vary depending on the crowd appearance mod. If you're still seeing a high number of duplicates after installing, try removing mods that add appearances and check if it makes a difference. Use the debug overlay to compare the "% processed" value before and after.
NPC Crowd Density Mods ✅
The mod does not replace NPC "Entities" so the mod doesn't alter the spawning behaviour - the mod only reads and swaps appearances of spawned NPCs. So it should be compatible with any mods altering crowd density including Nova Crowds and Psycho Crowds

Big thanks to DBK, vanaukas, Stormie, SDH0, and brahmax for lending me their time to test!
