Groups let you create isolated replication namespaces within a single feces instance. Each group has its own entity lookup table, so you can callDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/NeonD00m/feces/llms.txt
Use this file to discover all available pages before exploring further.
feces:delta(group) to get only the changes for entities that belong to that group. Entities not in the group are skipped entirely during the delta pass, keeping packets small and targeted.
Why Use Groups?
By default,feces:delta() tracks all replicated entities in one flat namespace. Groups let you split that tracking by any logical boundary that makes sense for your game:
- Streaming zones — only replicate entities in the zone a player is currently in.
- Dungeon instances — give each dungeon its own group so players only receive updates for the instance they are inside.
- Team or region partitions — send different subsets of the world to different sets of players.
feces:delta(). Groups push that filtering into feces itself, so the delta pass never even considers entities outside the target namespace.
Creating a Group
Usefeces.reserve(size) to allocate a new group. reserve is a module-level function, not an instance method.
reserve returns a Group table with the following fields:
| Field | Type | Description |
|---|---|---|
origin | string | Debug location string (script name + line number) where the group was created. |
size | number | Maximum number of entities the group was pre-allocated for. |
lookups | table | Maps LocalEntity → LookupEntity (index into refs). |
refs | table | Array of LocalEntity values in insertion order. |
Adding Entities to a Group
Usefeces:setGroup(group, entity) to move an entity from the default feces namespace into a group. Note the argument order: group first, entity second.
setGroup, the entity is tracked in group.lookups and group.refs, and is removed from the default feces lookup tables.
Getting an Entity’s Group
Usefeces:getGroup(entity) to retrieve the group an entity currently belongs to. If the entity has not been assigned to any group, it returns the feces instance itself (the default namespace).
Getting the Delta for a Group
Pass the group tofeces:delta(group) to get only the changes for entities inside that group.
feces:delta() without an argument returns changes for entities in the default namespace only. Entities assigned to a group are excluded from the default delta pass.
Moving Entities Between Groups
feces:setGroup also handles moving an entity from one group to another. Calling it with a different group removes the entity from its current group and registers it in the new one.
groupA.lookups[entity] and groupA.refs no longer contain the entity. The next call to feces:delta(groupA) will not include it; feces:delta(groupB) will.