Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BunnyNabbit/celaria-formats/llms.txt

Use this file to discover all available pages before exploring further.

EditableCelariaMap represents a Celaria map in its editable state — the format used by the game’s built-in map editor. Unlike CelariaMap, editable maps do not require medal times on checkpoints or goals, and they are not finalized for play. It extends BaseCelariaMap and inherits all shared map properties.

Inheritance

EditableCelariaMap extends BaseCelariaMap and inherits all of its properties: instances, checkpointOrder, name, sunRotationHorizontal, sunRotationVertical, previewCamera, and version.

Static properties

fileSignature

EditableCelariaMap.fileSignature // "celaria_edi"
The 11-character ASCII string written at the start of every .ecmap file. parse checks this value and throws if the buffer does not begin with it.

Static methods

parse(buffer)

Parses an .ecmap binary buffer and returns a populated EditableCelariaMap instance.
buffer
Buffer
required
A Node.js Buffer containing the raw bytes of an .ecmap file.
Returns: EditableCelariaMap Checkpoint and goal blocks found during parsing are sorted by their stored priority value and added to checkpointOrder in that order. Unlike CelariaMap.parse, no medal times are read or required.
Throws Error("Magic mismatch.") if the first 11 bytes of the buffer do not equal "celaria_edi".Throws Error("Unknown instance type ${instanceType}.") if the file contains an instance type byte that is not 0, 1, 2, 3, 4, or 128.
import fs from "node:fs"
import { EditableCelariaMap } from "celaria-formats"

const buffer = fs.readFileSync("./myMap.ecmap")
const map = EditableCelariaMap.parse(buffer)

console.log(map.name)
console.log(map.instances.length)

Instance methods

serialize(version)

Serializes the map to a binary buffer suitable for writing to an .ecmap file.
version
number
required
The format version to serialize to. This parameter is required — there is no default.
Returns: Buffer Blocks in checkpointOrder are written after all other instances and have their type set to checkpoint or goal (the last entry) in place. Blocks typed as checkpoint or goal that are not in checkpointOrder are downgraded to plain blocks.
Throws Error("No version defined.") if version is undefined. Always pass an explicit version number.Throws Error("I can't decide if I am a wall or a floor.") if a Barrier instance has a scale configuration that does not resolve to either a wall or a floor.
Version 3 uses a legacy fixed-point encoding for positions and scales. Versions 4 and above use double-precision floating-point. Prefer version 4 or higher for new maps.
import fs from "node:fs"
import { EditableCelariaMap } from "celaria-formats"

const map = EditableCelariaMap.parse(fs.readFileSync("./myMap.ecmap"))
const output = map.serialize(4)
fs.writeFileSync("./output.ecmap", output)

Full example

This example parses an editable map and converts every block to a speed block before re-serializing.
import fs from "node:fs"
import { Block, EditableCelariaMap } from "celaria-formats"

const myMap = EditableCelariaMap.parse(fs.readFileSync("./myMap.ecmap"))
myMap.instances.filter(instance => instance.instanceId == 0).forEach(block => block.type = Block.types.speed)
const output = myMap.serialize(4)
instance.instanceId == 0 selects all Block instances (as opposed to spheres, spawn points, barriers, or holograms). Each matched block has its type set to Block.types.speed. The result is serialized using format version 4.

CelariaMap

The finalized map format with medal times and game mode.

BaseCelariaMap

Shared base class with all common properties and defaults.

Block

Block instance type, including speed, checkpoint, and goal variants.

Writing maps

Guide to serializing maps back to binary buffers.

Build docs developers (and LLMs) love