> For the complete documentation index, see [llms.txt](https://roogame.gitbook.io/roogame/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roogame.gitbook.io/roogame/roo-gameplay-framework/status-effects/stacking-duration-and-ui.md).

# Stacking, Duration and UI

Status Effects support configurable stack timing and overflow behavior.

## Duration modes

Independent Per Stack gives every stack its own start time and duration. Stacks can expire separately.

Shared By All Stacks gives the entire effect one shared timer.

Shared duration can use:

* Never Refresh
* Refresh On Add

Shared expiration policies:

* Remove Expired Stack: remove one stack when the shared timer expires.
* Clear Entire Stack: remove all stacks.
* Remove One And Refresh Duration: remove one stack and restart the shared timer while stacks remain.

## Overflow policy

When the effect is already at Max Stack:

* Reject New Stack: ignore the new stack.
* Refresh Duration Only: keep the stack count and refresh timing when permitted.
* Replace Oldest Stack: remove the oldest stack and add the new one.

On Status Effect Refreshed is broadcast when Refresh Duration Only handles an application.

## Tick execution

Tick Interval of 0 disables periodic execution.

Tick Execution Policy:

* Once Per Stack: every stack executes Tick behavior.
* Once Per Effect: the active effect executes once per period regardless of stack count.

Period Reset Policy controls whether adding a stack restarts the Tick period:

* Never Reset
* Reset On Add

Choose Once Per Stack when stack count should multiply periodic impact. Choose Once Per Effect when stacks change strength through a Formula or action value but should not create extra Tick calls.

## UI progress

Per-stack nodes accept Stack Index:

* Get Status Effect Remaining Time
* Get Status Effect Progress

Progress is 1 when freshly applied and approaches 0 at expiration.

For one icon representing the whole effect, use:

* Get Status Effect Display Remaining Time
* Get Status Effect Display Progress

Shared duration always uses the shared timer. Independent duration uses Display Progress Policy:

* Next Stack Expiration
* Entire Effect Lifetime

The display nodes remove the need for UI to choose a stack index.
