This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Archiver

Archiver is a tool for data archiving, which handles UNG files. It implements encrypting to avoid unauthorized data access.

The contents of UNG archives are completely transparent to the engine: archived files are accessed using their standard paths, as if they were not packed. However, it's important to note that:

  • A UNG package cannot contain another UNG package.
  • A mount point cannot be packed into an archive, although it can reference one.
  • Data Streaming is not supported for compressed files within archives. Although compressed files in archives benefit from faster read speeds, they cannot be streamed. Therefore, by deafult, only files that do not require streaming are compressed.
  • Compression of binary formats (e.g. .texture, .mesh or .lmap) is not recommended, since these formats are already compressed internally and require streaming for efficient runtime loading.
  • For files whose extensions are marked for compression, the LZ4 compression algorithm is applied. The list of compressible extensions is specified at the time of package creation.

For more information, refer to the article: File System.

To invoke Archiver, run <UnigineSDK>/bin/ung_x64.exe (in Windows) or <UnigineSDK>/bin/ung_x64 (in Linux) from a command-line console.

Command Line Options#

Archiver recognizes the following command-line options:

  • -p <PASSWORD> - set a password. It should be the same password as passed on engine initialization on the API side. For more information refer to the article Protecting Your Data with a Password.

    Notice
    You can skip password setting if it is not required. The engine supports loading UNG packages without password protection even if the password was specified on its initialization.
  • -x <FILE> - exclude the specified files from packaging into the archive.
  • -o <ARCHIVE> - name the output archive.
  • -e <ARCHIVE> - extract files from the archive.
  • -i <ARCHIVE> - list all files from the archive along with their respective sizes.
  • -s <ARCHIVE> - output detail information about the archive.
  • -c <EXTENSIONS> - enable compression for the specified extensions. If no extensions are provided, compression will be enabled by deafult for the following extensions: json, xml, txt, node, world, prop, track, mat, basemat.

    Notice
    If you specify your own extensions, the default ones will not be used, only the extensions you explicitly list will be applied.

Statisctics Overview#

When you request statistics for an archive using the -s <ARCHIVE>, the output includes both general and extension-specific statistics

Result of running ung_x64 -s data.ung: all included file extensions are listed along with their sizes before and after the compression.

General Statistics:

  • Num files - Displays total number of files in archive.
  • Size - Displays the original size of the archive and the compressed size.
  • Compression diff - Indicates the amount of space saved by compression.
  • Compression rate - Displays the compression ratio as a percentage, representing how much smaller the compressed archive is compared to the original.

Per-Extension Statistics Table:

  • Extension: The file extension (e.g. texture, json, xml)
  • Size: The total size occupied by files of this extension, showing the original and compressed sizes.
  • Diff: The total amount of space saved for this extension.
  • Rate total: The overall compression rate for all files with this extension.
  • Rate average: The average compression rate across all files of this type.
  • Rate median: The median compression rate, showing the most common compression outcome.
  • Rate min: The minimum compression rate observed for this extension.
  • Rate max: The maximum compression rate observed for this extension.

Usage Examples#

The following creates an archive named files.ung that contains files file.txt and file.tga.

Shell commands
ung_x64 -o files.ung file.txt file.tga

The following extracts all files from the archive created above:

Shell commands
ung_x64 -e files.ung

The following prints statistics related to the archive:

Shell commands
ung_x64 -i files.ung

The following creates an archive named files.ung that contains files file.txt and file.tga protected with a password "12345":

Shell commands
ung_x64 -p 12345 -o files.ung file.txt file.tga

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-05-27
Build: ()