Quote Originally Posted by Rongway View Post
The NPCs that have speech bubbles don't congregate in large groups and spam a bajillion chat messages per minute per person, though. This might sound like an absurd scenario, but sometimes players do absurd things, and any system that would handle speech bubbles would need to be prepared to handle this scenario, probably by limiting chat bubbles to the nearest X people, or to the most recent Y chat messages. Both of those options have costs though.

If you limit it to the nearest X people, you have to figure out who the nearest X people are. Say there are 47 people and you want to display chat bubbles over the nearest 10. There are 5,178,066,751 possible ways to select 10 people from a group of 47. If there are 71 people and you want to select the nearest 10, there are 461,738,052,776 possible combinations. You could probably optimize this by keeping a list of the nearest 10 people and their distances, and whenever someone new talks, you check to see if they're closer than any of the people on the list and bump the 10th person if they are, but then you have to store that list in memory, and the devs have historically been averse to making even small additions to the memory structure.

If you limit it to the most recent Y speech bubbles, then you could spend a lot of time processing speech bubbles that never even get seen because they're immediately overwritten by something more recent.
You mean how the game already limits names showing up by the nearest people? So they have drawn priority figured out already?
Also, how is it that something like WoW has this figured out but this doesn't?