0.0.6 • Published 1 year ago

voxelchain-formats v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

voxelchain-formats

A collection of tools to work with the VoxelChain file formats

Documentation:

The documentation is auto-generated and can be found here.

Installation:

Package installation:

npm install voxelchain-formats

Example:

import * as VoxelChainFormats from "voxelchain-formats";

// Load a .vxwo binary
fetch("world.vxwo").then(resp => resp.arrayBuffer()).then(buffer => {
  // Create an uint8 view into the buffer
  const binary = new Uint8Array(buffer);
  // Decompress the binary data
  const decompressed = VoxelChainFormats.decompressGZIP(binary);
  // Parse the binary data
  const parsed = VoxelChainFormats.parseVXWOFile(decompressed);
  console.log("Parsed world:", parsed);
  // Compile the parsed world back into binary
  const compiled = VoxelChainFormats.compileVXWOFile(parsed);
  // Compress the binary data
  const compressed = VoxelChainFormats.compressGZIP(binary);
  console.log("Re-compiled world:", compressed);
});

Cell Binary Layout

Cells are bitfields with the following layout:

OffsetLengthDescription
08Material Id
88State Data
163Animation Index
195Rotation Data

Flow Binary Layout

Flows are bitfields with the following layout:

OffsetLengthDescription
04Power
41Power Signal
0.0.5

1 year ago

0.0.6

1 year ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago