Skip to content

sonolus.script.archetype

ArchetypeLife = LifeInfo module-attribute

Alias for LifeInfo, kept for backwards compatibility.

AnyArchetype = PlayArchetype | WatchArchetype | PreviewArchetype

Union of all archetype types.

EntityRef

Bases: Record

Reference to another entity.

May be used with typing.Any to reference an unknown archetype.

Usage
ref = EntityRef[MyArchetype](index=123)

class MyArchetype(PlayArchetype):
    ref_1: EntityRef[OtherArchetype] = imported()
    ref_2: EntityRef[Any] = imported()

__pos__() -> Self

Return a copy of the record.

archetype() -> type[A] classmethod

Get the archetype type.

archetype_matches(strict: bool = False) -> bool

Check if entity at the index is of this archetype.

Parameters:

Name Type Description Default
strict bool

If true, only returns true if the entity is exactly of this archetype. If false, also returns true if the entity is of a subclass of this archetype.

False

Returns:

Type Description
bool

Whether the entity at the given index is of this archetype.

frozen(*args: P.args, **kwargs: P.kwargs) -> Self classmethod

Create a frozen record instance.

Numeric fields in the record will not be writable. However, nested values such as other records may remain mutable.

Parameters:

Name Type Description Default
*args P.args

Positional arguments for the record constructor.

()
**kwargs P.kwargs

Keyword arguments for the record constructor.

{}

Returns:

Type Description
Self

A frozen record instance.

get(*, check: bool = True) -> A

Get the entity this reference points to.

Parameters:

Name Type Description Default
check bool

If true and runtime checks are enabled, asserts that the referenced entity is of this archetype or of a subclass of this archetype. If false, no validation is performed.

True

Returns:

Type Description
A

The entity this reference points to.

get_as(archetype: type[_BaseArchetype]) -> _BaseArchetype

Get the entity as the given archetype type.

Not supported for a reference created by ref while building level data.

type_var_value(var: TypeVar) -> Any classmethod

Return the value of a type variable.

Parameters:

Name Type Description Default
var TypeVar

The type variable to get the value of.

required

Returns:

Type Description
Any

The value of the type variable.

with_archetype(archetype: type[T]) -> EntityRef[T]

Return a new reference with the given archetype type.

HapticType

Bases: IntEnum

The type of haptic feedback for a judgment.

HEAVY = 3 class-attribute instance-attribute

Heavy haptic feedback.

LIGHT = 1 class-attribute instance-attribute

Light haptic feedback.

LONG = 4 class-attribute instance-attribute

Long haptic feedback.

MEDIUM = 2 class-attribute instance-attribute

Medium haptic feedback.

NONE = 0 class-attribute instance-attribute

No haptic feedback.

LifeInfo

Bases: Record

How an entity contributes to life.

good_increment: int instance-attribute

Life increment for a good judgment.

great_increment: int instance-attribute

Life increment for a great judgment.

miss_increment: int instance-attribute

Life increment for a miss judgment.

perfect_increment: int instance-attribute

Life increment for a perfect judgment.

__pos__() -> Self

Return a copy of the record.

frozen(*args: P.args, **kwargs: P.kwargs) -> Self classmethod

Create a frozen record instance.

Numeric fields in the record will not be writable. However, nested values such as other records may remain mutable.

Parameters:

Name Type Description Default
*args P.args

Positional arguments for the record constructor.

()
**kwargs P.kwargs

Keyword arguments for the record constructor.

{}

Returns:

Type Description
Self

A frozen record instance.

type_var_value(var: TypeVar) -> Any classmethod

Return the value of a type variable.

Parameters:

Name Type Description Default
var TypeVar

The type variable to get the value of.

required

Returns:

Type Description
Any

The value of the type variable.

update(perfect_increment: int | None = None, great_increment: int | None = None, good_increment: int | None = None, miss_increment: int | None = None)

Update the life increments.

Arguments left as None do not change the corresponding increment.

PlayArchetype

Bases: _BaseArchetype

Base class for play mode archetypes.

Usage
class MyArchetype(PlayArchetype):
    # Set to True if the entity is a note and contributes to combo and score
    # Default is False
    is_scored: bool = True

    imported_field: int = imported()
    exported_field: int = exported()
    entity_memory_field: int = entity_memory()
    shared_memory_field: int = shared_memory()

    @callback(order=1)
    def preprocess(self):
        ...

archetype_life: LifeInfo class-attribute

How entities of this archetype contribute to life depending on judgment.

archetype_score_multiplier: float class-attribute

Score multiplier for entities of this archetype.

This is additive with other multipliers (except judgment base multipliers).

despawn property writable

Whether the entity should be despawned after this frame.

Setting this to True will despawn the entity.

entity_life: LifeInfo instance-attribute

How this specific entity contributes to life depending on judgment.

This is additive with archetype_life - the total life increment is the sum of both.

entity_score_multiplier: float instance-attribute

Score multiplier for this specific entity.

This is additive with other multipliers (except judgment base multipliers).

id: int = 0 class-attribute instance-attribute

The id of the archetype or entity.

If accessed on an entity, always returns the runtime archetype id of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the id will still be the id of A.

index: int property

The index of this entity.

is_active: bool property

Whether this entity is active.

is_despawned: bool property

Whether this entity is despawned.

is_scored: bool = False class-attribute

Whether entities of this archetype contribute to combo and score.

is_waiting: bool property

Whether this entity is waiting to be spawned.

key: int | float = -1 class-attribute instance-attribute

An optional key for the archetype.

May be useful to identify an archetype in an inheritance hierarchy without needing to check id.

If accessed on an entity, always returns the runtime key of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the key will still be the key of A.

life: LifeInfo class-attribute

How entities of this archetype contribute to life depending on judgment.

Alias for archetype_life, provided for backwards compatibility.

name: str | None = None class-attribute

The name of the archetype.

If not set, defaults to the class name with the leading Play, Watch, or Preview prefix for this archetype's mode removed, if present.

The name is used in level data.

result: PlayEntityInput property

The result of this entity.

Only meaningful for scored entities.

at(index: int, check: bool = True) -> Self classmethod

Access the entity of this archetype at the given index.

Parameters:

Name Type Description Default
index int

The index of the entity to reference.

required
check bool

If true and runtime checks are enabled, asserts that the entity at the index is of this archetype or of a subclass of this archetype. If false, no validation is performed.

True

Returns:

Type Description
Self

The entity at the given index.

derive(name: str, is_scored: bool, key: int | float | None = None) -> type[T] classmethod

Derive a new archetype class from this archetype.

Roughly equivalent to returning:

class Derived(cls):
    name = <name>
    is_scored = <is_scored>
    key = <key>  # Only set if key is not None

This is used to create a new archetype with the same fields and callbacks, but with a different name and whether it is scored. Compared to manually subclassing, this method also enables faster compilation when the same base archetype has multiple derived archetypes by compiling callbacks only once for the base archetype.

This cannot be called on an archetype that was itself created by derive.

Parameters:

Name Type Description Default
name str

The name of the new archetype.

required
is_scored bool

Whether the new archetype is scored.

required
key int | float | None

A key that can be accessed via the key property of the new archetype.

None

Returns:

Type Description
type[T]

A new archetype class with the same fields and callbacks as this archetype, but with the given name and

type[T]

whether it is scored.

initialize()

Initialize this entity.

Runs when this entity is spawned.

is_at(index: int, strict: bool = False) -> bool classmethod

Return whether the entity at the given index is of this archetype.

Parameters:

Name Type Description Default
index int

The index of the entity to check.

required
strict bool

If true, only returns true if the entity is exactly of this archetype. If false, also returns true if the entity is of a subclass of this archetype.

False

Returns:

Type Description
bool

Whether the entity at the given index is of this archetype.

preprocess()

Perform upfront processing.

Runs first when the level is loaded.

ref() -> EntityRef[Self]

Get a reference to this entity.

Valid both in level data and in callbacks.

should_spawn() -> bool

Return whether the entity should be spawned.

Runs each frame while the entity is the first entity in the spawn queue.

spawn(**kwargs: Any) -> None classmethod

Spawn an entity of this archetype, injecting the given values into entity memory.

Entity memory fields not passed as keyword arguments are initialized to zero.

Usage
class MyArchetype(PlayArchetype):
    field: int = entity_memory()

def f():
    MyArchetype.spawn(field=123)

Parameters:

Name Type Description Default
**kwargs Any

Entity memory values to inject by field name as defined in the archetype.

{}

spawn_order() -> float

Return the spawn order of the entity.

Runs when the level is loaded after preprocess.

terminate()

Finalize before despawning.

Runs when the entity is despawned.

touch()

Handle user input.

Runs after update_sequential each frame.

update_parallel()

Perform parallel actions for this frame.

Runs after touch each frame.

This is where most gameplay logic should be placed.

update_sequential()

Perform non-parallel actions for this frame.

Runs first each frame.

This is where logic affecting shared memory should be placed. Other logic should typically be placed in update_parallel for better performance.

PlayEntityInput

Bases: Record

The judgment result recorded for an entity in play mode.

Accessed as result on a scored entity, and written to in order to report how the entity was hit.

accuracy: float instance-attribute

The accuracy value recorded for the entity.

bucket: Bucket instance-attribute

The Bucket the entity's result is recorded in.

bucket_value: float instance-attribute

The value recorded in bucket, shown with that bucket's unit.

haptic: HapticType instance-attribute

The HapticType of haptic feedback for the entity.

judgment: Judgment instance-attribute

The Judgment recorded for the entity.

__pos__() -> Self

Return a copy of the record.

frozen(*args: P.args, **kwargs: P.kwargs) -> Self classmethod

Create a frozen record instance.

Numeric fields in the record will not be writable. However, nested values such as other records may remain mutable.

Parameters:

Name Type Description Default
*args P.args

Positional arguments for the record constructor.

()
**kwargs P.kwargs

Keyword arguments for the record constructor.

{}

Returns:

Type Description
Self

A frozen record instance.

type_var_value(var: TypeVar) -> Any classmethod

Return the value of a type variable.

Parameters:

Name Type Description Default
var TypeVar

The type variable to get the value of.

required

Returns:

Type Description
Any

The value of the type variable.

PreviewArchetype

Bases: _BaseArchetype

Base class for preview mode archetypes.

Usage
class MyArchetype(PreviewArchetype):
    imported_field: int = imported()
    shared_memory_field: int = shared_memory()

    @callback(order=1)
    def preprocess(self):
        ...

id: int = 0 class-attribute instance-attribute

The id of the archetype or entity.

If accessed on an entity, always returns the runtime archetype id of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the id will still be the id of A.

index: int property

The index of this entity.

key: int | float = -1 class-attribute instance-attribute

An optional key for the archetype.

May be useful to identify an archetype in an inheritance hierarchy without needing to check id.

If accessed on an entity, always returns the runtime key of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the key will still be the key of A.

name: str | None = None class-attribute

The name of the archetype.

If not set, defaults to the class name with the leading Play, Watch, or Preview prefix for this archetype's mode removed, if present.

The name is used in level data.

at(index: int, check: bool = True) -> Self classmethod

Access the entity of this archetype at the given index.

Parameters:

Name Type Description Default
index int

The index of the entity to reference.

required
check bool

If true and runtime checks are enabled, asserts that the entity at the index is of this archetype or of a subclass of this archetype. If false, no validation is performed.

True

Returns:

Type Description
Self

The entity at the given index.

derive(name: str, is_scored: bool, key: int | float | None = None) -> type[T] classmethod

Derive a new archetype class from this archetype.

Roughly equivalent to returning:

class Derived(cls):
    name = <name>
    is_scored = <is_scored>
    key = <key>  # Only set if key is not None

This is used to create a new archetype with the same fields and callbacks, but with a different name and whether it is scored. Compared to manually subclassing, this method also enables faster compilation when the same base archetype has multiple derived archetypes by compiling callbacks only once for the base archetype.

This cannot be called on an archetype that was itself created by derive.

Parameters:

Name Type Description Default
name str

The name of the new archetype.

required
is_scored bool

Whether the new archetype is scored.

required
key int | float | None

A key that can be accessed via the key property of the new archetype.

None

Returns:

Type Description
type[T]

A new archetype class with the same fields and callbacks as this archetype, but with the given name and

type[T]

whether it is scored.

is_at(index: int, strict: bool = False) -> bool classmethod

Return whether the entity at the given index is of this archetype.

Parameters:

Name Type Description Default
index int

The index of the entity to check.

required
strict bool

If true, only returns true if the entity is exactly of this archetype. If false, also returns true if the entity is of a subclass of this archetype.

False

Returns:

Type Description
bool

Whether the entity at the given index is of this archetype.

preprocess()

Perform upfront processing.

Runs first when the level is loaded.

ref() -> EntityRef[Self]

Get a reference to this entity.

Valid both in level data and in callbacks.

render()

Render the entity.

Runs after preprocess.

spawn(**kwargs: Any) -> None classmethod

Spawn an entity of this archetype, injecting the given values into entity memory.

Entity memory fields not passed as keyword arguments are initialized to zero.

Usage
class MyArchetype(PlayArchetype):
    field: int = entity_memory()

def f():
    MyArchetype.spawn(field=123)

Parameters:

Name Type Description Default
**kwargs Any

Entity memory values to inject by field name as defined in the archetype.

{}

StandardArchetypeName

Bases: StrEnum

Standard archetype names.

BPM_CHANGE = '#BPM_CHANGE' class-attribute instance-attribute

Bpm change marker

TIMESCALE_CHANGE = '#TIMESCALE_CHANGE' class-attribute instance-attribute

Timescale change marker

TIMESCALE_GROUP = '#TIMESCALE_GROUP' class-attribute instance-attribute

Entity referenced by the timescale changes in a group

StandardImport

Standard import annotations for Archetype fields.

Usage
class MyArchetype(WatchArchetype):
    judgment: StandardImport.JUDGMENT

ACCURACY = Annotated[float, imported(name=(StandardImportName.ACCURACY))] class-attribute instance-attribute

The accuracy of the entity.

Automatically set in watch mode for archetypes with a corresponding scored play mode archetype.

BEAT = Annotated[float, imported(name=(StandardImportName.BEAT))] class-attribute instance-attribute

The beat of the entity.

BPM = Annotated[float, imported(name=(StandardImportName.BPM))] class-attribute instance-attribute

The bpm, for bpm change markers.

JUDGMENT = Annotated[Judgment, imported(name=(StandardImportName.JUDGMENT))] class-attribute instance-attribute

The judgment of the entity.

Automatically set in watch mode for archetypes with a corresponding scored play mode archetype.

TIMESCALE = Annotated[float, imported(name=(StandardImportName.TIMESCALE))] class-attribute instance-attribute

The timescale, for timescale change markers.

TIMESCALE_EASE = Annotated[TimescaleEase, imported(name=(StandardImportName.TIMESCALE_EASE))] class-attribute instance-attribute

The timescale ease type, for timescale change markers.

TIMESCALE_GROUP = Annotated[EntityRef[Any], imported(name=(StandardImportName.TIMESCALE_GROUP))] class-attribute instance-attribute

The timescale group, for timescale change markers.

TIMESCALE_SKIP = Annotated[float, imported(name=(StandardImportName.TIMESCALE_SKIP))] class-attribute instance-attribute

The scaled time to skip, for timescale change markers.

StandardImportName

Standard import names for Archetype fields.

Usage
class MyArchetype(WatchArchetype):
    judgment: int = imported(name=StandardImportName.JUDGMENT)

ACCURACY = '#ACCURACY' class-attribute instance-attribute

The accuracy of the entity.

Automatically set in watch mode for archetypes with a corresponding scored play mode archetype.

BEAT = '#BEAT' class-attribute instance-attribute

The beat of the entity.

BPM = '#BPM' class-attribute instance-attribute

The bpm, for bpm change markers.

JUDGMENT = '#JUDGMENT' class-attribute instance-attribute

The judgment of the entity.

Automatically set in watch mode for archetypes with a corresponding scored play mode archetype.

TIMESCALE = '#TIMESCALE' class-attribute instance-attribute

The timescale, for timescale change markers.

TIMESCALE_EASE = '#TIMESCALE_EASE' class-attribute instance-attribute

The timescale ease type, for timescale change markers.

TIMESCALE_GROUP = '#TIMESCALE_GROUP' class-attribute instance-attribute

The timescale group, for timescale change markers.

TIMESCALE_SKIP = '#TIMESCALE_SKIP' class-attribute instance-attribute

The scaled time to skip, for timescale change markers.

WatchArchetype

Bases: _BaseArchetype

Base class for watch mode archetypes.

Usage
class MyArchetype(WatchArchetype):
    imported_field: int = imported()
    entity_memory_field: int = entity_memory()
    shared_memory_field: int = shared_memory()

    @callback(order=1)
    def update_sequential(self):
        ...

archetype_life: LifeInfo class-attribute

How entities of this archetype contribute to life depending on judgment.

archetype_score_multiplier: float class-attribute

Score multiplier for entities of this archetype.

This is additive with other multipliers (except judgment base multipliers).

entity_life: LifeInfo instance-attribute

How this specific entity contributes to life depending on judgment.

This is additive with archetype_life - the total life increment is the sum of both.

entity_score_multiplier: float instance-attribute

Score multiplier for this specific entity.

This is additive with other multipliers (except judgment base multipliers).

id: int = 0 class-attribute instance-attribute

The id of the archetype or entity.

If accessed on an entity, always returns the runtime archetype id of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the id will still be the id of A.

index: int property

The index of this entity.

is_active: bool property

Whether this entity is active.

is_scored: bool = False class-attribute

Whether entities of this archetype contribute to combo and score.

key: int | float = -1 class-attribute instance-attribute

An optional key for the archetype.

May be useful to identify an archetype in an inheritance hierarchy without needing to check id.

If accessed on an entity, always returns the runtime key of the entity, even if it doesn't match the type that was used to access it.

E.g. if an entity of archetype A is accessed via EntityRef[B], the key will still be the key of A.

life: LifeInfo class-attribute

How entities of this archetype contribute to life depending on judgment.

Alias for archetype_life, provided for backwards compatibility.

name: str | None = None class-attribute

The name of the archetype.

If not set, defaults to the class name with the leading Play, Watch, or Preview prefix for this archetype's mode removed, if present.

The name is used in level data.

result: WatchEntityInput property

The result of this entity.

Only meaningful for scored entities.

at(index: int, check: bool = True) -> Self classmethod

Access the entity of this archetype at the given index.

Parameters:

Name Type Description Default
index int

The index of the entity to reference.

required
check bool

If true and runtime checks are enabled, asserts that the entity at the index is of this archetype or of a subclass of this archetype. If false, no validation is performed.

True

Returns:

Type Description
Self

The entity at the given index.

derive(name: str, is_scored: bool, key: int | float | None = None) -> type[T] classmethod

Derive a new archetype class from this archetype.

Roughly equivalent to returning:

class Derived(cls):
    name = <name>
    is_scored = <is_scored>
    key = <key>  # Only set if key is not None

This is used to create a new archetype with the same fields and callbacks, but with a different name and whether it is scored. Compared to manually subclassing, this method also enables faster compilation when the same base archetype has multiple derived archetypes by compiling callbacks only once for the base archetype.

This cannot be called on an archetype that was itself created by derive.

Parameters:

Name Type Description Default
name str

The name of the new archetype.

required
is_scored bool

Whether the new archetype is scored.

required
key int | float | None

A key that can be accessed via the key property of the new archetype.

None

Returns:

Type Description
type[T]

A new archetype class with the same fields and callbacks as this archetype, but with the given name and

type[T]

whether it is scored.

despawn_time() -> float

Return the despawn time of the entity.

initialize()

Initialize this entity.

Runs when this entity is spawned.

is_at(index: int, strict: bool = False) -> bool classmethod

Return whether the entity at the given index is of this archetype.

Parameters:

Name Type Description Default
index int

The index of the entity to check.

required
strict bool

If true, only returns true if the entity is exactly of this archetype. If false, also returns true if the entity is of a subclass of this archetype.

False

Returns:

Type Description
bool

Whether the entity at the given index is of this archetype.

preprocess()

Perform upfront processing.

Runs first when the level is loaded.

ref() -> EntityRef[Self]

Get a reference to this entity.

Valid both in level data and in callbacks.

spawn(**kwargs: Any) -> None classmethod

Spawn an entity of this archetype, injecting the given values into entity memory.

Entity memory fields not passed as keyword arguments are initialized to zero.

Usage
class MyArchetype(PlayArchetype):
    field: int = entity_memory()

def f():
    MyArchetype.spawn(field=123)

Parameters:

Name Type Description Default
**kwargs Any

Entity memory values to inject by field name as defined in the archetype.

{}

spawn_time() -> float

Return the spawn time of the entity.

terminate()

Finalize before despawning.

Runs when the entity is despawned.

update_parallel()

Perform parallel actions for this frame.

Runs after update_sequential each frame.

This is where most gameplay logic should be placed.

update_sequential()

Perform non-parallel actions for this frame.

Runs first each frame.

This is where logic affecting shared memory should be placed. Other logic should typically be placed in update_parallel for better performance.

WatchEntityInput

Bases: Record

The judgment result recorded for an entity in watch mode.

Accessed as result on a scored entity.

bucket: Bucket instance-attribute

The Bucket the entity's result is recorded in.

bucket_value: float instance-attribute

The value recorded in bucket, shown with that bucket's unit.

target_time: float instance-attribute

The target time of the entity's hit.

__pos__() -> Self

Return a copy of the record.

frozen(*args: P.args, **kwargs: P.kwargs) -> Self classmethod

Create a frozen record instance.

Numeric fields in the record will not be writable. However, nested values such as other records may remain mutable.

Parameters:

Name Type Description Default
*args P.args

Positional arguments for the record constructor.

()
**kwargs P.kwargs

Keyword arguments for the record constructor.

{}

Returns:

Type Description
Self

A frozen record instance.

type_var_value(var: TypeVar) -> Any classmethod

Return the value of a type variable.

Parameters:

Name Type Description Default
var TypeVar

The type variable to get the value of.

required

Returns:

Type Description
Any

The value of the type variable.

callback(*, order: int = 0) -> Callable[[T], T]

Annotate a callback with its order.

Callbacks are executed from lowest to highest order. By default, callbacks have an order of 0.

Note

Only preprocess, spawn_order, update_sequential, and touch support a non-zero order. Using a non-zero order on any other archetype callback raises an error at compile time.

Usage
class MyArchetype(PlayArchetype):
    @callback(order=1)
    def update_sequential(self):
        pass

Parameters:

Name Type Description Default
order int

The order of the callback. Lower values are executed first.

0

entity_data() -> Any

Declare a field as entity data.

Entity data is accessible from other entities, but may only be updated in the preprocess callback and is read-only in other callbacks.

It functions like imported and shares the same underlying storage, except that it is not loaded from a level.

Usage
class MyArchetype(PlayArchetype):
    field: int = entity_data()

entity_info_at(index: int) -> PlayEntityInfo | WatchEntityInfo | PreviewEntityInfo

Retrieve entity info of the entity at the given index.

Available in play, watch, and preview mode.

entity_memory() -> Any

Declare a field as entity memory.

Entity memory is private to the entity and is not accessible from other entities. It may be read or updated in any callback associated with the entity.

Entity memory fields may also be set when an entity is spawned using the spawn() method.

Usage
class MyArchetype(PlayArchetype):
    field: int = entity_memory()

exported(*, name: str | None = None) -> Any

Declare a field as exported.

This is only usable in play mode to export data to be loaded in watch mode.

Exported fields are write-only.

Usage
class MyArchetype(PlayArchetype):
    field: int = exported()
    field_with_explicit_name: int = exported(name="#FIELD")

get_archetype_by_name(name: str) -> type[AnyArchetype]

Return the archetype with the given name in the current mode.

imported(*, name: str | None = None, default: int | float | None = None) -> Any

Declare a field as imported.

Imported fields may be loaded from the level.

In watch mode, data may also be loaded from a corresponding exported field in play mode.

Imported fields may only be updated in the preprocess callback, and are read-only in other callbacks.

Usage
class MyArchetype(PlayArchetype):
    field: int = imported()
    field_with_explicit_name: int = imported(name="field_name")
    field_with_default: int = imported(default=0)

shared_memory() -> Any

Declare a field as shared memory.

Shared memory is accessible from other entities.

Shared memory may be read in any callback, but may only be updated by sequential callbacks (preprocess, update_sequential, and touch).

Usage
class MyArchetype(PlayArchetype):
    field: int = shared_memory()