Categories
entity systems programming

Entity ID’s: how big, using UUIDs or not, why, etc?

This has come up a few times, and I ended up replying on Twitter:

But that’s a crappy way to find things later, so I made a quick-and-dirty infographic with a few key points:

Docs-entityID

2 replies on “Entity ID’s: how big, using UUIDs or not, why, etc?”

Depends how many partitions you need for your data.

Some people use some of their bits to indicate e.g. groups of entities for culling.

For performance reasons, it can help to indicate similarity of “components I expect this entity to accumulate” (enables the component store to aggressively clump those entities’ components together in memory).

…etc.

I’m merely pointing out that even with 32bits, in many games you may not need the full 32bits for local indexing, and could split the bits into more useful sub-counters.

(and/or you could re-map them a second layer internally within a given system, e.g. a particle system)

Comments are closed.