W4 AssetCreator

From Ciliz|W4


The W4 game engine uses its own asset storage format. Therefore, most resources have to be packed before use. This can be done using the W4AssetCreator console application that comes with the W4 SDK.

W4AssetCreator works in two modes:

  • Configuration Mode (see further details below);
  • Single Mode (this is a single asset mode that is currently not implemented).

Mesh Example

Let’s take the Utah teapot as an example. If you view the file using the utility Autodesk FBX Review, you will see something similar to the following figure.


Pay attention to the orientation of the teapot spout when viewing fbx. As a result, the same teapot is displayed, but with a slight difference.


If you compare the drawings, you may notice that the spout of the teapot has changed its directed after the program execution. This happens due to differences in coordinate systems.

The FBX coordinate system Scene Axis and Unit Conversion is right-handed (with the Y pointing up), whereas W4 coordinate system is left-handed (the the Y axis is also pointing up).

Animated mesh Exmple

Take, for example, Rigged Hand.

If you view it using Autodesk FBX Review you will see approximately the following:

As a result of conversion, the following animation is shown:

Short manual

Common parameters

Parameters that can be used in any mode:

  • -h, --help - shows available parameters;
  • --output-directory - sets the output folder:
    • SingleMode - the folder where the asset is placed,
    • ConfigurationMode - the folder into which the files will be synchronized and the assets are created according to the configuration file.

Configuration Mode

This mode synchronizes resources located in the folder specified in the configuration file with the --output-directory folder (if the configuration file does not exist, then the folder of the configuration file is used).

In this mode, W4AssetCreator takes the following input parameters:

  • --config - the path to the configuration file. If the file does not exist, it is generated automatically;
  • --create-symlinks - instead of copying files, symlinks are created;
  • --create-hardlinks - instead of copying files, hardinks are created;
  • --cache-directory - if the parameter is set, then the configuration and assets are cached and not recreated if there were no changes in the files and / or configuration.

Default configuration file creation rules

Ignored files:

  • “AssetCreator[.CONFIG].config”
  • “*.vs”
  • “*.fs”

Files from which individual assets are created:

  • “*.fbx” - a separate asset (path/to/fbx/file.w4a) is created for each file

Files that are placed in the asset by default:

  • pictures (OS should define their mime-type as image / something)
  • particles (*.part)
  • materials (*.mat)

The rest of the files are marked for synchronization with the output folder.

Configuration file description

The configuration file is a json file with the following root fields:

  • path - path to the project resources directory;
  • version - W4Framework resources version;
  • rules - all rules for working with assets.

There are 3 basic rules for working with assets:

  • “skip” - [array] list of ignored files
  • “pass” - [array] list of files to be copied (or symlink will be created on them, with --create-symlinks)
  • “assets” - [object] - rules for generating assets - key:value (relative path to the asset : rules for this asset)

Rules for generating assets.:

  • “images” - [array] a list of files that are added to the asset as pictures (w4::resources::Image)
  • “binaries” - [array] a list of files that are added to the asset as binaries (w4::resources::Binary)
  • “materials” - [array] a list of files that are added to the asset as materials (w4::resources::Material)
  • “particles” - [array] a list of files that are added to the asset as particles (w4::render::ParticlesEmitter)
  • “models” - [object] a list of model source files (fbx), which are converted to W4 format and are available in the asset as a node tree. A list of conversion parameters is passed as a value
  • “animations” - [object] a list of model source files (fbx), from which ONLY skeletal animations are extracted. A list of conversion parameters is passed as a value

List of models parameters:

  • no-animation - do not export skeletal animations from this file
  • scale=%float% - apply scaling to models / animations
  • add-animation=%AnimationName% - add “AnimationName” animation to animation list for each SkinnedMesh in this model. This animation must be added from one of the files located in the "animations" section
  • rename-animation=%PrevName%=%NewName% - rename animation PrevName to animation NewName

List of animations parameters:

  • scale=%float% - apply scaling to animations
  • rename=%PrevName%=%NewName% - rename animation PrevName to animation NewName
  • split=%animationName%:%beginFrame1%-%endFrame1%=%partName1%,%beginFrame2%-%endFrame2%=%partName2% - replace the animationName animation with parName1, partName2, and so on. parNames are part of the animationName from the beginFrameM frame to the endFrameM frame

Configuration File Example

    "path": ".",
    "rules": {
        "assets": {
            "Paperboy.w4a": {
                "animations": {
                    "animations/A_PaperBoy_Dance2.fbx": [
                        "rename=Take 001=Crewman"
                    "animations/A_PaperBoy_Flip.fbx": [
                        "rename=Take 001=Flip"
                "models": {
                    "SK_PaperBoy_T_Pose.fbx": [
            "default.w4a": {
                "images": [
                "materials": [
        "skip": [
    "version": "0.2"