Position

Position represents the location of an object within a universe, classified into five main categories:

  • Void: The object exists nowhere.
  • Space: The object is located within a block of space, with optional specific coordinates.
  • Object: The object is in relation to another object.
  • World: The object has entered a world.
  • Outerverse: The object has exited the current universe.

The primary part of a location is called the domain, while the secondary part, called coordinates, provides more specific location details when applicable.

Representation

A position is represented by the following structure:

struct Position {
    uint64 domain;
    uint64 coord;
}

Fields

TypeFieldDescription
uint64domainThe domain ID, representing the primary part of a location.
uint64coordThe coordinates within the domain, if applicable.

Domain ID

Each category of location is assigned a unique category ID (cat) and indicated by a letter (indicator). The index specifies the primary part of the location under that category.

CategoryIndicatorCatIndex
Void's'0index = 0
Space's'0index = block ID
Object'o'1index = set ID
World'w'127index = world ID
Outerverse'u'128index = universe ID

The domain ID is constructed from a combination of cat and index, forming a unique unsigned 64-bit integer:

uint64(cat) << 56 | uint64(index)

Encoding

A position can be encoded as a uint128:

(uint128(domain) << 64) | uint128(coord)

Written Format

Positions are typically written in dot notation as {letter}.{index}.{coord}. For void positions, you can use void or 0, and the trailing 0 can be omitted.

Examples:

Dot NotationAlternativeDescription
s.0.0void or 0The void.
s.12.34:56Block 12, coordinates (34, 56).
o.17.1Relation to object 17.1.
w.17.0w.17World 17.
u.8453.0u.8453Universe 8453.