reckfellENGINE

Where state belongs: Entity, Resource or Autoload

Choose data lifetime and mutation ownership; a shared session need not own the whole project.

On this page

Start with lifetime

Data/behaviorSuitable location
One enemy health or local animationAn Entity/component inside its prefab
Mission objectives or current-level enemy listsA level controller
Run score crossing level boundariesAn explicit session service outside the replaced root, such as Autoload
A configurable weapon/material descriptionA Resource with clear sharing policy
Data surviving process exitA serialized schema in user://

Autoload creates an object at startup that survives CurrentScene replacement; it is not a mandatory home for every manager. A persistent application root can also organize long-lived objects. Make the intended lifetime explicit.

Control mutation

SessionState offers AddCoins/ResetRun and reports CoinsChanged. The HUD displays state and disconnects on exit. The service knows no UI path; levels should not rewrite arbitrary service internals.

For local behavior, GroupTarget2D works without GetParent or a global service: an external controller supplies ApplyDamage. The fixture creates a receiver without a parent. The group remains a dynamic set rather than a type-safe interface.

What a container choice does not solve

A Resource can be shared between instances. Do not store per-enemy mutable health in one shared configuration resource unless shared results are intentional. See Resources for loading and copying.

Autoload does not persist data to disk, make access thread-safe or prevent a second class instance. Disabling _Process does not block its methods. Application logic also defines network authority and command validation.

Verify the boundary

  1. Instantiate a component outside its large level: it works or explicitly reports a required dependency.
  2. Delete and recreate a level: local data resets, while session data survives only as intended.
  3. Detach and reattach the HUD: updates arrive once and the initial value is reread.
  4. Start a new run: an explicit command resets shared state rather than an accidental level reload.

These cases run with SessionState/SessionHud and GroupTarget2D. They establish those components boundaries rather than universal superiority of one architecture pattern.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.