<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>https://wiki.unvanquished.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Illwieckz</id>
		<title>Unvanquished - User contributions [en-gb]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.unvanquished.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Illwieckz"/>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/wiki/Special:Contributions/Illwieckz"/>
		<updated>2026-08-24T06:06:26Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.3</generator>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9595</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9595"/>
				<updated>2026-08-08T06:42:52Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained DXT texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is the recommended TGA-to-PNG converter. For converting TGA images prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch produces compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9594</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9594"/>
				<updated>2026-08-08T06:41:10Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch produces compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9593</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9593"/>
				<updated>2026-08-08T06:40:41Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch produces compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9592</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9592"/>
				<updated>2026-08-08T06:40:08Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
{{crunch}} is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch produces compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9591</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9591"/>
				<updated>2026-08-08T06:39:36Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
Crunch is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch produces compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9590</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9590"/>
				<updated>2026-08-08T06:37:11Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Adoption */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
Crunch is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch can produce compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The {{crunch}} is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9589</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9589"/>
				<updated>2026-08-08T06:20:54Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: Debian provides dxtc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
Crunch is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch can produce compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch is known to be distributed by:&lt;br /&gt;
&lt;br /&gt;
* The Debian operating system: {{url|tracker.debian.org/pkg/crunch-dxtc}}&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9588</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9588"/>
				<updated>2026-08-06T04:04:09Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Sources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern Toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…&lt;br /&gt;
&lt;br /&gt;
Saigo is the name Google gave to its latest compiler suite for building Native Client applications. The {{saigo}} is based on it.}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
{{SaigoStatus}}&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-nacl-sdk}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9587</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9587"/>
				<updated>2026-08-06T04:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Rebuild effort */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
{{nacl}} (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime to run NaCl executables;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger to build NaCl executables;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced crash reporting library with support for NaCl executables built with Saigo.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-nacl-sdk}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
{{SaigoStatus}}&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=WebAssembly&amp;diff=9586</id>
		<title>WebAssembly</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=WebAssembly&amp;diff=9586"/>
				<updated>2026-08-06T01:58:40Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WebAssembly''' or '''Wasm''' is the best candidate for a future technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
It may replace {{nacl}} in the {{engine}} in the future.&lt;br /&gt;
&lt;br /&gt;
Some work has been started some years ago but for now that effort is stalled.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=WebAssembly&amp;diff=9585</id>
		<title>WebAssembly</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=WebAssembly&amp;diff=9585"/>
				<updated>2026-08-06T01:58:28Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WebAssembly''' or '''Wasm''' is the best candidate for a future technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
It may replace [[Native Client]] in the {{engine}} in the future.&lt;br /&gt;
&lt;br /&gt;
Some work has been started some years ago but for now that effort is stalled.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9584</id>
		<title>Template:NativeClientIsDying</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9584"/>
				<updated>2026-08-06T01:57:57Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|header=Native Client is (not yet) dying|Thanks to the [[Native Client#Rebuild effort|Native Client Rebuild effort]] for both the {{naclruntime}} and the {{saigo}}, and the fact the Saigo compiler has been maintained by Google up to 2025, bringing Clang 21 and C++23, the NaCl technology may be relevant for another decade and this allows the Unvanquished team to focus resources on other things.&lt;br /&gt;
&lt;br /&gt;
But {{nacl}} will die one day and we are slowly preparing the future. [[WebAssembly]] is the best candidate for a NaCl successor.&lt;br /&gt;
&lt;br /&gt;
It's possible that the actual NaCl death will not come from Google but from Apple as they progressively deprecate the Rosetta 2 translation layer. When that will prevent to run the amd64 loader on Apple Silicon, then Native Client will be dead for macOS and would not be a viable multi-platform sandboxing solution anymore.}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9583</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9583"/>
				<updated>2026-08-06T01:57:19Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern Toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…&lt;br /&gt;
&lt;br /&gt;
Saigo is the name Google gave to its latest compiler suite for building Native Client applications. The {{saigo}} is based on it.}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
{{SaigoStatus}}&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9582</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9582"/>
				<updated>2026-08-06T01:56:59Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Dæmon Saigo SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
{{nacl}} (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime to run NaCl executables;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger to build NaCl executables;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced crash reporting library with support for NaCl executables built with Saigo.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
{{SaigoStatus}}&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:SaigoStatus&amp;diff=9581</id>
		<title>Template:SaigoStatus</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:SaigoStatus&amp;diff=9581"/>
				<updated>2026-08-06T01:56:47Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: Created page with &amp;quot;The Unvanquished team publishes frequent releases of the {{saigo}} with ready-to-use prebuilt packages for a large number of platforms:  * {{url|github.com/DaemonEngine/saigo-...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Unvanquished team publishes frequent releases of the {{saigo}} with ready-to-use prebuilt packages for a large number of platforms:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-nacl-sdk/releases}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds. &lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9580</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9580"/>
				<updated>2026-08-06T01:55:21Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern Toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…&lt;br /&gt;
&lt;br /&gt;
Saigo is the name Google gave to its latest compiler suite for building Native Client applications. The {{saigo}} is based on it.}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team publish frequent releases of the {{saigo}} with ready-to-use prebuilt packages for a large number of platforms:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-nacl-sdk/releases}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9579</id>
		<title>Template:NativeClientIsDying</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9579"/>
				<updated>2026-08-06T01:53:27Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|header=Native Client is (not yet) dying|Thanks to the [[Native Client#Rebuild effort|Native Client Rebuild effort]] for both the {{naclruntime}} and the {{saigo}}, and the fact the Saigo compiler has been maintained by Google up to 2025, bringing Clang 21 and C++23, the NaCl technology may be relevant for another decade and this allows the Unvanquished team to focus resources on other things.&lt;br /&gt;
&lt;br /&gt;
But [[Native Client]] will die one day and we are slowly preparing the future. [[WebAssembly]] is the best candidate for a NaCl successor.&lt;br /&gt;
&lt;br /&gt;
It's possible that the actual NaCl death will not come from Google but from Apple as they progressively deprecate the Rosetta 2 translation layer. When that will prevent to run the amd64 loader on Apple Silicon, then Native Client will be dead for macOS and would not be a viable multi-platform sandboxing solution anymore.}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9578</id>
		<title>Template:NativeClientIsDying</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9578"/>
				<updated>2026-08-06T01:52:29Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|header=Native Client is (not yet) dying|Thanks to the [[Native Client#Rebuild effort|Native Client Rebuild effort]] for both the {{naclruntime}} and the {{saigo}}, and the fact the Saigo compiler has been maintained by Google up to 2025, bringing Clang 21 and C++23, the NaCl technology may be relevant for another decade and this allows the Unvanquished team to focus resources on other things.&lt;br /&gt;
&lt;br /&gt;
But [[Native Client]] will die one day and we are slowly preparing the future. [[WebAssembly]] is the best candidate for a Native Client successor.&lt;br /&gt;
&lt;br /&gt;
It's possible that the actual NaCl death will not come from Google but from Apple as they progressively deprecate the Rosetta 2 translation layer. When that will prevent to run the amd64 loader on Apple Silicon, then Native Client will be dead for macOS and would not be a viable multi-platform sandboxing solution anymore.}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9577</id>
		<title>Template:NativeClientIsDying</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9577"/>
				<updated>2026-08-06T01:51:44Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|header=Native Client is (not yet) dying|Thanks to the [[Native Client#Rebuild effort|Native Client Rebuild effort]] for both the NaCl loader and the Saigo NaCl compiler, and the fact the Saigo compiler has been maintained by Google up to 2025, bringing Clang 21 and C++23, the NaCl technology may be relevant for another decade and this allows the Unvanquished team to focus resources on other things.&lt;br /&gt;
&lt;br /&gt;
But [[Native Client]] will die one day and we are slowly preparing the future. [[WebAssembly]] is the best candidate for a Native Client successor.&lt;br /&gt;
&lt;br /&gt;
It's possible that the actual NaCl death will not come from Google but from Apple as they progressively deprecate the Rosetta 2 translation layer. When that will prevent to run the amd64 loader on Apple Silicon, then Native Client will be dead for macOS and would not be a viable multi-platform sandboxing solution anymore.}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9576</id>
		<title>Template:NativeClientIsDying</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:NativeClientIsDying&amp;diff=9576"/>
				<updated>2026-08-06T01:49:32Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|header=Native Client is (not yet) dying|Thanks to the [[Native Client#Rebuild effort|Native Client Rebuild effort]] for both the NaCl loader and the Saigo NaCl compiler, and the fact the Saigo compiler has been maintained by Google up to 2025, bringing Clang 21 and C++23, the NaCl technology may be relevant for another decade and this allows the Unvanquished team to focus resources on other things.&lt;br /&gt;
&lt;br /&gt;
But [[Native Client]] will die one day, and we are slowly preparing the future, and [[WebAssembly]] is the best candidate for a Native Client successor.&lt;br /&gt;
&lt;br /&gt;
It's possible that the actual NaCl death will not come from Google but from Apple when they will deprecate the Rosetta 2 translation layer. If that prevents to run the amd64 loader on Apple Silicon, then Native Client will be dead for macOS and would not be a viable multi-platform sandboxing solution anymore.}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9575</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9575"/>
				<updated>2026-08-06T01:48:53Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
{{nacl}} (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime to run NaCl executables;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger to build NaCl executables;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced crash reporting library with support for NaCl executables built with Saigo.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds. &lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9574</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9574"/>
				<updated>2026-08-06T01:46:21Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime to run NaCl executables;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger to build NaCl executables;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced crash reporting library with support for NaCl executables built with Saigo.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds. &lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9573</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9573"/>
				<updated>2026-08-06T01:45:25Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime to run NaCl executables;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger to build NaCl executables;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library with support for NaCl executables built with Saigo.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds. &lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9572</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9572"/>
				<updated>2026-08-06T01:42:03Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Dæmon Saigo SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds. &lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9571</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9571"/>
				<updated>2026-08-06T01:40:27Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern Toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team publish frequent releases of the {{saigo}} with ready-to-use prebuilt packages for a large number of platforms:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-nacl-sdk/releases}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}}) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9570</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9570"/>
				<updated>2026-08-05T08:40:46Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Google PNaCl SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD using Google PNaCl.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9569</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9569"/>
				<updated>2026-08-05T05:58:15Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
Crunch is also the recommended TGA-to-PNG converter. When converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch can produce compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9568</id>
		<title>Tools/Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Crunch&amp;diff=9568"/>
				<updated>2026-08-05T05:57:49Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon Crunch &amp;amp;mdash; Advanced DXTn Texture Compressor}}&lt;br /&gt;
[https://github.com/DaemonEngine/crunch Dæmon Crunch] is a maintained CRN texture compression library and command-line tool producing GPU-friendly formats such as CRN, DDS and KTX.&lt;br /&gt;
&lt;br /&gt;
Crunch is also the recommended TGA-to-PNG converter (when converting TGA images, prefer {{crunch}} over ImageMagick which is not reliable.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch] is the most maintained and up-to-date Crunch available and the best choice for game developers.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
The {{code|crunch}} tool was initially written by Binomial LLC then improved by Unity Technologies. The original Binomial Crunch is no longer maintained and lacks compatibility with newer Crunch formats. Although Unity contributed important improvements, the public Unity Crunch repository was never maintained as a proper long-term upstream project. Dæmon Crunch incorporated these improvements and has continued development with additional fixes, features, and maintenance.&lt;br /&gt;
&lt;br /&gt;
Neither Binomial nor Unity have merged Unvanquished fixes and never demonstrated any serious interest in merging fixes provided by others, so the Unvanquished team not only maintained the Dæmon Crunch fork to host fixes, but also incorporated fixes from others developers. The Unvanquished team is actively maintaining Dæmon Crunch since 2014 (already more than a decade of maintenance and improvements!).&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch source repository is: [https://github.com/DaemonEngine/crunch github.com/DaemonEngine/crunch].&lt;br /&gt;
&lt;br /&gt;
That repository provides the updated '''crunch''' tool, the '''crnlib''' library to provide full compression/decompression support to third-party applications, and the {{code|crn_decomp.h}} header-only library which is enough to transcode the Crunch CRN data for GPU upload and is perfect for lightweight integration in renderers. Some examples implementing various kinds of integrations are provided.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
Some other details can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md Crunch project README].&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch provides many improvements over the original crunch:&lt;br /&gt;
&lt;br /&gt;
* ✅️ Unity crunch format (runs many time faster and produces smaller files),&lt;br /&gt;
* ✅️ Unity crunch metadata (the header is compatible with Unity),&lt;br /&gt;
* ✅️ Improved image compatibility (1-bit PNG and horizontally-flipped TGA images are now supported),&lt;br /&gt;
* ✅️ Added features and command line options (top mip renormalization and more),&lt;br /&gt;
* ✅️ Network file system compatibility,&lt;br /&gt;
* ✅️ Optional header-only checksumming,&lt;br /&gt;
* ✅️ Multisystem and multiplatform,&lt;br /&gt;
* ✅️ Thoroughly tested and improved reproducibility,&lt;br /&gt;
* ✅️ CMake toolchain.&lt;br /&gt;
&lt;br /&gt;
===Image formats===&lt;br /&gt;
&lt;br /&gt;
* ✅️ CRN, DDS, KTX,&lt;br /&gt;
* ✅️ PNG, JPG, TGA, BMP.&lt;br /&gt;
&lt;br /&gt;
Crunch can produce compressed images optimized for performance and game rendering in various formats like DDS, KTX and CRN.&lt;br /&gt;
&lt;br /&gt;
All those three formats are containers for DXT-compressed bitmaps. This DXT-compressed data can be uploaded directly to the GPU memory without decompression, and the GPU can process DXT-compressed data without decompression.&lt;br /&gt;
&lt;br /&gt;
Crunch writes DXT-compressed data in a way an additional compression performs better on them, especially LZMA. For example, produced DDS images are expected to compress well if repackaged in an LZMA-based archive.&lt;br /&gt;
&lt;br /&gt;
The CRN format does all of this in one go: it stores the DXT-compressed data into a custom LZMA container.&lt;br /&gt;
&lt;br /&gt;
The game engine or any other application processing CRN files just have to unpack the LZMA container using provided functions and to upload the DXT-compressed data to the GPU.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch sets the {{code|m_userdata0}} header field to {{code|1}} to make it compatible with Unity.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Crunch runs multiple times faster than the original Crunch by BinomialLLC, thanks to the work done by Unity that has been imported. Unity people claimed the tool runs 2.5 time faster, and we measured the tool running 4.3 time faster on the Unvanquished corpus. Unity people claimed the tool compresses about 10% better, we measured more than 11% on the Unvanquished corpus. This performance bump comes with a compatibility-breaking change introduced in the Unity branch.&lt;br /&gt;
&lt;br /&gt;
The files produced by the Dæmon Crunch are then readable by both the Unity Crunch and the Dæmon Crunch but not by the original Binomial Crunch, while the files produced by the original Binomial Crunch are not readable by the Unity Crunch and the Dæmon Crunch. The Binomial Crunch isn't maintained anymore.&lt;br /&gt;
&lt;br /&gt;
===Portability===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch has very high cross-platform compatibility and is buildable with CMake.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/DaemonEngine/crunch Dæmon Crunch source repository] is known to build with various compilers, and the Dæmon {{code|crunch}} tool is known to run on Linux, Windows, macOS and FreeBSD systems on various hardware architectures.&lt;br /&gt;
&lt;br /&gt;
===Quality===&lt;br /&gt;
&lt;br /&gt;
A continuous integration pipeline is configured to test the building of the tool and the library themselves and to run some tests. The code is frequently submitted to CodeQL static analysis.&lt;br /&gt;
&lt;br /&gt;
===Adoption===&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch is known to be used by:&lt;br /&gt;
&lt;br /&gt;
* The {{engine}},&lt;br /&gt;
* The {{Tools|Urcheon}} game data build tool,&lt;br /&gt;
* The {{Tools|NetRadiant}} level editor and the {{Tools|Q3map2}} map compiler and light mapper,&lt;br /&gt;
* The [https://github.com/XQF/xqf XQF] game server browser,&lt;br /&gt;
* The [https://unvanquished.net Unvanquished game],&lt;br /&gt;
* The [https://xonotic.org Xonotic game],&lt;br /&gt;
* The [https://overgrowth.wolfire.com Overgrowth game],&lt;br /&gt;
* Some games using the Unity game engine.&lt;br /&gt;
&lt;br /&gt;
==How to use Crunch==&lt;br /&gt;
&lt;br /&gt;
{{QuickCrunchTutorial}}&lt;br /&gt;
&lt;br /&gt;
Some other usage instructions can be found in the [https://github.com/DaemonEngine/crunch/blob/master/README.md#creating-compressed-textures-with-crunch README].&lt;br /&gt;
&lt;br /&gt;
The {{code|-noNormalDetection}} and {{code|-rtopmip}} options are succinctly described below.&lt;br /&gt;
&lt;br /&gt;
==Dæmon Crunch Enhancements==&lt;br /&gt;
&lt;br /&gt;
Here are things you will not find in either Binomial Crunch, Unity Crunch or none of them:&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch format===&lt;br /&gt;
&lt;br /&gt;
This repository merged improvements done by Unity Technologies, it produces&lt;br /&gt;
smaller files and produces them faster than original code by Binomial.&lt;br /&gt;
Unity also modified the format which makes it incompatible with earlier versions of the tool.&lt;br /&gt;
&lt;br /&gt;
Quote from [https://unvanquished.net/unvanquished-area-51 unvanquished.net]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[https://blog.unity.com/technology/crunch-compression-of-etc-textures Unity guys said]&lt;br /&gt;
that their modified crunch tool “can compress up to 2.5&lt;br /&gt;
times faster, while providing about 10% better compression ratio”. So we&lt;br /&gt;
did a test on our own asset repository, re-crunching all the ressources&lt;br /&gt;
and textures packages. At the time we did the test the given corpus&lt;br /&gt;
produced 1797 .crn files.  &lt;br /&gt;
The Unity’s crunch tool reduced compression time by 4.31 and reduced size&lt;br /&gt;
by 11.15%. They said “up to 2.5 time faster” but we’ve seen some random&lt;br /&gt;
textures being compressed 6 time faster and the average of the whole is&lt;br /&gt;
4.3 time faster, and yes the tool compresses more than 10% more.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unity Crunch metadata===&lt;br /&gt;
&lt;br /&gt;
Unlike the Unity {{code|crunch}} tool built from their public repository, this tool produces files loadable by the Unity engine. Since [https://github.com/DaemonEngine/crunch/blob/master/faf5127b8c69dfd1ae554f4f3bf8168048b48d9f February 11th 2023], this branch sets the CRN {{code|m_userdata0}} field to {{code|1}} to make CRN files loadable by the Unity engine which now prevents to load files with this value set to {{code|0}}.&lt;br /&gt;
&lt;br /&gt;
Files with this value set to {{code|1}} are expected to use the new format. Files with this value set to {{code|0}} may or may not use the new format. When Unity updated the tool and modified the format in an incompatible way, no bit was modified to detect if a CRN file was using the old or the new format. Unity has not updated that field in their public repository of Crunch so files using new format with this value set to {{code|0}} may be found in the wild.&lt;br /&gt;
&lt;br /&gt;
===Improved image compatibility===&lt;br /&gt;
&lt;br /&gt;
Supported source file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG,PSD.&amp;lt;br/&amp;gt;&lt;br /&gt;
Supported output file formats: CRN,DDS,KTX,TGA,BMP,PNG,JPG/JPEG.&lt;br /&gt;
&lt;br /&gt;
* 1-bit PNG files are supported.&lt;br /&gt;
* Flipped TGA files are supported.&lt;br /&gt;
* Progressive JPEG files are supported.&lt;br /&gt;
&lt;br /&gt;
The {{code|stb_image}} library has been updated from version 1.18 to version 2.30, increasing the amount of image format variants that can be converted, like 1-bit PNG formats. Further improvements like horizontally-flipped TGA images were brought to {{code|stb_image}} to make it support more TGA variants.&lt;br /&gt;
&lt;br /&gt;
Note: Some other specific file format variants may be unsupported.&lt;br /&gt;
&lt;br /&gt;
See the docs for jpgd.h: {{url|code.google.com/p/jpeg-compressor}}&amp;lt;br/&amp;gt;&lt;br /&gt;
See the docs for stb_image.h: {{url|github.com/nothings/stb}}&lt;br /&gt;
&lt;br /&gt;
===Converted image reproducibility===&lt;br /&gt;
&lt;br /&gt;
We take special care that, when using compilation options for IEEE 754 float processing (disabling fast math, preferring SSE over x87…), the bitstream of converted image files are the same whatever the compiler, the operating system, or the CPU architecture crunch is built for and running on. It helps making packaged game assets reproducible. The CI not only checks that crunch builds, but that it runs properly and that the same input converts to the same output.&lt;br /&gt;
&lt;br /&gt;
When reproducibility isn't needed, fast math can be enabled with CMake with the {{code|1=-DUSE_FAST_MATH=ON}} CMake option.&lt;br /&gt;
&lt;br /&gt;
It is recommended for those looking for generating reproducible CRN files to keep disabled the use of fast math. It is also recommended to disable x87 floats on i686 and to rely on SSE instead with the {{code|1=-mfpmath=sse -msse}} compiler flags.&lt;br /&gt;
&lt;br /&gt;
===Added features and command line options===&lt;br /&gt;
&lt;br /&gt;
In addition to the original {{code|crunch}} features and command line options this branch brings new features and options, including:&lt;br /&gt;
&lt;br /&gt;
* {{code|-rtopmip}}: option to use with {{code|-renormalize}} to also renormalize on the top mip-level.&lt;br /&gt;
* {{code|-noNormalDetection}}: do not attempt to detect normal map to avoid selecting formats thought for normal maps when it's known an image is not a normal map. It may prevent the tool to use heavier and less-supported {{code|DXT5_AGBR}} format when {{code|DXT1}} is good enough.&lt;br /&gt;
* {{code|-h}} or {{code|--help}}: print the command line built-in help, listing all known options.&lt;br /&gt;
&lt;br /&gt;
===Network file system compatibility===&lt;br /&gt;
&lt;br /&gt;
The original {{code|crunch}} tool relied on non-standard I/O features not working on all file systems including network file systems like NFS or SSHFS. A standard implementation was added so the limitations are not there anymore and {{code|crunch}} can now process image files stored over the network and on any other file system.&lt;br /&gt;
&lt;br /&gt;
===Optional header-only checksumming===&lt;br /&gt;
&lt;br /&gt;
For applications distributing their files in containers already providing a checksum mechanism for the whole contained file, it's now possible to only validate the CRN header checksum instead of the whole file checksum to not checksum the whole file twice.&lt;br /&gt;
&lt;br /&gt;
===Multisystem and multiplatform portability===&lt;br /&gt;
&lt;br /&gt;
Unlike upstream branches from Binomial LLC and Unity Software Inc. this branch focuses on keeping the code buildable outside of Windows and Visual Studio, and adds a CMake build option alongside the legacy Makefile.&lt;br /&gt;
&lt;br /&gt;
This {{code|crunch}} tool and the related {{code|crnlib}} library are known to build with and and run on:&lt;br /&gt;
&lt;br /&gt;
* Compilers: GCC, MinGW, MSVC, Clang, Apple Clang, and more.&lt;br /&gt;
* Systems: Linux, Windows, macOS, FreeBSD.&lt;br /&gt;
* Architectures: amd64, arm64, i686, armhf.&lt;br /&gt;
&lt;br /&gt;
===Thoroughly tested and improved reproducibility===&lt;br /&gt;
&lt;br /&gt;
A continuous integration system tests the build of crunch for a dozen of configurations of different architecture, system or compiler. The output of such builds are also tested with most of those builds. It helped to improve and validate image support, to identify build options known to improve the reproducibility of the output, and is meant to catch regressions if they happen.&lt;br /&gt;
&lt;br /&gt;
The Dæmon crunch code is frequently scanned with the the CodeQL static analyser.&lt;br /&gt;
&lt;br /&gt;
===CMake build system===&lt;br /&gt;
&lt;br /&gt;
CMake has now replaced the old Makefile. The supplied CMake configuration provides many useful build options. Toolchain files for MinGW cross-compilation are also supplied.&lt;br /&gt;
&lt;br /&gt;
The native MSVC solution files were removed, it is expected that MSVC users generate them with CMake instead.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9567</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9567"/>
				<updated>2026-08-05T05:55:20Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern Toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds.&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Main_Page&amp;diff=9566</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Main_Page&amp;diff=9566"/>
				<updated>2026-08-05T04:50:20Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Unvanquished Wiki}}&lt;br /&gt;
* If you need help about the game or the wiki, jump on [https://unvanquished.net/chat/ IRC or Matrix or Discord] (see [[Chat#Rules|rules]]) or the {{forums}}.&lt;br /&gt;
* If you are facing a bug in the game, report it on [https://github.com/Unvanquished/Unvanquished/issues GitHub].&lt;br /&gt;
* Build the wiki! Contribute guides, information, corrections and improvements.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Install and play]] &amp;lt;/h2&amp;gt; &lt;br /&gt;
* [[Install and play#Getting the game|Getting the game]]&lt;br /&gt;
* [[Install and play#Running and configuration|Game configuration]]&lt;br /&gt;
* [[Bug reporting]]&lt;br /&gt;
* [[Install and play#Getting in contact|Getting in contact]]&lt;br /&gt;
* [[Linux packages|Alternative Linux packages]]&lt;br /&gt;
* [[Server/Running|Running a server]]&lt;br /&gt;
* [[GPU compatibility matrix]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Lore]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
* [[Humans]], [[Aliens]], [[:Category:Buildables|Buildables]], [[:Category:Weapons|Weapons]]…&lt;br /&gt;
* [[Gameplay|Gameplay guides]]&lt;br /&gt;
* [[Lore#Stories|Unvanquished stories]]&lt;br /&gt;
* [[Maps]] and [[Mods]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Projects|Projects and Tools]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Unvanquished|Unvanquished game]]&lt;br /&gt;
* [[Daemon|Dæmon engine]]&lt;br /&gt;
* [[Native Client|Native Client sandbox]]&lt;br /&gt;
* [[Infrastructure|Unvanquished&amp;amp;nbsp;infrastructure]]&lt;br /&gt;
* [[Tools|Unvanquished tools]]&lt;br /&gt;
* [[Projects#Unvanquished on the web|Unvanquished on the web]]&lt;br /&gt;
* [[Wiki project resources]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Coding]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
* [[Getting the source]]&lt;br /&gt;
* [[Compiling the source]]&lt;br /&gt;
* [[Contributing|Contributing guide]]&lt;br /&gt;
* [[Coding convention]]&lt;br /&gt;
* [[Dealing with submodules]]&lt;br /&gt;
* [[Continuous integration]]&lt;br /&gt;
* Reference materials&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Making and modding]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
* [[Mapping]], [[Modeling]], [[Texturing]]…&lt;br /&gt;
* [[Music and sounds]]&lt;br /&gt;
* [[Tutorials]], [[Formats]]&lt;br /&gt;
* [[Translation]]&lt;br /&gt;
* Gameplay modification&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mainPageNewBox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; [[Install and play#Getting in contact|Getting in contact]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Chat]]&lt;br /&gt;
* [//forums.unvanquished.net Forums]&lt;br /&gt;
* [[Web#Unvanquished on social hubs|Social hubs]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;{{NUMBEROFEDITS}} edits to {{NUMBEROFPAGES}} pages with {{NUMBEROFFILES}} uploaded files&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;height: 150px; width: 100%; overflow:hidden; align:centre;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Dir inpackage.png|x150px]][[File:Egg concept.png|x150px]] [[File:Om concept.png|x150px]] [[File:Librocket test custom menuscreen.png|x150px]] [[File:NetRadiant texture browser common.png|x150px]] [[File:Colourgrade_2.png|x150px]] [[File:Parpax upper.png|x150px]] [[File:Niveus brushesSelected.jpeg|x150px]] [[File:Mgturret render 300x240.png|x150px]] [[File:Barricade.png|x150px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__  &amp;lt;!-- Disable table of contents.  See https://www.mediawiki.org/wiki/Help:Magic_words --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9565</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9565"/>
				<updated>2026-08-05T04:47:47Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Debugging tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system for generating and analyzing crash dumps for the {{engine}} and {{nacl}} game modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9564</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9564"/>
				<updated>2026-08-05T04:46:28Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Debugging tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system used for generating and analyzing crash dumps for the {{engine}} and {{nacl}} gamelogic modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9563</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9563"/>
				<updated>2026-08-05T04:46:11Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Common creation tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system used for generating and analyzing crash dumps for the {{engine}} and [[Native Client|NaCl]] gamelogic modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9562</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9562"/>
				<updated>2026-08-05T04:45:34Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Specific editors we have created, or we maintain, or we may contribute to */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] and Unvanquished from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system used for generating and analyzing crash dumps for the {{engine}} and [[Native Client|NaCl]] gamelogic modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:Crunch&amp;diff=9561</id>
		<title>Template:Crunch</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:Crunch&amp;diff=9561"/>
				<updated>2026-08-05T04:43:39Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''{{#ifeq: {{{link|}}}|no|Dæmon Crunch|[[Tools/Crunch|Dæmon Crunch]]}}'''&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9560</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9560"/>
				<updated>2026-08-05T04:42:42Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Common creation tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system used for generating and analyzing crash dumps for the {{engine}} and [[Native Client|NaCl]] gamelogic modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9559</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools&amp;diff=9559"/>
				<updated>2026-08-05T04:41:23Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Unvanquished tools}}&lt;br /&gt;
Unvanquished provides or recommend a number of tools to assist developers and artists in creating content or in doing some game-related operations. All required editors and tools are expected to be free software.&lt;br /&gt;
&lt;br /&gt;
If you notice a specific task can't be done with free software, [https://github.com/Unvanquished/unvanquished-infrastructure/issues please report the issue there].&lt;br /&gt;
&lt;br /&gt;
==Version control system==&lt;br /&gt;
&lt;br /&gt;
{{InfoGit}}&lt;br /&gt;
&lt;br /&gt;
==Subset lists==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Level editors}} compares level editors;&lt;br /&gt;
* {{Tools|Mapping}} tools, including level editors, map compilers and other things;&lt;br /&gt;
* {{Tools|Modeling}} tools;&lt;br /&gt;
* {{Tools|IQM}} tools to edit or convert IQM model formats;&lt;br /&gt;
* {{Tools|Image}} tools;&lt;br /&gt;
* {{Tools|Audio}} tools;&lt;br /&gt;
&lt;br /&gt;
==Common editors==&lt;br /&gt;
&lt;br /&gt;
===Specific editors we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|NetRadiant}} is a graphical level editor,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Tools|Chameleon}} is a graphical application to assist mappers in replacing textures in game levels,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic editors===&lt;br /&gt;
&lt;br /&gt;
Unvanquished does not provide any way to install them, it is recommended to get them from their respective projects.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Blender}} is a 3D modeler used for modeling and animating Unvanquished models,&amp;lt;br/&amp;gt;by Blender Foundation;&lt;br /&gt;
* {{Tools|GIMP}} is a graphical editor used to edit Unvanquished textures and other images,&amp;lt;br/&amp;gt;by GIMP Development Team;&lt;br /&gt;
* {{Tools|Inkscape}} is a vector-based image editor to editor Unvanquished scalable images,&amp;lt;br/&amp;gt;by Inkscape authors;&lt;br /&gt;
* {{Tools|Audacity}} is an audio editor,&amp;lt;br/&amp;gt;by Audacity Team.&lt;br /&gt;
&lt;br /&gt;
==Common creation tools==&lt;br /&gt;
&lt;br /&gt;
===Specific tools we have created, or we maintain, or we may contribute to===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux.&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Sloth}} is a command-line tool to generate shader files from directories of texture maps,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Q3map2}} is a command-line tool to compile game levels,&amp;lt;br/&amp;gt;maintained by [https://xonotic.org Xonotic] from id Software, Xonotic, and Unvanquished code;&lt;br /&gt;
* {{Crunch}} is a command-line tool to compress images optimized for GPUs,&amp;lt;br/&amp;gt;Crunch is also the recommended TGA to PNG converter (prefer Dæmon Crunch over ImageMagick which is not reliable),&amp;lt;br/&amp;gt;maintained by Unvanquished, based on BinomialLLC, Unity Technologies and Unvanquished code;&lt;br /&gt;
* {{Tools|Iqmtool}} is a command-line tool to compile IQM models,&amp;lt;br/&amp;gt;maintained by [https://fte.triptohell.info FTE QuakeWorld], based on Lee Salzman ([http://sauerbraten.org Sauerbraten]) and FTE QuakeWorld code;&lt;br /&gt;
* {{Tools|Urcheon}} is a command-line tool to build and package asset repositories,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
* {{Tools|Esquirel}} is a command-line tool (part of Urcheon) to parse and edit MAP and BSP files,&amp;lt;br/&amp;gt;created for Unvanquished.&lt;br /&gt;
&lt;br /&gt;
===Other generic tools===&lt;br /&gt;
&lt;br /&gt;
See {{Tools|DaemonMediaAuthoringKit}} for an easy way to build all of them on Linux, but it is very likely you'll find upstream packages for your system.&lt;br /&gt;
&lt;br /&gt;
* [https://developers.google.com/speed/webp/docs/cwebp cwebp] is a WebP image converter,&amp;lt;br/&amp;gt;by Google;&lt;br /&gt;
* [https://opus-codec.org/ opusenc] is an Opus audio converter,&amp;lt;br/&amp;gt;by IETF, Xiph.Org and Skype;&lt;br /&gt;
* [https://xiph.org/vorbis/ oggenc] is a Vorbis audio converter,&amp;lt;br/&amp;gt;by Xiph.Org;&lt;br /&gt;
* [https://xiph.org/flac/ flac] is a FLAC audio converter,&amp;lt;br/&amp;gt;by Xiph.Org.&lt;br /&gt;
&lt;br /&gt;
==Game runtime==&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} is a modern sandbox for running {{nacl}} applications, &amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google code.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
* {{saigo}} is a modern toolchain for compiling {{nacl}} applications,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on LLVM, GNU and Google code.&lt;br /&gt;
&lt;br /&gt;
==Debugging tools==&lt;br /&gt;
&lt;br /&gt;
* {{breakpad}} is a crash-reporting system used for generating and analyzing crash dumps for the {{engine}} and [[Native Client|NaCl]] gamelogic modules,&amp;lt;br/&amp;gt;maintained by Unvanquished, based on Google and Jon Turney code.&lt;br /&gt;
* The {{saigo}} also provides the {{code|nacl-gdb}} debugger.&lt;br /&gt;
&lt;br /&gt;
==Development frameworks==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Yokai}} is a CMake framework for C/C++ projects providing advanced cross-compilation support and features like embedded file C++ generation,&amp;lt;br/&amp;gt;created for Unvanquished;&lt;br /&gt;
&lt;br /&gt;
==Obsolete tools==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|DaemonMap}} was a navmesh generator,&amp;lt;br/&amp;gt;maintained by Unvanquished from id Software code and Unvanquished code, starting with Unvanquished 0.54.0 the navmesh generator is built in the game itself so there is no need anymore to use an external tool.&lt;br /&gt;
&lt;br /&gt;
==Stalled editors==&lt;br /&gt;
&lt;br /&gt;
* {{Tools|Archipelago}} was a project for a web-based utility to rearrange UV islands in a model either to minimize texture sheet usage or to make room for new geometry.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9558</id>
		<title>Tools/Breakpad</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9558"/>
				<updated>2026-08-05T04:38:48Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Breakpad &amp;amp;mdash; Enhanced Breakpad Crash Reporting Library}}&lt;br /&gt;
Breakpad is a set of client and server components which implement a crash-reporting system, originally developed by Google.&lt;br /&gt;
&lt;br /&gt;
Dæmon Breakpad is an enhanced version of Google Breakpad providing wider platform compatibility and additional executable and symbol formats while incorporating upstream changes.&lt;br /&gt;
&lt;br /&gt;
The {{game}} uses Breakpad for generating and analyzing crash dumps from both the {{engine}} and {{nacl}} gamelogic modules. &lt;br /&gt;
&lt;br /&gt;
A crash dump is a file that is generated when the program crashes, which can be analyzed by developers to find out why the crash occurred. Breakpad is currently available in Daemon for the Windows (if built with MinGW) and Linux engine code, and the NaCl gamelogic on any platform.&lt;br /&gt;
&lt;br /&gt;
{{Note|content=Breakpad cannot be used for &amp;lt;i&amp;gt;native executable&amp;lt;/i&amp;gt; gamelogic modules. But (assuming a Linux server) you may use traditional core dumps instead. OR, you can use the &amp;lt;code&amp;gt;vm.cgame.type&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vm.sgame.type&amp;lt;/code&amp;gt; cvars to start up gdbserver.&lt;br /&gt;
{{TODO|inline=true|Explain how to use this.}}}}&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Breakpad source repository is: {{url|github.com/DaemonEngine/breakpad}}&lt;br /&gt;
&lt;br /&gt;
Dæmon's Breakpad fork is based on {{url|github.com/jon-turney/google-breakpad}}. Jon Turney's version adds MinGW support. It is in turn a fork of Chromium's Breakpad {{url|chromium.googlesource.com/breakpad/breakpad}}. Improvements from Google upstream are merged from time to time. We also implement our own improvements, like {{nacl}} compatibility and extended cross-platform support.&lt;br /&gt;
&lt;br /&gt;
== Dæmon Breakpad enhancements ==&lt;br /&gt;
&lt;br /&gt;
=== MinGW and DWARF5 compatibility ===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds MinGW support to Google Breakpad, based on Jon Turney's patches, with merged Google upstream adding support for DWARF5 debugging information format. It retains the support for systems already supported by the Google Breakpad upstream.&lt;br /&gt;
&lt;br /&gt;
===Saigo-built nexe compatibility===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds support for {{nacl}} {{code|.nexe}} binaries built with the {{saigo}}. The {{code|linux/dump_syms}} tool can extract symbols from those nexe. Don't mind the “linux” directory, it's an ELF tool.&lt;br /&gt;
&lt;br /&gt;
===Multiplatform ELF symbolizer===&lt;br /&gt;
&lt;br /&gt;
The {{code|linux/dumps_syms}} tool can build for and run on Linux, macOS, FreeBSD and Windows (when built with MinGW). It can then symbolize ELF binaries on all those platforms, including Linux binaries, FreeBSD binaries, and NaCl binaries.&lt;br /&gt;
&lt;br /&gt;
==Cross symbolizer compatibility==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! ↓ Host \ Binary →&lt;br /&gt;
! NaCl ELF !! Linux ELF !! FreeBSD ELF !! macOS Mach-O !! Windows PE+DWARF (MinGW)&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ✅️ || ✅️&lt;br /&gt;
|-&lt;br /&gt;
! FreeBSD&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! macOS&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! Windows (MinGW)&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Engine build configuration==&lt;br /&gt;
&lt;br /&gt;
The {{code|USE_BREAKPAD}} CMake option controls whether Breakpad support is built into the engine. It is disabled by default because Breakpad is primarily useful for publicly distributed release binaries, not people who build and run the code themselves. Note that NaCl crash dump support is always built in, regardless of options.&lt;br /&gt;
&lt;br /&gt;
For an engine built with Breakpad support, the &amp;lt;code&amp;gt;common.breakpad.enabled&amp;lt;/code&amp;gt; cvar turns it on or off.&lt;br /&gt;
&lt;br /&gt;
The cvar can only be set via the command line, like &amp;lt;code&amp;gt;./daemon -set common.breakpad.enabled 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==For users: reporting a crash==&lt;br /&gt;
&lt;br /&gt;
The crash dumps are stored in the homepath under the &amp;lt;code&amp;gt;crashdump/&amp;lt;/code&amp;gt; directory. Sort by date to find the most recent one and make sure it matches the date/time when the crash occurred. Send the .dmp file to someone on the Unvanquished development team.&lt;br /&gt;
&lt;br /&gt;
==For developers: how to trace a crash==&lt;br /&gt;
&lt;br /&gt;
=== 1. Getting the tools ===&lt;br /&gt;
&lt;br /&gt;
The Breakpad repository for the {{engine}} is at {{url|github.com/DaemonEngine/breakpad}}. If you have already checked out {{code|Daemon}}, then it is located in the &amp;lt;code&amp;gt;libs/breakpad/&amp;lt;/code&amp;gt; submodule there. cd into this repo.&lt;br /&gt;
&lt;br /&gt;
=== 2. Get symbols ===&lt;br /&gt;
&lt;br /&gt;
==== 2a. Symbols for an official Unvanquished release ====&lt;br /&gt;
&lt;br /&gt;
If you are debugging an official release binary, you don't need to (and can't) generate symbols yourself -- the Unvanquished release script handles this. In the Unvanquished unizip/torrent (or updater installation directory), symbol files are found in the &amp;lt;code&amp;gt;symbols_${VERSION}.zip&amp;lt;/code&amp;gt; archive. Simply extract the zip somewhere.&lt;br /&gt;
&lt;br /&gt;
==== 2b. Generating your own symbols ====&lt;br /&gt;
&lt;br /&gt;
To produce symbols, you need a binary with debug info. For MinGW, the binary additionally needs to have been built with the {{code|-Wl,--build-id}} flag so that it has a nonzero build ID.&lt;br /&gt;
&lt;br /&gt;
The first step is to build the dump_syms and/or dump_syms_dwarf executable using Make. Then you can use the &amp;lt;code&amp;gt;symbolize.py&amp;lt;/code&amp;gt; script in the root of Daemon's Breakpad repository to produce the symbols and store them in a symbol directory. Or if you want to know how to do it yourself, you can read the following paragraph which describes what the script does:&lt;br /&gt;
&lt;br /&gt;
You need to run the dump_syms tool (located at &amp;lt;code&amp;gt;src/tools/linux/dump_syms/dump_syms&amp;lt;/code&amp;gt; for Linux or NaCl targets or &amp;lt;code&amp;gt;src/tools/windows/dump_syms_dwarf/dump_syms&amp;lt;/code&amp;gt; for MinGW targets) on the binary(ies) where the crash occurred. Usage: &amp;lt;code&amp;gt;dump_syms &amp;lt;binary&amp;gt;&amp;lt;/code&amp;gt;. The output must be stored in a specific directory format. Pick a directory to be the symbol directory (&amp;lt;code&amp;gt;symbols&amp;lt;/code&amp;gt; in the following examples). The output must be stored at &amp;lt;code&amp;gt;symbols/$FILENAME/$BUILD_ID/$FILENAME.sym&amp;lt;/code&amp;gt; . For example, &amp;lt;code&amp;gt;symbols/cgame-native-dll.dll/1A74E057938E0BF10930C4F54740B2E21/cgame-native-dll.dll.sym&amp;lt;/code&amp;gt;. The build ID can be seen in the first few lines of dump_syms output in a line beginning with &amp;lt;code&amp;gt;MODULE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 3. Stack walk ===&lt;br /&gt;
Running the stack walk tool (located at &amp;lt;code&amp;gt;src/processor/minidump_stackwalk&amp;lt;/code&amp;gt;) will give the human-readable stack trace.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;minidump_stackwalk &amp;lt;dump file&amp;gt; &amp;lt;symbol directory&amp;gt;&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9557</id>
		<title>Tools/Breakpad</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9557"/>
				<updated>2026-08-05T04:36:58Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Breakpad &amp;amp;mdash; Enhanced Breakpad Crash Reporting Library}}&lt;br /&gt;
Breakpad is a set of client and server components which implement a crash-reporting system, originally developed by Google.&lt;br /&gt;
&lt;br /&gt;
Dæmon Breakpad is an enhanced version of Google Breakpad providing wider platform compatibility and additional executable and symbol formats while incorporating upstream changes.&lt;br /&gt;
&lt;br /&gt;
The {{game}} uses Breakpad for generating and analyzing crash dumps from both the {{engine}} and {{nacl}} gamelogic modules. &lt;br /&gt;
&lt;br /&gt;
A crash dump is a file that is generated when the program crashes, which can be analyzed by developers to find out why the crash occurred. Breakpad is currently available in Daemon for the Windows (if built with MinGW) and Linux engine code, and the NaCl gamelogic on any platform.&lt;br /&gt;
&lt;br /&gt;
{{Note|content=Breakpad cannot be used for &amp;lt;i&amp;gt;native executable&amp;lt;/i&amp;gt; gamelogic modules. But (assuming a Linux server) you may use traditional core dumps instead. OR, you can use the &amp;lt;code&amp;gt;vm.cgame.type&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vm.sgame.type&amp;lt;/code&amp;gt; cvars to start up gdbserver.&lt;br /&gt;
{{TODO|inline=true|Explain how to use this.}}}}&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Breakpad source repository is: {{url|github.com/DaemonEngine/breakpad}}&lt;br /&gt;
&lt;br /&gt;
Dæmon's Breakpad fork is based on {{url|github.com/jon-turney/google-breakpad}}. Jon Turney's version adds MinGW support. It is in turn a fork of Chromium's Breakpad {{url|chromium.googlesource.com/breakpad/breakpad}}. Improvements from Google upstream are merged from time to time. We also implement our own improvements, like [[Native Client]] compatibility and extended cross-platform support.&lt;br /&gt;
&lt;br /&gt;
== Dæmon Breakpad enhancements ==&lt;br /&gt;
&lt;br /&gt;
=== MinGW and DWARF5 compatibility ===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds MinGW support to Google Breakpad, based on Jon Turney's patches, with merged Google upstream adding support for DWARF5 debugging information format. It retains the support for systems already supported by the Google Breakpad upstream.&lt;br /&gt;
&lt;br /&gt;
===Saigo-built nexe compatibility===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds support for [[Native Client]] {{code|.nexe}} binaries built with the {{saigo}}. The {{code|linux/dump_syms}} tool can extract symbols from those nexe. Don't mind the “linux” directory, it's an ELF tool.&lt;br /&gt;
&lt;br /&gt;
===Multiplatform ELF symbolizer===&lt;br /&gt;
&lt;br /&gt;
The {{code|linux/dumps_syms}} tool can build for and run on Linux, macOS, FreeBSD and Windows (when built with MinGW). It can then symbolize ELF binaries on all those platforms, including Linux binaries, FreeBSD binaries, and NaCl binaries.&lt;br /&gt;
&lt;br /&gt;
==Cross symbolizer compatibility==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! ↓ Host \ Binary →&lt;br /&gt;
! NaCl ELF !! Linux ELF !! FreeBSD ELF !! macOS Mach-O !! Windows PE+DWARF (MinGW)&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ✅️ || ✅️&lt;br /&gt;
|-&lt;br /&gt;
! FreeBSD&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! macOS&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! Windows (MinGW)&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Engine build configuration==&lt;br /&gt;
&lt;br /&gt;
The {{code|USE_BREAKPAD}} CMake option controls whether Breakpad support is built into the engine. It is disabled by default because Breakpad is primarily useful for publicly distributed release binaries, not people who build and run the code themselves. Note that NaCl crash dump support is always built in, regardless of options.&lt;br /&gt;
&lt;br /&gt;
For an engine built with Breakpad support, the &amp;lt;code&amp;gt;common.breakpad.enabled&amp;lt;/code&amp;gt; cvar turns it on or off.&lt;br /&gt;
&lt;br /&gt;
The cvar can only be set via the command line, like &amp;lt;code&amp;gt;./daemon -set common.breakpad.enabled 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==For users: reporting a crash==&lt;br /&gt;
&lt;br /&gt;
The crash dumps are stored in the homepath under the &amp;lt;code&amp;gt;crashdump/&amp;lt;/code&amp;gt; directory. Sort by date to find the most recent one and make sure it matches the date/time when the crash occurred. Send the .dmp file to someone on the Unvanquished development team.&lt;br /&gt;
&lt;br /&gt;
==For developers: how to trace a crash==&lt;br /&gt;
&lt;br /&gt;
=== 1. Getting the tools ===&lt;br /&gt;
&lt;br /&gt;
The Breakpad repository for the {{engine}} is at {{url|github.com/DaemonEngine/breakpad}}. If you have already checked out {{code|Daemon}}, then it is located in the &amp;lt;code&amp;gt;libs/breakpad/&amp;lt;/code&amp;gt; submodule there. cd into this repo.&lt;br /&gt;
&lt;br /&gt;
=== 2. Get symbols ===&lt;br /&gt;
&lt;br /&gt;
==== 2a. Symbols for an official Unvanquished release ====&lt;br /&gt;
&lt;br /&gt;
If you are debugging an official release binary, you don't need to (and can't) generate symbols yourself -- the Unvanquished release script handles this. In the Unvanquished unizip/torrent (or updater installation directory), symbol files are found in the &amp;lt;code&amp;gt;symbols_${VERSION}.zip&amp;lt;/code&amp;gt; archive. Simply extract the zip somewhere.&lt;br /&gt;
&lt;br /&gt;
==== 2b. Generating your own symbols ====&lt;br /&gt;
&lt;br /&gt;
To produce symbols, you need a binary with debug info. For MinGW, the binary additionally needs to have been built with the {{code|-Wl,--build-id}} flag so that it has a nonzero build ID.&lt;br /&gt;
&lt;br /&gt;
The first step is to build the dump_syms and/or dump_syms_dwarf executable using Make. Then you can use the &amp;lt;code&amp;gt;symbolize.py&amp;lt;/code&amp;gt; script in the root of Daemon's Breakpad repository to produce the symbols and store them in a symbol directory. Or if you want to know how to do it yourself, you can read the following paragraph which describes what the script does:&lt;br /&gt;
&lt;br /&gt;
You need to run the dump_syms tool (located at &amp;lt;code&amp;gt;src/tools/linux/dump_syms/dump_syms&amp;lt;/code&amp;gt; for Linux or NaCl targets or &amp;lt;code&amp;gt;src/tools/windows/dump_syms_dwarf/dump_syms&amp;lt;/code&amp;gt; for MinGW targets) on the binary(ies) where the crash occurred. Usage: &amp;lt;code&amp;gt;dump_syms &amp;lt;binary&amp;gt;&amp;lt;/code&amp;gt;. The output must be stored in a specific directory format. Pick a directory to be the symbol directory (&amp;lt;code&amp;gt;symbols&amp;lt;/code&amp;gt; in the following examples). The output must be stored at &amp;lt;code&amp;gt;symbols/$FILENAME/$BUILD_ID/$FILENAME.sym&amp;lt;/code&amp;gt; . For example, &amp;lt;code&amp;gt;symbols/cgame-native-dll.dll/1A74E057938E0BF10930C4F54740B2E21/cgame-native-dll.dll.sym&amp;lt;/code&amp;gt;. The build ID can be seen in the first few lines of dump_syms output in a line beginning with &amp;lt;code&amp;gt;MODULE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 3. Stack walk ===&lt;br /&gt;
Running the stack walk tool (located at &amp;lt;code&amp;gt;src/processor/minidump_stackwalk&amp;lt;/code&amp;gt;) will give the human-readable stack trace.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;minidump_stackwalk &amp;lt;dump file&amp;gt; &amp;lt;symbol directory&amp;gt;&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9556</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9556"/>
				<updated>2026-08-05T04:35:32Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Postmortem Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9555</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9555"/>
				<updated>2026-08-05T04:34:59Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: /* Interactive Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old GDB from the PNaCl SDK or the GDB provided with the {{saigo}}. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{Tools|Breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Category:Native_Client&amp;diff=9554</id>
		<title>Category:Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Category:Native_Client&amp;diff=9554"/>
				<updated>2026-08-05T04:32:45Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: Created page with &amp;quot;Pages related to {{nacl}}.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pages related to {{nacl}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9553</id>
		<title>Tools/Saigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Saigo&amp;diff=9553"/>
				<updated>2026-08-05T04:32:23Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Saigo SDK &amp;amp;mdash; Modern toolchain for Native Client}}&lt;br /&gt;
Saigo is a modern toolchain for compiling {{nacl}} applications.&lt;br /&gt;
&lt;br /&gt;
{{Trivia|&lt;br /&gt;
In Japanese, ''Saigo'' (さいご / 最後) means “''the last''”, “''the end''”, “''the final''” or “''the conclusion''”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…}}&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds.&lt;br /&gt;
&lt;br /&gt;
==Components==&lt;br /&gt;
&lt;br /&gt;
The Saigo SDK consists of:&lt;br /&gt;
&lt;br /&gt;
* C and C++ compilers based on LLVM clang;&lt;br /&gt;
* Utilities like a linker, based on GNU binutils;&lt;br /&gt;
* A debugger, based on GDB;&lt;br /&gt;
* A libc based on Newlib and a libc++ based on LLVM.&lt;br /&gt;
* Headers from the Native Client repositories.&lt;br /&gt;
&lt;br /&gt;
The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the Saigo Native Client SDK can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:&lt;br /&gt;
&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-llvm-project-v10}} (Saigo NaCl clang)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-binutils}} (NaCl binutils)&lt;br /&gt;
* {{url|chromium.googlesource.com/native_client/nacl-gdb}} (NaCl Saigo GDB)&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}} (NaCl headers)&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==Breakpad support==&lt;br /&gt;
&lt;br /&gt;
Code compiled with Saigo uses {{code|-2}} instead of {{code|-1}} as value for the CFA pseudo-register.&lt;br /&gt;
&lt;br /&gt;
We patched {{Tools|Breakpad}} to also support Saigo binaries, see this [https://github.com/DaemonEngine/breakpad/pull/19 patch].&lt;br /&gt;
&lt;br /&gt;
==Migration to Saigo==&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9552</id>
		<title>Tools/Breakpad</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/Breakpad&amp;diff=9552"/>
				<updated>2026-08-05T04:32:03Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon Breakpad &amp;amp;mdash; Enhanced Breakpad Crash Reporting Library}}&lt;br /&gt;
Breakpad is a set of client and server components which implement a crash-reporting system, originally developed by Google.&lt;br /&gt;
&lt;br /&gt;
Dæmon Breakpad is an enhanced version of Google Breakpad providing wider platform compatibility and additional executable and symbol formats while incorporating upstream changes.&lt;br /&gt;
&lt;br /&gt;
The {{game}} uses Breakpad for generating and analyzing crash dumps from both the {{engine}} and [[Native Client|NaCl]] gamelogic modules. &lt;br /&gt;
&lt;br /&gt;
A crash dump is a file that is generated when the program crashes, which can be analyzed by developers to find out why the crash occurred. Breakpad is currently available in Daemon for the Windows (if built with MinGW) and Linux engine code, and the NaCl gamelogic on any platform.&lt;br /&gt;
&lt;br /&gt;
{{Note|content=Breakpad cannot be used for &amp;lt;i&amp;gt;native executable&amp;lt;/i&amp;gt; gamelogic modules. But (assuming a Linux server) you may use traditional core dumps instead. OR, you can use the &amp;lt;code&amp;gt;vm.cgame.type&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vm.sgame.type&amp;lt;/code&amp;gt; cvars to start up gdbserver.&lt;br /&gt;
{{TODO|inline=true|Explain how to use this.}}}}&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The Breakpad source repository is: {{url|github.com/DaemonEngine/breakpad}}&lt;br /&gt;
&lt;br /&gt;
Dæmon's Breakpad fork is based on {{url|github.com/jon-turney/google-breakpad}}. Jon Turney's version adds MinGW support. It is in turn a fork of Chromium's Breakpad {{url|chromium.googlesource.com/breakpad/breakpad}}. Improvements from Google upstream are merged from time to time. We also implement our own improvements, like [[Native Client]] compatibility and extended cross-platform support.&lt;br /&gt;
&lt;br /&gt;
== Dæmon Breakpad enhancements ==&lt;br /&gt;
&lt;br /&gt;
=== MinGW and DWARF5 compatibility ===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds MinGW support to Google Breakpad, based on Jon Turney's patches, with merged Google upstream adding support for DWARF5 debugging information format. It retains the support for systems already supported by the Google Breakpad upstream.&lt;br /&gt;
&lt;br /&gt;
===Saigo-built nexe compatibility===&lt;br /&gt;
&lt;br /&gt;
The Dæmon Breakpad adds support for [[Native Client]] {{code|.nexe}} binaries built with the {{saigo}}. The {{code|linux/dump_syms}} tool can extract symbols from those nexe. Don't mind the “linux” directory, it's an ELF tool.&lt;br /&gt;
&lt;br /&gt;
===Multiplatform ELF symbolizer===&lt;br /&gt;
&lt;br /&gt;
The {{code|linux/dumps_syms}} tool can build for and run on Linux, macOS, FreeBSD and Windows (when built with MinGW). It can then symbolize ELF binaries on all those platforms, including Linux binaries, FreeBSD binaries, and NaCl binaries.&lt;br /&gt;
&lt;br /&gt;
==Cross symbolizer compatibility==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! ↓ Host \ Binary →&lt;br /&gt;
! NaCl ELF !! Linux ELF !! FreeBSD ELF !! macOS Mach-O !! Windows PE+DWARF (MinGW)&lt;br /&gt;
|-&lt;br /&gt;
! Linux&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ✅️ || ✅️&lt;br /&gt;
|-&lt;br /&gt;
! FreeBSD&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! macOS&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|-&lt;br /&gt;
! Windows (MinGW)&lt;br /&gt;
| ✅️ || ✅️ || ✅️ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Engine build configuration==&lt;br /&gt;
&lt;br /&gt;
The {{code|USE_BREAKPAD}} CMake option controls whether Breakpad support is built into the engine. It is disabled by default because Breakpad is primarily useful for publicly distributed release binaries, not people who build and run the code themselves. Note that NaCl crash dump support is always built in, regardless of options.&lt;br /&gt;
&lt;br /&gt;
For an engine built with Breakpad support, the &amp;lt;code&amp;gt;common.breakpad.enabled&amp;lt;/code&amp;gt; cvar turns it on or off.&lt;br /&gt;
&lt;br /&gt;
The cvar can only be set via the command line, like &amp;lt;code&amp;gt;./daemon -set common.breakpad.enabled 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==For users: reporting a crash==&lt;br /&gt;
&lt;br /&gt;
The crash dumps are stored in the homepath under the &amp;lt;code&amp;gt;crashdump/&amp;lt;/code&amp;gt; directory. Sort by date to find the most recent one and make sure it matches the date/time when the crash occurred. Send the .dmp file to someone on the Unvanquished development team.&lt;br /&gt;
&lt;br /&gt;
==For developers: how to trace a crash==&lt;br /&gt;
&lt;br /&gt;
=== 1. Getting the tools ===&lt;br /&gt;
&lt;br /&gt;
The Breakpad repository for the {{engine}} is at {{url|github.com/DaemonEngine/breakpad}}. If you have already checked out {{code|Daemon}}, then it is located in the &amp;lt;code&amp;gt;libs/breakpad/&amp;lt;/code&amp;gt; submodule there. cd into this repo.&lt;br /&gt;
&lt;br /&gt;
=== 2. Get symbols ===&lt;br /&gt;
&lt;br /&gt;
==== 2a. Symbols for an official Unvanquished release ====&lt;br /&gt;
&lt;br /&gt;
If you are debugging an official release binary, you don't need to (and can't) generate symbols yourself -- the Unvanquished release script handles this. In the Unvanquished unizip/torrent (or updater installation directory), symbol files are found in the &amp;lt;code&amp;gt;symbols_${VERSION}.zip&amp;lt;/code&amp;gt; archive. Simply extract the zip somewhere.&lt;br /&gt;
&lt;br /&gt;
==== 2b. Generating your own symbols ====&lt;br /&gt;
&lt;br /&gt;
To produce symbols, you need a binary with debug info. For MinGW, the binary additionally needs to have been built with the {{code|-Wl,--build-id}} flag so that it has a nonzero build ID.&lt;br /&gt;
&lt;br /&gt;
The first step is to build the dump_syms and/or dump_syms_dwarf executable using Make. Then you can use the &amp;lt;code&amp;gt;symbolize.py&amp;lt;/code&amp;gt; script in the root of Daemon's Breakpad repository to produce the symbols and store them in a symbol directory. Or if you want to know how to do it yourself, you can read the following paragraph which describes what the script does:&lt;br /&gt;
&lt;br /&gt;
You need to run the dump_syms tool (located at &amp;lt;code&amp;gt;src/tools/linux/dump_syms/dump_syms&amp;lt;/code&amp;gt; for Linux or NaCl targets or &amp;lt;code&amp;gt;src/tools/windows/dump_syms_dwarf/dump_syms&amp;lt;/code&amp;gt; for MinGW targets) on the binary(ies) where the crash occurred. Usage: &amp;lt;code&amp;gt;dump_syms &amp;lt;binary&amp;gt;&amp;lt;/code&amp;gt;. The output must be stored in a specific directory format. Pick a directory to be the symbol directory (&amp;lt;code&amp;gt;symbols&amp;lt;/code&amp;gt; in the following examples). The output must be stored at &amp;lt;code&amp;gt;symbols/$FILENAME/$BUILD_ID/$FILENAME.sym&amp;lt;/code&amp;gt; . For example, &amp;lt;code&amp;gt;symbols/cgame-native-dll.dll/1A74E057938E0BF10930C4F54740B2E21/cgame-native-dll.dll.sym&amp;lt;/code&amp;gt;. The build ID can be seen in the first few lines of dump_syms output in a line beginning with &amp;lt;code&amp;gt;MODULE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 3. Stack walk ===&lt;br /&gt;
Running the stack walk tool (located at &amp;lt;code&amp;gt;src/processor/minidump_stackwalk&amp;lt;/code&amp;gt;) will give the human-readable stack trace.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;minidump_stackwalk &amp;lt;dump file&amp;gt; &amp;lt;symbol directory&amp;gt;&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9551</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9551"/>
				<updated>2026-08-05T04:31:50Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Native Client]]{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old PNaCl GDB. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{Tools|Breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/NaCl_Runtime&amp;diff=9550</id>
		<title>Tools/NaCl Runtime</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/NaCl_Runtime&amp;diff=9550"/>
				<updated>2026-08-05T04:31:42Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]][[Category:Native Client]]{{DISPLAYTITLE:Dæmon NaCl Runtime &amp;amp;mdash; Modern Native Client Runtime}}&lt;br /&gt;
The {{naclruntime}} provides the loader to run {{nacl}} applications built with the {{saigo}}.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has been verified that Linux on {{code|arm64}}, {{code|ppc64el}} and {{code|riscv64}} can run the {{code|amd64}} loader on [https://box86.org Box64], though on {{code|riscv64}} it is very slow. The '''Box64''' translation layer can also run on {{code|loong64}} but this has not been tested yet. The {{engine}} received patches to run Box64, but the user has to build the engine themselves and provides Box64. This is work-in-progress. Box64 integration is still work in progress (at some point we may ship Box64 with engines that can use it).&lt;br /&gt;
&lt;br /&gt;
The NaCl loader (the virtual machine running the virtualised code) is available for three systems: Linux, Windows and macOS. The supported architectures differs per system:&lt;br /&gt;
&lt;br /&gt;
* Linux: amd64, i686, armhf;&lt;br /&gt;
* Windows: amd64, i686;&lt;br /&gt;
* macOS: amd64.&lt;br /&gt;
&lt;br /&gt;
It is possible to run native engines with other platforms when there is a compatibility layer to run the NaCl loader:&lt;br /&gt;
&lt;br /&gt;
* Linux, arm64: running the armhf NaCl loader through built-in Linux Multiarch compatibility;&lt;br /&gt;
* macOS, arm64: running the amd64 NaCl loader through Rosetta2 compatibility;&lt;br /&gt;
* FreeBSD, amd64: running the Linux NaCl loader through built-in Linuxulator compatibility.&lt;br /&gt;
&lt;br /&gt;
We provide the Multiarch libraries for running the armhf game on Linux arm64, no system modification is required on that part.&lt;br /&gt;
&lt;br /&gt;
The Linux armhf NaCl loader requires a 4k PageSize kernel, this may require a system modification:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3286}}&lt;br /&gt;
&lt;br /&gt;
There is work in progress to remove this restriction.&lt;br /&gt;
&lt;br /&gt;
The Linux i686 and armhf NaCl loaders may run on FreeBSD using Linuxulator but it is not tested.&lt;br /&gt;
&lt;br /&gt;
NaCl also supportrf 32-bit MIPS on Linux but this architecture is not supported by the {{engine}} and the {{game}} project, and is not supported by the {{saigo}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9549</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9549"/>
				<updated>2026-08-05T04:31:05Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client with compilers and a debugger;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old PNaCl GDB. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{Tools|Breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Tools/NaCl_Runtime&amp;diff=9548</id>
		<title>Tools/NaCl Runtime</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Tools/NaCl_Runtime&amp;diff=9548"/>
				<updated>2026-08-05T04:29:27Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tools]]{{DISPLAYTITLE:Dæmon NaCl Runtime &amp;amp;mdash; Modern Native Client Runtime}}&lt;br /&gt;
The {{naclruntime}} provides the loader to run {{nacl}} applications built with the {{saigo}}.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has been verified that Linux on {{code|arm64}}, {{code|ppc64el}} and {{code|riscv64}} can run the {{code|amd64}} loader on [https://box86.org Box64], though on {{code|riscv64}} it is very slow. The '''Box64''' translation layer can also run on {{code|loong64}} but this has not been tested yet. The {{engine}} received patches to run Box64, but the user has to build the engine themselves and provides Box64. This is work-in-progress. Box64 integration is still work in progress (at some point we may ship Box64 with engines that can use it).&lt;br /&gt;
&lt;br /&gt;
The NaCl loader (the virtual machine running the virtualised code) is available for three systems: Linux, Windows and macOS. The supported architectures differs per system:&lt;br /&gt;
&lt;br /&gt;
* Linux: amd64, i686, armhf;&lt;br /&gt;
* Windows: amd64, i686;&lt;br /&gt;
* macOS: amd64.&lt;br /&gt;
&lt;br /&gt;
It is possible to run native engines with other platforms when there is a compatibility layer to run the NaCl loader:&lt;br /&gt;
&lt;br /&gt;
* Linux, arm64: running the armhf NaCl loader through built-in Linux Multiarch compatibility;&lt;br /&gt;
* macOS, arm64: running the amd64 NaCl loader through Rosetta2 compatibility;&lt;br /&gt;
* FreeBSD, amd64: running the Linux NaCl loader through built-in Linuxulator compatibility.&lt;br /&gt;
&lt;br /&gt;
We provide the Multiarch libraries for running the armhf game on Linux arm64, no system modification is required on that part.&lt;br /&gt;
&lt;br /&gt;
The Linux armhf NaCl loader requires a 4k PageSize kernel, this may require a system modification:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3286}}&lt;br /&gt;
&lt;br /&gt;
There is work in progress to remove this restriction.&lt;br /&gt;
&lt;br /&gt;
The Linux i686 and armhf NaCl loaders may run on FreeBSD using Linuxulator but it is not tested.&lt;br /&gt;
&lt;br /&gt;
NaCl also supportrf 32-bit MIPS on Linux but this architecture is not supported by the {{engine}} and the {{game}} project, and is not supported by the {{saigo}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Template:Breakpad&amp;diff=9547</id>
		<title>Template:Breakpad</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Template:Breakpad&amp;diff=9547"/>
				<updated>2026-08-05T04:29:06Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''{{#ifeq: {{{link|}}}|no|Dæmon Breakpad|[[Tools/Breakpad|Dæmon Breakpad]]}}'''&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	<entry>
		<id>https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9546</id>
		<title>Native Client</title>
		<link rel="alternate" type="text/html" href="https://wiki.unvanquished.net/index.php?title=Native_Client&amp;diff=9546"/>
				<updated>2026-08-05T04:28:27Z</updated>
		
		<summary type="html">&lt;p&gt;Illwieckz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Native Client &amp;amp;mdash; Secure Native Code Sandbox Technology}}&lt;br /&gt;
Native Client (also known as NaCl) is a sandboxing technology by Google. It was used by Chrome extensions and Chrome apps. The {{engine}} uses Native Client to securely and portably run downloadable compiled games. It replaced the Q3VM (Quake 3 Virtual Machine) in the engine.&lt;br /&gt;
&lt;br /&gt;
The Native Client documentation can be found on [https://chrome.jscn.org/docs/native-client/welcome-to-native-client/ chrome.jscn.org/docs/native-client/welcome-to-native-client/].&lt;br /&gt;
&lt;br /&gt;
The NaCl support consists of:&lt;br /&gt;
&lt;br /&gt;
* {{naclruntime}} &amp;amp;mdash; a modern Native Client runtime;&lt;br /&gt;
* {{saigo}} &amp;amp;mdash; a modern toolchain for Native Client;&lt;br /&gt;
* {{breakpad}} &amp;amp;mdash; an enhanced breakpad crash reporting library.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
'''Native Client''' or '''NaCl''' is the current technology used for securely virtualising the game code in the {{engine}}.&lt;br /&gt;
&lt;br /&gt;
Server-side game logic NaCl support was first shipped in Alpha 27, released in April 2014. See the [https://unvanquished.net/moving-the-server-side-gamelogic-to-pnacl/ blog article by Kangz] and [https://unvanquished.net/alpha-27-flying-in-your-direction/ the release note by DSalt].&lt;br /&gt;
&lt;br /&gt;
Client-side game logic NaCl support was first shipped in Alpha 37, released on March 2, 2015. See the [https://unvanquished.net/alpha-37-anniversary-edition/ release note by Kangz].&lt;br /&gt;
&lt;br /&gt;
This completed the transition by porting the client VM to NaCl and this replaced entirely the legacy Quake III Q3VM system.&lt;br /&gt;
&lt;br /&gt;
NaCl upstream development has slowed down since the competing solution [[WebAssembly]] became the industry standard, so it is very unlikely support for new systems and architecture would be added. To overcome this problem, we would have to switch to WebAssembly (that unfortunately may only support using a slow interpreter for some platforms NaCl supports, like i686 or armhf), but more importantly may still lack support for exceptions or {{code|setjmp/longjmp}} and then  not be complete enough for our needs yet.&lt;br /&gt;
&lt;br /&gt;
{{NativeClientIsDying}}&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Game VM comparison&lt;br /&gt;
|-&lt;br /&gt;
! !! Quake 3 / Tremulous !! Dæmon / Unvanquished&lt;br /&gt;
|-&lt;br /&gt;
| Technology || Q3VM || NaCl&lt;br /&gt;
|-&lt;br /&gt;
| Language || Old C (&amp;lt;ins&amp;gt;NOT&amp;lt;/ins&amp;gt; Quake C) || Modern C / C++&lt;br /&gt;
|-&lt;br /&gt;
| Compiler || LCC (proprietary) || Clang (open-source)&lt;br /&gt;
|-&lt;br /&gt;
| System portability || Yes || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Architecture portability || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Secure sandbox || No || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the Quake 3 engine and the Q3VM, the game code was programmed in C (it should not be confused with the scripting language of Quake 1 named QuakeC). This C code was real C was meant to be compiled with the proprietary LCC compiler, which only supported an old C, and the developer couldn't really rely on off-the-shelf libraries. That C code was compiled by LCC into {{code|.qvm}} binaries.&lt;br /&gt;
&lt;br /&gt;
With the {{engine}}, the game code can be programmed in C or C++. That C/C++ code is compiled with Clang-based open source compilers supporting modern-enough C++ versions that makes possible to reuse off-the-shelf C++ libraries that may even be shared between the engine and the game source code. The C/C+ code is compiled into {{code|.nexe}} binarie.&lt;br /&gt;
&lt;br /&gt;
Unlike QVMs, NaCl gamelogic runs in a secure sandbox. Native Client lets you run mods downloaded from the internet without giving them free reign on your computer. QVM was equivalent to running a DLL with no protection.&lt;br /&gt;
&lt;br /&gt;
==Platform support==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientPlatformSupport}}&lt;br /&gt;
&lt;br /&gt;
==NaCl Runtime==&lt;br /&gt;
&lt;br /&gt;
See the {{naclruntime}} page for details.&lt;br /&gt;
&lt;br /&gt;
==Rebuild effort==&lt;br /&gt;
&lt;br /&gt;
{{NativeClientGoogleDeprecation}}&lt;br /&gt;
&lt;br /&gt;
The Unvanquished team is working on rebuilding the {{nacl}} ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the {{saigo}} being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{naclruntime}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/native_client}}&lt;br /&gt;
&lt;br /&gt;
The official releases for Unvanquished are already using the {{naclruntime}} on Linux for the {{code|amd64}} architecture, other systems are still using the Google NaCl Runtime.&lt;br /&gt;
&lt;br /&gt;
The project for rebuilding the {{saigo}} can be found there:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/DaemonEngine/saigo-release-scripts}}&lt;br /&gt;
&lt;br /&gt;
It's already possible to build Unvanquished with a Saigo compiler rebuilt this way.&lt;br /&gt;
&lt;br /&gt;
==Compilers==&lt;br /&gt;
&lt;br /&gt;
===Google PNaCl SDK===&lt;br /&gt;
&lt;br /&gt;
PNaCl Clang is the current NaCl compiler we use to build the nexe game binaries. It is based on an old Clang 3.6 and does not support C++ above C++14. To overcome some of the related limitations we may switch to Saigo.&lt;br /&gt;
&lt;br /&gt;
The PNaCl compilation workflow is to build a single {{code|.pexe}} then to translate them to per-architecture {{code|.nexe}} (amd64, i686, armhf) using a specific translator tool.&lt;br /&gt;
&lt;br /&gt;
The PNaCl SDK consists on Python-based wrappers around Clang internals. It was initially using now-obsolete and hard-to-find Python2 but we ported it to Python3 to extend its lifespan.&lt;br /&gt;
&lt;br /&gt;
The provided PNaCl SDK runs on Linux, Windows and macOS systems, on amd64 architectures.&lt;br /&gt;
&lt;br /&gt;
While the {{code|.pexe}} compiler itself runs on FreeBSD with the Linuxulator, the translator does not, meaning it's not possible to build {{code|.nexe}} binaries on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
PNaCl supports C++ exception. There exist newer PNaCl SDKs (from chromium canary releases) that do not support exceptions and may not provide more what we already have with latest stable PNaCl.&lt;br /&gt;
&lt;br /&gt;
===Dæmon Saigo SDK===&lt;br /&gt;
&lt;br /&gt;
Saigo is a new NaCl compiler based on latest Clang and supporting latest C++ standards. It compiles directly to {{code|.nexe}}.&lt;br /&gt;
&lt;br /&gt;
See {{saigo}} for details.&lt;br /&gt;
&lt;br /&gt;
The Unvanquished game code is now buildable with Saigo.&lt;br /&gt;
&lt;br /&gt;
Saigo may not support C++ exceptions as far as we know but supports {{code|setjmp/longjmp}}.&lt;br /&gt;
&lt;br /&gt;
Unlike PNaCl, Saigo wasn't released by Google, meaning a switch from PNaCl to Saigo required a convenient way to provide it to contributors. Google provided some nightly Linux amd64 Saigo toolchain snapshots that aren't easy to get without some Google scripts. The Saigo compiler itself isn't hard to build (same as Clang itself), the binutils are a bit more tricky but not that hard (10 years-old configure build). What is tricky to rebuild is the libc that requires some very old NaCl GCC. Fortunately there exists libc and libc++ snapshots provided by Google that can be reused with a self-built toolchain.&lt;br /&gt;
&lt;br /&gt;
The Saigo compiler and NaCl binutils can be rebuilt to run natively on many platforms (Like Clang and GNU binutils), but they will always target the usual platforms as the NaCl loader is still the same: a more recent NaCl runtime is also buildable but doesn't bring any new platform support.&lt;br /&gt;
&lt;br /&gt;
Moving to Saigo is considered as a migration step that can be achievable before migrating to [[WebAssembly]], as it allows us to migrate to a new C++ standard and update libraries we use without waiting for the migration to WebAssembly.&lt;br /&gt;
&lt;br /&gt;
Some redesign of our CMake configuration for Saigo may help later when migrating to WebAssembly as it makes it more generic for different VM toolchains.&lt;br /&gt;
&lt;br /&gt;
Here is a GitHub issue about the ongoing efforts for migrating to Saigo:&lt;br /&gt;
&lt;br /&gt;
* {{url|github.com/Unvanquished/Unvanquished/issues/3197}}&lt;br /&gt;
&lt;br /&gt;
==Interactive Debugging==&lt;br /&gt;
&lt;br /&gt;
Most of the time it is easiest to debug with a native DLL. But if you have a problem that cannot be reproduced outside of NaCl, you may be forced to resort to the following tutorial.&lt;br /&gt;
&lt;br /&gt;
These steps for attaching the NaCl debugger&amp;lt;ref&amp;gt;https://web.archive.org/web/20250909075554/https://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-with-debug-stub-recommended/getting-started-with-debug-stub/&amp;lt;/ref&amp;gt; have been tested on Windows with a PNaCl toolchain. They should also work on binaries built with Saigo, using the old PNaCl GDB. On Linux or Mac you may experience more difficulties due to the lack of support for old binaries (meaning nacl-gdb). illwieckz reports that on amd64 Linux in 2025, using the old GDB which is a 32-bit binary, debugging an amd64 nexe does not work (despite the documentation's claims of debugger platform independence), but debugging an i686 nexe does.&lt;br /&gt;
&lt;br /&gt;
# Build the NaCl gamelogic with debugging symbols (build type Debug or RelWithDebInfo).&lt;br /&gt;
# Launch Daemon configured for NaCl debugging. For example, &amp;lt;code&amp;gt;./daemonded -set vm.sgame.type 1 -set vm.sgame.debug 1 +map chasm&amp;lt;/code&amp;gt; When the relevant gamelogic starts, the engine should pause and emit the message &amp;lt;code&amp;gt;Waiting for GDB connection on localhost:4014&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Start NaCl GDB, e.g. &amp;lt;code&amp;gt;daemon\external_deps\windows-amd64-mingw_10\nacl-gdb.exe&amp;lt;/code&amp;gt; This works better out of a command prompt rather than an MSYS window.&lt;br /&gt;
# Use the &amp;quot;file&amp;quot; command to tell the debugger where the binary with symbols is. For example, &amp;lt;code&amp;gt;file sgame-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# OPTIONAL, probably a waste of time: load the IRT (Integrated Runtime) symbols: &amp;lt;code&amp;gt;nacl-irt irt_core-amd64.nexe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Connect to the NaCl program with the command &amp;lt;code&amp;gt;target remote :4014&amp;lt;/code&amp;gt;&lt;br /&gt;
# You should see a message like &amp;lt;code&amp;gt;0x000000000ffc00a0 in ?? ()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;0x000000000ffc00a0 in __pnacl_start ()&amp;lt;/code&amp;gt; if you did step 5). This means the program is paused at the beginning.&lt;br /&gt;
# Set some breakpoints, e.g. &amp;lt;code&amp;gt;b G_RunFrame&amp;lt;/code&amp;gt;. Alternatively, just wait for the debugger to break when the game crashes.&lt;br /&gt;
# Start the program by continuing (&amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Postmortem Debugging==&lt;br /&gt;
&lt;br /&gt;
See {{Tools|Breakpad}}.&lt;/div&gt;</summary>
		<author><name>Illwieckz</name></author>	</entry>

	</feed>