Raise limit on the number of active Highlights

The Problem

As a Roblox developer, the current cap of 31 Highlight adorns active at a time has been very limiting to some of the things I’m trying to accomplish with the feature.

We have a house editor (currently unreleased) for our game that utilizes Highlight to mark multiple objects as selected. In the screenshot above, the floor is made up of tiled objects whose Parts are all in separate Models. I’m doing a floodfill selection of top-surface tiles that are brown and highlighting them as one unit.

Because of the 31 adornee limit, I currently have 3 options for handling this:

  1. Put a Highlight into each individual model
    (This hits the 31 adornee ceiling pretty fast, so obviously can’t do that)

  2. Clone all of the parts I want highlighted into a single container
    (Cloning a bunch of parts on demand like that is not ideal for performance)

  3. Temporarily move all of the parts I want highlighted into a single container
    (Mostly safe as long as the parts aren’t running interaction code, probably lots of risky caveats)

Currently I’m using the 2nd workaround, but it’s really awkward that I have to do this in the first place.


Possible Solutions?

While it’s not my job to offer a solution to this, I’d like to offer a couple potential ones worth considering.

  1. It would be cool if we could programmatically add and remove PVInstance targets onto a single Highlight instance. Maybe an API like this?
		Highlight:AddTarget(target: PVInstance) -> ()
		Highlight:RemoveTarget(target: PVInstance) -> ()
		Highlight:GetTargets() -> {PVInstance}
  1. Highlights that share the same visual properties should be unioned together under the hood to reduce the chances of hitting the 31 ceiling?

Whatever works, I just really hope we can see this addressed soon!

144 Likes

hopefully they just raise the limit to 120 instead of 31.

12 Likes

Why is there even a highlight limit? There isn’t a part limit, or a billboardgui limit, or any limits, really. Roblox states that it’s for “performance,” but it’s dumb to arbitrarily limit developers like this, especially for PC-only “experiences,” where stronger hardware is present.

12 Likes

As far as I understand, this is a deep technical limitation likely related to the number of bits in a number used in some implementation detail for this feature, or else tangentially related. A single outline shader typically requires an input texture with all of the geometry to be outlined rendered to it, so an outline shader that supports multiple outline groups probably requires an input texture with multiple groups rendered to it, so each group in this texture would need to be rendered with separate values (e.g. red channel pixels being 0.1, 0.2, 0.3, etc as a simplified example), but a pixel in a memory-optimized texture only supports so many values + there are other implementation details that can introduce problems. Just speculation of course, but likely a close reason why this is not trivial.

It would likely significantly increase memory footprint just to double the limit (at least on mobile devices, but allowing these to have different limits breaks a lot of developer expectations and is bad), not to mention complicate the programming behind the scenes which also likely comes with a non-negligible performance cost.

If you look at the render passes in renderdoc, you can see that for DX11 the effect is generating an 8-bit red-channel-only stencil texture with all of the outline groups rendered to it with different R values according to depth from the camera, which relates to the speculation above.

13 Likes

The value of 31 (which is 2^5 - 1) is also a hint that this is likely a technical limitation in their graphics pipeline currently and so not necessarily trivial to increase.

10 Likes

YES YES YES.

Sucks to put all my objects in one model under one highlight. Feels like a hacky technique from 2016.

2 Likes

I was in the same mind-set when I read about the Highlight limit until I found out that it’s not about the number of objects you put it on, but the number of highlight objects itself that exist. Knowing that, I don’t see a reason to increase the limit since that is basically an unlimited number of objects in 31 different colors if you prefer. I wouldn’t object to the limit being raised, but I don’t see any technical reason why needing more than this number would be useful?

3 Likes

Bump, still waiting for this. We need a higher limit.

5 Likes

I need highlights to indicate that what the player is hovering over is interactable. At any given time, almost all of my Highlights have their transparency values set to 1 to indicate that they are off. I built my game around this instead of Instantiating them Destroying them (as I should have) but it turns out that a lot of people want to use this for X-Ray vision for locating teammates and stuff, which requires as many highlights as there are players.

1 Like

Hi

Having a higher limit in game would be nice, but since it’s been a while since OP -without any reply- I’m not that hopeful for it.
Any chance the limit can be increased for studio only?
If it’s a (mobile) performance limitation, then it might work for studio where everyone uses a relatively powerful PC?
Looking to use highlights in a plugin. Current workaround would be to dynamically adjust the highlighted parts, which is definitely not ideal for my usecase.

Thanks

3 Likes

That’s definitely a solid point
It would help a ton of plugins if the limit were raised only for Studio.

1 Like

There is a workaround for this.
Make a dictionary defining all the initial parents of the objects a player selected. Then, make a temporary folder and parent all the selected parts to it and add a highlight in that folder. Since it’s only 1 highlight, there is no limit to how many parts you can highlight at once with this method. If an object is deselected, you can fetch it’s parent from the dictionary and parent it (I would suggest creating a fallback system to avoid unexpected errors due to lag spikes, high ping etc.)

Please mark this as the solution if it works out for you.

This however also disallows you from customising colors of those highlighted parts as they must all use the same highlight properties, all of the highlights are treated as one (so there isn’t any border where two different objects overlap) and is also a pain to pull off, requiring you to basically design your game around the limitation. This workaround is infeasible for those reasons.

1 Like

You can make separate highlights if you need different colors. You would almost never need 31 colors.
Also, setting the OutlineTransparency property to 1 will fix the border problem. If having the outline is a really preferred stylistic choice, there is no workaround for overlapping borders; it’s just one of the cons that come with using Highlights.

This wouldn’t be an issue if this feature request were to be implemented though, hence why the workaround isn’t feasible in the cases I listed.

That’s true, but we all know Roblox. They take 5 years to fix simple bugs despite being aware.
It’s more logical to use workarounds than to wait for bug fixes, since if you do, your game won’t be coming out in a million years.

Plus, you could always code the workaround as a “outcast”, meaning only the bare minimum game mechanics rely on it, and it can easily be removed without affecting a lot of the game’s code.

I’m gonna bump this again. I think Highlights need much more attention. The Highlight Instance was added 3 years ago and it still feels like an unfinished beta feature.

The arbitrary limit of 31 is super annoying, especially in my experience where visual feedback in PvP is very important.

The fact that this workaround exist shows that the engine is clearly capable of rendering over 31 highlights at once. If the limit can’t simply be removed, OP’s idea for the AddTarget API would also work just fine.

There is also a long-standing issue where if a model with a Highlight under it is streamed out and streamed back in, the Highlight will be rendered over the entire Workspace, even if the Highlight instance is destroyed.

Unrelated, but an “OutlineThickness” property would also be very useful.

2 Likes

Unfortunately all the pleas for more highlights are falling onto deaf ears at the moment because of Roblox holding onto an old rendering API for no reason.

(Before I continue, it’s worth noting that the hack with highlights in models is only a partial workaround, it’s still 1 highlight to the renderer which causes overlapping outlines to stop rendering completely.)

In order for there to be more than 31 highlights, Roblox seems to have decided that it needs to be possible on all platforms.

The limit of 31 highlights is trivially increased for PCs, it can be increased slightly less trivially for consoles, for mobile? Yep, that’s it. Roblox limiting features for everyone because of mobile, which is a pattern I wish we could see some kind of resolution for.

Mobile uses a completely different method of rendering highlights compared to PC, which is much faster, but comes with a few concessions (This is also why we don’t have outline thickness, the optimizations they made make outline thickness not possible on mobile).

Now, newer mobile devices? More than 31 highlights is possible (if slightly dicey). However, Roblox features have their rendering limits defined by the weakest link in the chain for the most part, and that 31 highlight limit is a fundamental limit of our wonderful friend OpenGL ES 2.0.

Without going too deep into it, OpenGL ES 2.0 is one of the reasons why the renderer hasn’t been getting a lot of things. It has been antiquated for more than 12 years, but Roblox will not stop using it. They said they would on March 1st of this year, but ended up not going through with it.

It would also maybe be possible to unify the mobile and PC highlight rendering methods to allow outline thickness to be done as well if they removed it.

I understand that accessibility is important for the platform, but I don’t think I’m being unreasonable when I say that if Roblox really needs to keep OpenGL ES 2.0 that badly, why can we not just get increased highlight limits for everyone else, and keep legacy behavior on the less than 1% of devices?

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.