Stamp - Tag-Driven Entity Component System(ECS)

What is the Stamp Library?

Stamp is a Roblox Luau library that sits on top of CollectionService and transforms its raw tagging system into something fully managed and reactive.

To understand why it exists, you need to understand the problem with CollectionService on its own. The API itself is simple: you give an instance a string tag, and you can listen for when instances gain or lose that tag. But the moment you start using it in a real game, the bookkeeping becomes painful. For every tag you care about, you have to manually connect the added and removed signals, maintain your own table of which instances are currently live, and — critically — disconnect every event, stop every loop, and cancel every task the moment a tagged instance is removed. Miss any of those cleanup steps and you have a memory leak. Do this across a dozen systems and the cognitive overhead becomes enormous.

Stamp removes all of that burden. When you call Stamp.Register(“Enemy”), it returns a StampStream — an object that is the single authoritative controller for that tag. The stream automatically listens for any instance that gains or loses the tag, and for each newly tagged instance it allocates a dedicated ReaperScope: a garbage-collection container that owns everything you create for that entity. When the tag is removed or the instance is destroyed, the scope is torn down in one synchronised operation — every connection disconnected, every loop stopped, every task cancelled — without you writing a single line of cleanup code.

The reactive side of Stamp is its Signals.Tagged and Signals.Untagged events. You connect to Signals.Tagged once, and your callback receives both the entity and its scope every time something is tagged — including entities that were already tagged before you connected, which are replayed immediately so you never miss them. Inside that callback, you use the scope to bind all the resources you create for that entity, and Stamp guarantees they live exactly as long as the tag does.

On top of the lifecycle system, Stamp adds an attribute layer. Rather than reading and writing Roblox instance attributes directly, you go through SetAttribute and GetAttribute on the stream. Stamp maintains an internal query index of every attribute it has written, which means you can call GetInstancesWithAttribute(“Health”, 0) and get back every dead entity in the stream instantly, without walking the workspace hierarchy. There are two scopes for this query: a stream-level one that searches only within a specific tag, and a global one that searches across every registered stream simultaneously.

There is also ObserveAttribute, which collapses three things that developers typically write separately — reading the current value, connecting a change listener, and cleaning up that listener — into a single call. The callback fires immediately with whatever the attribute currently holds, then fires again every time it changes. The connection is tied to the entity’s scope automatically, so it cleans up when the tag is removed.

Finally, for client-side streaming environments where StreamingEnabled means instances may not exist locally yet, Stamp provides AddTagDeferred, which polls a folder at regular intervals until the named instance streams in and then tags it automatically.

The broader architectural idea behind Stamp is the behavioural component pattern. Rather than writing a script that handles health logic for one specific NPC type, you register a single Health stream, define the behaviour once inside its Tagged callback, and then apply it by tagging anything that needs health — players, NPCs, props, vehicles, whatever. The stream does not care what type of entity carries the tag; it runs the same logic for all of them. One definition, universal application, zero duplication.

Documentation, Github


Releases:

Stamp v1.0.0 BETA (14.9 KB)

Release Note (April 20, 2026):
    * None (First Release)

Stamp v1.0.1 BETA (21.4 KB)

Release Note (May 25, 2026):
[Stamp Module]
    - [General] Periodic Update: Bug fixes and optimizations.

Stamp v1.0.2 BETA (22.7 KB)

Release Note (June 7, 2026):
[Stamp Module]
    - [Fix] Local cache out-of-sync: Resolved a replication desynchronization bug where the client's local attribute cache would serve stale data if the server overrode a previously tracked attribute. Implemented a memory-safe, jit-allocated background listener with an "Echo Cancellation" mechanism.
2 Likes