vix game
vix game provides game project tools for Vix.cpp projects using the vix/game runtime.
Use it when you want to export a game project into a distributable directory.
vix game exportOverview
vix game is the command namespace for game-related workflows.
The current command is:
vix game exportIt prepares a game project for distribution by exporting project files into an output directory.
The export can include:
assets/
game.package.json
README.md
export.jsonThe command is designed for projects created with the Vix game template or projects using the vix/game module.
Usage
vix game export [options]Basic examples
# Export the current game project
vix game export
# Export from an explicit project root
vix game export --project-root .
# Export to a specific directory
vix game export --output dist
# Override the exported game name
vix game export --name mario-release
# Refuse to overwrite existing export output
vix game export --no-overwrite
# Export without copying assets
vix game export --no-assetsWhat it does
vix game export exports a game project into a distributable directory.
It uses a game export configuration with these defaults:
project root .
output directory dist
asset directory assets
package file game.package.json
readme file README.md
name game
copy assets yes
copy package yes
copy README yes, when it exists
overwrite yesThe exporter reads project data, copies game resources, and writes export metadata.
Default export
Run:
vix game exportDefault behavior:
project root .
output directory dist
export name game
assets copied from assets/
package file copied from game.package.json
README copied if README.md exists
overwrite enabledExport result
After a successful export, Vix prints:
Game exported.
Output <path>
Name <name>
Version <version>
Asset root <asset-root>
Copied files <count>
Copied directories <count>Example output shape:
✔ Game exported.
Output dist/game
Name game
Version 0.1.0
Asset root assets
Copied files 12
Copied directories 3Project root
Use:
vix game export --project-root <path>or:
vix game export --project-root=<path>Example:
vix game export --project-root ./examples/platformerThis tells Vix where the game project is located.
Default:
.Output directory
Use:
vix game export --output <path>or:
vix game export --output=<path>Example:
vix game export --output distThe output directory is where the exported game files are written.
Default:
distExport name
Use:
vix game export --name <name>or:
vix game export --name=<name>Example:
vix game export --name mario-releaseThis overrides the export name.
If no name is provided, the exporter can use the package name from game.package.json when available.
Otherwise, it uses:
gameAssets
By default, Vix copies assets from:
assets/Example structure:
my-game/
├── assets/
│ ├── player.png
│ ├── coin.png
│ └── background.png
├── game.package.json
└── README.mdExport:
vix game exportThe exported output includes the assets.
Disable asset copying
Use:
vix game export --no-assetsThis exports the game without copying the assets/ directory.
Use this when assets are handled by another packaging step or when you only want metadata output.
Package file
The default game package file is:
game.package.jsonWhen present, the exporter can use it for metadata such as:
name
version
asset rootIt is copied into the exported output by default.
README file
The default README file is:
README.mdWhen it exists, the exporter copies it into the exported output.
This is useful for sharing a game build with basic project information.
Overwrite behavior
By default, vix game export allows overwriting an existing export directory.
Default:
overwrite yesTo prevent overwriting, use:
vix game export --no-overwriteIf the output already exists, the export fails instead of replacing it.
Use this for safer release workflows.
Game support requirement
vix game export requires Vix to be built with game support enabled.
If game support is not enabled, Vix prints:
Game support is not enabled in this Vix build.
Rebuild Vix with -DVIX_ENABLE_GAME=ON.Fix:
cmake -DVIX_ENABLE_GAME=ON ...Then rebuild Vix.
Recommended game project structure
A simple Vix game project can look like this:
my-game/
├── src/
│ ├── main.cpp
│ ├── MainScene.cpp
│ └── Player.cpp
├── include/
│ └── my-game/
├── assets/
│ ├── player.png
│ └── coin.png
├── game.package.json
├── README.md
└── vix.appThe important export-related files are:
assets/
game.package.json
README.mdExample game.package.json
A simple package file can look like this:
{
"name": "mario",
"version": "0.1.0",
"asset_root": "assets"
}Then run:
vix game exportThe result uses:
name mario
version 0.1.0
asset root assetsExport workflow
Recommended local workflow:
vix build
vix game exportFor release builds:
vix build --preset release
vix game export --output dist --name mario-releaseFor safer release exports:
vix build --preset release
vix game export --output dist --name mario-release --no-overwriteExport without assets
vix game export --no-assetsUse this when:
assets are already copied elsewhere
assets are embedded later
you only want export metadata
you are testing export logicExport from another folder
vix game export --project-root ./games/mario --output ./distThis exports:
./games/mariointo:
./distOptions
| Option | Description |
|---|---|
--project-root <path> | Project root. Default: . |
--project-root=<path> | Same as --project-root <path>. |
--output <path> | Override output directory. |
--output=<path> | Same as --output <path>. |
--name <name> | Override export name. |
--name=<name> | Same as --name <name>. |
--no-overwrite | Fail if output already exists. |
--no-assets | Do not copy assets. |
-h, --help | Show command help. |
Commands reference
| Command | Description |
|---|---|
vix game export | Export the current game project. |
vix game export --project-root . | Export from the current directory explicitly. |
vix game export --output dist | Export into dist. |
vix game export --name mario-release | Override export name. |
vix game export --no-overwrite | Fail if export output exists. |
vix game export --no-assets | Export without copying assets. |
Common workflows
Export current game
vix game exportBuild and export
vix build
vix game exportRelease build and export
vix build --preset release
vix game export --output dist --name mario-releaseExport without overwriting
vix game export --no-overwriteExport without assets
vix game export --no-assetsExport another project
vix game export --project-root ./games/mario --output ./distCommon mistakes
Running without game support
If you see:
Game support is not enabled in this Vix build.rebuild Vix with:
-DVIX_ENABLE_GAME=ONExpecting vix game export to build the game
vix game export exports project files.
It does not replace:
vix buildRecommended:
vix build --preset release
vix game exportForgetting assets
If your exported game has no textures, sprites, sounds, or images, check that your project has:
assets/and that you did not pass:
--no-assetsOverwriting an export accidentally
By default, overwrite is enabled.
For safer release exports, use:
vix game export --no-overwritePassing the wrong project root
Wrong:
vix game export --project-root ./distCorrect:
vix game export --project-root ./my-gameThe project root should be the game project folder, not the output folder.
Expecting package metadata without game.package.json
If game.package.json is missing, Vix can still export, but metadata falls back to defaults.
Default values include:
name game
version 0.1.0
assets assetsTroubleshooting
Unknown game command
Use:
vix game exportCurrent supported command:
exportGame export failed
The exporter returns a structured game error.
Vix prints:
Game export failed.
<error message>Check:
project root exists
output directory is writable
assets directory exists when assets are enabled
game.package.json is valid when present
existing output is allowed or --no-overwrite is not usedOutput already exists
If you used:
vix game export --no-overwriteand the output exists, remove the old output or choose another name/output directory.
Example:
vix game export --name mario-release-2Assets not copied
Check that assets exist under:
assets/and do not use:
--no-assetsWrong export name
Pass the name explicitly:
vix game export --name mario-releaseor set the name inside:
game.package.jsonBest practices
Run vix build before exporting a release.
Use --name for release exports.
Use --output dist for predictable output.
Use --no-overwrite for release workflows.
Keep game.package.json accurate.
Keep assets under assets/ unless your game package configuration says otherwise.
Use --no-assets only when another step handles assets.
Do not edit exported files manually for release builds. Regenerate the export instead.
Related commands
| Command | Purpose |
|---|---|
vix build | Build the game project. |
vix dev | Run the project during development. |
vix run | Run the project directly. |
vix pack | Package a Vix project into a distributable artifact. |
vix verify | Verify a package artifact. |
vix cache | Store a package locally. |
Next step
Continue with project packaging.