Brand New Bubble Chat Customizations

I would like to be able to modify the background color of the bubble chat to the team’s color if the message is within team-chat, if not in team chat it would stay as the default color. This would help players identify if a message sent is in team chat or not.

1 Like

Some examples I can think of:

  • Changing the customization depending on where the NPC/User is located. (For example different levels/worlds/lighting settings.)
  • Changing the customization depending on the mood of the NPC to convey them more easily, like a red message box showing the NPC is angry/disapproving vs a green one being more approving.
  • Allowing you to do things like exclusive chat effects where the chat box changes shape or colour in a sort-of animation, for example rainbow chat.

I know you could change the settings before sending each message, but I can imagine that creates a lot of overhead especially with more animated systems, as you’d have to change the entire customization table for the entire client for each individual message. And, another problem with that is possible race conditions, especially with the new up-coming truly parallel luau.

A simply solution would be allowing us to pass along a customization table with the :Chat() function, the API of which would look like this:
void Chat(Instance partOrCharacter, string message, Dictionary appearance)

And used like this:

chatService:Chat(adornee, "Hello world!", {
    TextColor3 = Color3.new(1, 0, 0),
    TextSize = 24,
    Padding = 12,
    BubblesSpacing = 8
})

Or you could store the table somewhere and swap between presets based on certain variables being at play.

17 Likes

Great! How would you make team-specific settings with this update, or this still currently not possible?

2 Likes

This is a great and useful change and will definitely benefit us in one way or another!!

Much love to the hardworking DevRel team :heart:

You can now! Here’s an example (local) script that makes every player’s bubble have the same background color as their team’s color.

local Chat = game:GetService("Chat")
local Players = game:GetService("Players")
local bubbleChatSettings = {
	UserSpecificSettings = {}
}

local function onPlayerAdded(player)
	-- The lines below change the color of chat bubbles only for the player passed as an argument
	bubbleChatSettings.UserSpecificSettings[player.UserId] = { BackgroundColor3 = player.TeamColor.Color }
	Chat:SetBubbleChatSettings(bubbleChatSettings) -- Applies the new settings table
	player:GetPropertyChangedSignal("TeamColor"):Connect(function() -- Also update when the player's team changes
		bubbleChatSettings.UserSpecificSettings[player.UserId] = { BackgroundColor3 = player.TeamColor.Color }
		Chat:SetBubbleChatSettings(bubbleChatSettings)
	end)
end

local function onPlayerRemoving(player) -- When a player leaves, we need to clear their settings
	bubbleChatSettings.UserSpecificSettings[player.UserId] = nil
	Chat:SetBubbleChatSettings(bubbleChatSettings)
end

for _, player in ipairs(Players:GetChildren()) do -- Registers players who were in the game before we joined
	onPlayerAdded(player)
end

Players.PlayerAdded:Connect(onPlayerAdded) -- Listens for incoming players
Players.PlayerRemoving:Connect(onPlayerRemoving) -- Listens for leaving players
9 Likes

Thank you all for your ideas on what a more granular “per-bubble” customization system could bring to the table. Can’t promise anything, but I’m definitely taking notes!

8 Likes

With the implementation of video frames, would it be possible to allow us to change the background to a video instead of a static image as well? If ever in the future we’re allowed to upload our own, I could imagine some cool effects being made with the use of video frames as the background. For example a chat box that has an animated bubbly background in an underwater setting.

This would be something for the future, if we’re ever even going to be able to upload videos ourselves, but still cool nonetheless.


Honestly great update though, the fact I’m spurting out ideas proves I’m excited about the change and possibilities, keep em coming.

2 Likes

Really great update! I plan on using this later when I start making the multiplayer mode.

Suggestion:

Can there be StrokeColor3(Color3) and StrokeSize(Number) properties for bubble chat?

2 Likes

im talking about this chat right here that i’m referring to
image
at first when i saw the topic, i thought the chat shown on the pictures were going to be the new bubble chat to replace the current bubble chat we have today until i looked more into the topic to find out that it was actually about customization features for the bubble chat like backgroundimage or backgroundgradient and stuff like that

2 Likes

I love the fact that you’re increasing the amount of customisation options for the new bubble chat, but it would be nice, if we could get a version of the chat that doesn’t hook into RobloxScriptSecurity functions so we can fork it.

Nope, its a LocalScript you can edit, so you can fix any part of it’s bugs. I also find it funny how the old bubblechat has slowly been breaking itself.

1 Like

I’ll admit, I’m cozying up to the idea of the Roact bubble chat system a little more now, but I am still greatly disappointed with the decision to pull back the bubble chat script from a developer-facing script to a CoreScript just to access some libraries in CorePackages. I really hope that Roblox will be able to move this back to a developer-facing script if by some miracle in the future package management exists such that the bubble chat script can exist in our space while accessing internal libraries.

Echoing some other fellas here though, I would love the decision to modify the behaviour a lot more deeply according to the ChatService API. The reason I still prefer maintaining the old bubble chat script is because I have a lot more control over its behaviours and have accordingly implemented such behavioural modifications in a few games I’ve worked in before. Such examples:

  • Per-user bubble chat colours for the sake of differentiating important people :ballot_box_with_check:
  • Ability to change colours to indicate a user’s speaking channel - global, team and whisper
  • Full control over rendering and styles (are the new options sufficient enough to make crisp bubbles and not a cartoony feel?) :orange_circle:
  • Ability to build on the rendering process according to my own methods on the ChatService (e.g. direct control over colouring, networking, etc)

The API for this seems a little weird, for example. Every time you want to update a user’s specific bubble chat colouring settings you have to update the entire bubble chat settings. Wouldn’t it be more intuitive to call a method that only updates a user’s specific settings?

9 Likes

That biggest use case for me is team-chat/whisper-chat. In the current state my players can’t distinguish if a message is from a team-chat/whisper-chat, or a global chat making it hard for them to reply appropriately.

Even if don’t add customization per bubble at least differentiate team/whisper bubbles from the default theme by the team color or something by default.

2 Likes

Interesting! For now though, I believe there are technical limitation that strongly limit the amount of VideoFrames that can be displayed on the screen

Agreed that it would make sense to have these in the customization system. Will check to see if we can add those to the next batch of new settings!

Just to confirm, we’re not changing at all the default look of bubble chat, all of these customization options are purely optional

6 Likes

I love these additions, they add a whole bunch of flexibility that wasn’t there before. However, I did run into a weird detail last night that I didn’t like.

I tried to add UserSpecificSettings according to the custom character each player ingame was using by updating the UserSpecificSettings table every time somebody spawned. This was so I could set the AdorneeName appropriately for their character.

I did this instead of picking one adornee name and adjusting every character because if the adornee does not exist, there is no fallback and bubblechat does not work, and I don’t want to introduce bugs by expecting I add this adornee to every new character; a module that defines the adornee name is much more visible to me when creating content. I suppose this is useful if you want to turn off bubblechat for a player, so I wouldn’t suggest changing this unless another way to do this was added as well.

I found that the UserSpecificSettings table is not an override of the settings the developer has set for the bubblechat, but reverts to the default settings and you need to specify an entire table of settings for each player. This seems really unexpected and adds unnecessary cruft to my code because I now need to clone the entire settings table and add my tweaks to it for each character.

Wouldn’t this be better if the UserSpecificSettings feature simply applied the table on top of the settings the developer has set for the bubblechat? The Developer Hub also says that this should contain override settings. If I have a fully customized bubblechat, intuitively I would expect this to apply overrides on top of the settings I’ve defined for my game.

10 Likes

So, are they actually gonna display whole messages now instead of cutting out at a certain point?

3 Likes

Glad to see more customizability with chat! This will make great use to all sorts of game styles I desire.

1 Like

Perhaps it could have an impact on games that focus on player-player interactions (cafe type areas). Here are a few examples I’ve thought of off the top of my head.


Example 1
A player might monologue for a bit, leaving a long lasting text box which can be followed by two quick and short sentences which might want to be bolded for extra emphasis. For example:

Message 1: “I need you to go and stop those runaway thieves! They are stealing all my gold! It’s all I’ve got left!”
Message 2: “GO NOW!”

With the first message, it shouldn’t have a strong emphasis on each word. However, the second message should have extra emphasis, such as bolded text. It would be important to see both messages at the same time, but with different styling for each message.

Example 2
This is rather a slew of examples but they all have the same idea. The intended meaning of a message can change from one to another quickly, and separate styles for each of these intended meanings could lead to more impactful and engaging experiences.

  • If someone ends a sentence with three periods (…), then the message should hang in the air longer than other messages. “Well.” and “well…” should hang in the air for different amounts of time.
  • Longer messages should hang in the air longer than shorter messages.
  • Messages that begin with a “STOP” should be placed with higher emphasis. The messages after that (assuming those messages are intended to have less influence) should not.

Example 3
This example has to do with rapid changes in environment. If you were to be chatting with an NPC and they were to do something “creepy” momentarily, then the message that they send should be styled as such. Messages sent before or after the NPC does such an action should be be stylized in the same way.


This is by no means an exhaustive list, but there are at least a few instances in which it could be helpful.

4 Likes

I appreciate the customizability of the new chat bubbles. I will be soon to implement this.

One question: when using new chat bubbles, will you be able to apply the same to Non-Player Characters?

2 Likes

I encountered this just now. In Databrawl Roleplay, players have the ability to change thir “PlayerColor” value at will. I was expecting this to simply color their chat bubbles accordingly, but each time someone did, every other chat bubble for every other player was set to default.
This is incredibly frustrating as you can imagine, as a super table of every available player ingame now has to be made, as well as adding and removing new values each time a player joins or leaves.

1 Like

To put it simply, it would be nice if the function worked as it describes on the wiki, without this highlighted section.

3 Likes