[Fix in future release] Can't named more than 16K entities in editor

Hello there,

I reach again an “hard limit” from unity.
Previously, I had report a bug which demonstrate reaching x entities renamed breaks editor.
QA says to me it’s not normal to renamed so many entities and they anyway increase this amount to 16k.

But now I reaching again this limit :frowning:
So guys, for debug purpose is it okay to name your entities ? and if not how do you inspect
entities in ‘Entity Debug’ ?
It seems to me than naming 16k entities is not so much :confused:

The QA answer (2020/02) :

Thanks for reporting the issue. After an investigation, I’ve found that this is due to reaching a maximum entry limit of 10000 for a Unity.Collections.WordStorage Collection that EntityManager.SetName functionality relies on.
The entry limit will be increased to 16384 and documentation to reflect this limit will be updated at Struct Words | Collections | 0.5.2-preview.8 with the next package version release.
To work around your issue in the meantime, I suggest revising the method used to create Entities because multiple Entities are actually being generated and named

@raymondyunity sorry for the ping but can you give your point of view on that

I suggest to use prefab entity, with defined name. Then when instantiate from prefab, all new entities will have prefab’s name. This is for convenience in debugging. But you really should use entity filter. When looking for specific entities in debugger, use Entity index and components tags, to filter archetype.

Don’t try to give unique names, to each of 16k+ entities. They have unique index already.

Optionally, if looking for some specific order of entities, store them in dynamic buffer of other entity. Or store in native array for example, and use VS debugger break point, to investigate current values status.

Of course, you can use debuuger, log, to print out specific entities, which are met conditions. I. E. Using if statement, to filter what you need.

You will have the same problem, it’s not a bug from how you set your name but how they are stocked

I have edited my post, by debugging I mean inspect. Because have 15K,100K or even more entity with just ID is not useful most of the time :confused:

I mean, I can name things just fine. But of course, nothing like 16k+ unique names.
I don’t see use for such, since searching through 16k+ unique names, is just ridiculous job.
So need to figure out, other more optimal means of debugging.

6916895--811352--upload_2021-3-9_15-38-12.png

Searching ID, is not any harder, than searching a name.
But of course, may not be in order.
Just print to console the index + optional name of interested entity to debug and as I mentioned. Add filters components, to reduce number of entities in debugger window.

For example, if I want exploded projectiles, then I set such tag.
If I want alive projectile, then I add such component.
If I want mar them as spare, I use spare tag component.
And so on.
With components tags filters, I reduce number of entities to search through, if I need to inspect them.

Then you should be good to go. :slight_smile:

I can search by entity name but not by ID even in the new debug window.
16K is not at all a big number :confused: half come from prefab conversion; the other half create at runtime by me. it’s quicl to fill this number.

I use this way for debugging too so we agreed on that ^^
But I don’t understand why I have to not name the Xth children of a mesh which have his name in the scene before conversion for example :confused:

Hi, thanks for reaching out about this.

We are already tracking this 16k names limit internally and while it’s not been prioritized yet, it’s something we will end up addressing.

In the meantime, what I can suggest is to use query filters and if you know the ID of the Entity you are looking for, you can find it kind of easily by searching for it as a string (as long as it doesn’t have an actual name). For example: c:MyComponent 1001 (Where MyComponent is whatever component you’re interested in and 1001 is the ID you are looking for.)

This solution is not perfect, but we’re working on it and it will get better in the future.

1 Like

ah it’s nice to hear that, thanks :slight_smile:

I don’t mean that 16k is large or not. I mean that 16k for debugging and trying inspect them is ineffective job.
But since

So you narrow entities count for debugging already.

You haven’t specified earlier, that you are using entity conversion. So I couldn’t know.
I don’t know your specific scene setup.

1 Like