Skip to main content

xrift.json Configuration

Configure your world settings in xrift.json at the project root.

Configuration Example

{
"world": {
"distDir": "./dist",
"title": "My World",
"description": "This is a sample world",
"thumbnailPath": "thumbnail.png",
"buildCommand": "npm run build",
"ignore": [
"**/.DS_Store",
"**/Thumbs.db",
"**/*.map"
]
}
}

Configuration Items

FieldTypeDescription
distDirstringDirectory of build artifacts to upload
titlestringWorld title (if not set, input required at upload)
descriptionstringWorld description (if not set, input required at upload)
thumbnailPathstringPath to thumbnail image (relative to distDir)
buildCommandstringBuild command to execute before upload
ignorestring[]Glob patterns of files to exclude from upload
physicsobjectWorld physics settings

Details of Each Item

distDir

Specifies the directory to upload.

{
"world": {
"distDir": "./dist"
}
}

title / description

Sets the world title and description. These are optional, but if set, they will be used as default values in the prompt when running xrift upload world.

{
"world": {
"title": "My Awesome World",
"description": "An interactive 3D world"
}
}

thumbnailPath

Specifies the thumbnail image for the world. Specify as a relative path from distDir.

{
"world": {
"distDir": "./dist",
"thumbnailPath": "thumbnail.png"
}
}

In this case, dist/thumbnail.png will be used as the thumbnail.

Recommended Size: 1280x720 pixels

buildCommand

A command that is automatically executed before uploading when running xrift upload world.

{
"world": {
"buildCommand": "npm run build"
}
}

Setting this eliminates the need to build manually.

ignore

Specifies files to exclude from upload using glob patterns.

{
"world": {
"ignore": [
"**/.DS_Store",
"**/Thumbs.db",
"**/*.map"
]
}
}

physics

You can customize the physics behavior of the world.

SettingTypeDefaultDescription
gravitynumber9.81Strength of gravity (Positive value, Earth=9.81, Moon=1.62)
allowInfiniteJumpbooleantrueWhether to allow infinite jumping

Basic Settings

{
"world": {
"physics": {
"gravity": 9.81,
"allowInfiniteJump": true
}
}
}

Athletic World (No Infinite Jump)

{
"world": {
"physics": {
"allowInfiniteJump": false
}
}
}

Low Gravity World (Moon Gravity)

{
"world": {
"physics": {
"gravity": 1.62
}
}
}

High Gravity World (Jupiter Gravity)

{
"world": {
"physics": {
"gravity": 24.79
}
}
}