Lobby chat - player list (scroll list performance issues)

How would one make a player list for a lobby chat? It would have a lot of players online(and offline friends) where 1 player is 1 item on the list. I have tried to make a dynamic scroll list(created at runtime), but if there was more than 100 items I started to experience performance issues, not to mention having a list of 1000+ players.

Also, I would want to have tabs on this lobby chat, like ONLINE people and FRIENDS which would both be producing it’s own lists. Does that mean whenever I click on one of those tabs, the list gets recreated? Wondering if there’s a workaround in this because the list repopulation is also very hard on the performance.

Basically each of the items on the list should be interactable(click → open context menu → add as friend / join game / private chat). By lobby chat in here I mean just the player list, with a search option if possible(which would dynamically show matching player names).

In short, I know how to make a scroll list, but it’s too heavy on performance if having many items on it, so does anyone have a solution for it not be so hard or something other than having a scroll list but works like I have described above? All it matters that each player item is interactable, means I can open up a context menu based on each item data.

I don’t know if anyone ever tried to have over a 1000 items in a scroll list, but for me it’s a performance killer(it literally makes the game and UI not usable), and that’s not the case if using legacy gui or some other ui systems.

First off, I don’t have a specific solution.

My first suggestion would be to make sure that you are isolated your functionality to the most efficient possible. From reading this thread, I see multiple completely different uses for one item, that may be in conflict.

Turning to the closest massively multiplayer online game that I can at hand, I’m looking at GuildWars 2 [ArenaNet/NCSoft] (and just to be clear, this is not a game built in Unity, but I don’t see why you couldn’t…)

Looking at just the chat window -

Their chat is limited to about 200-250 messages:
Chat Panel 2059810--134134--Screenshot 2015-04-08 18.30.03.png

The only interactivity that there is in the chat window is a “tooltip” where you can see the meta-name of the character, and clicking on the name allows the player to “whisper” or “pm” that character.

When I made my chat window in EZGui, I did not have this functionality. I simply had a chat list, and I did this by keeping a collection of each chat message, but I only displayed one block by having one large scrolling UI item and I simply added the new message to the block of text at the bottom, and removed old messages from the block of text at the top. For various reasons, I don’t think this was the most screamingly efficient, as I needed to take lists of text and add them all together…

My gut instinct is that there is some sort of hyper-text or markup going on in this text that allows the linking of character names to the whisper function, but I don’t know for sure.

When it comes to Friend’s list and marking who’s online and who’s not… I would suggest doing that in a different window.

Going back to GW2, they have all of this separated out into their own windows:

One for the Guild -
Guild Panel

One for contacts and looking for group -
Contacts Panel

What I’m trying to get at here is that having 1000+ items in one scroll list that’s doing everything might be excessive.

Is there a way that you can control, contain, or limit the functionality of your interface to make it more manageable?

I could simply not have a lobby chat room with all the players inside. But I still need the ability to pm friends or add people as contacts. I think I will just have a search functionality to seek for players, because if there’s no solution for this I will have to cut it off my chat logic.

I will still have player statuses about who’s online and who isn’t, just I don’t want to make different windows for each of that, I’m rather thinking about having 1 panel which will have tabs for that. Statuses are the most important thing to me, as I want the player to be able to join his friend’s game or to send him a private message.

This brings me to something I don’t know how to make in uGui since I have never seen anyone making a context window. How would I open up a context window when I click on 1 item on the list which would have the functionality to add as friend or to send a private message? Technically it should have arguments for player name etc. from the selected player item in UI.

Created a request on the UI Extensions bitbucket repo to see if any of the community want to pick it up :smile:
https://bitbucket.org/ddreaper/unity-ui-extensions/issue/14/chat-window-control

You could look at the live training sessions on making a modal window. You could adapt that idea where you have a generic window that gets activated, positioned and populated when you click on the appropriate part of the window.

When it comes to the list (and I still can’t think of examples with thousands of entries… Do you have any examples?) have you profiled the list to see what’s taking all the resources?

This is what happens when I add 1000 items: Imgur: The magic of the Internet
This is the profiler: Imgur: The magic of the Internet

I can think of many examples where there’s a need for big lists; I have played some game which had friend requests, and all it’s ui was made in legacy gui. I could have over 1000 friend requests on 1 list without noticing any performance issues. Some other example would be a room list on a game server, where there was 100+ games on a list, and so on.

Maybe I won’t use a list like this in a chat, but I will have to use it in a room browser, as I don’t see any other way.

It’s odd that this only happens with uGui.

Any news about this? I still haven’t made a workaround for the list. Would be great if this bug with uGui would be fixed somehow.