Over 11,000 five-star assets

Rated by 85,000+ customers

Supported by 100,000+ forum members

Every asset moderated by Unity

1/6
BitPacker is a collection of tools for efficiently writing and reading data without letting any bit go to waste. Use it to optimize your network messages, save data and more!
Render pipeline compatibility
The Built-in Render Pipeline is Unity’s default render pipeline. It is a general-purpose render pipeline that has limited options for customization. The Universal Render Pipeline (URP) is a Scriptable Render Pipeline that is quick and easy to customize, and lets you create optimized graphics across a wide range of platforms. The High Definition Render Pipeline (HDRP) is a Scriptable Render Pipeline that lets you create cutting-edge, high-fidelity graphics on high-end platforms.
Unity VersionBuilt-inURPHDRP
2019.4.23f1
Compatible
Compatible
Compatible
Description

Save and network data is getting incredibly complex in modern games. Unfortunately, commonly used serialization (such as XML/JSON and BinaryFormatter) doesn't tightly pack your data, resulting in large chunks of unused bits. As many network and gameplay programmers know, manually writing code for tightly packing the data using bitfields is incredibly time consuming and complex, especially when dealing with data that can spill over into other bytes.


BitPacker aims to solve this problem by stripping away all unnecessary and duplicated information and utilizing every single bit to the fullest, resulting in the smallest outputs possible. It has been battle tested for performance and ease of use, and it’s currently being used in multiple big productions, including the Besiege multiplayer and level editor code (by Spiderling Studios) and The Falconeer (by Tomas Sala).


HIGHLIGHTS

- Easy to use read/write API

- A fully featured serializer that supports many of Unity's built-in types

- Intelligent integer and string packing and quaternion optimizations

- Use powerful arguments to help shrink the data size even more

- Detailed examples with line-by-line comments for BitPacker's common methods

- Includes the full source code

Technical details

BitSerializer

The fully featured serializer, built on top of the BitWriter and BitReader tools, is responsible for squeezing preexisting data classes (also commonly models) into as few bits as possible, without having to write any code. On top of (unsigned) integers, Booleans and bytes, it also supports a wide range of other built-in types, such as string, Vector3, Quaternion and Guid.


BitWriter

To have more control over what is written and how it is written, you can use this class directly. Depending on your needs, you can write to any Stream or preexisting byte array. It provides a wide range of convenient methods that allow you to quickly lay down the groundwork for any type of data you might need.


BitReader

Once you’ve written out data using BitWriter, you can use the complimenting methods to read the data back out again. Like BitWriter, it supports reading from either a Stream or a preexisting byte array.

BitPacker

(not enough ratings)
20 users have favourite this asset
(20)
$39.99
Seat
1
Updated price and taxes/VAT calculated at checkout
Refund policy
This asset is covered by the Unity Asset Store Refund Policy. Please see section 2.9.3 of the EULA for details.
Secure checkout:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
License type
File size
184.1 KB
Latest version
1.2
Latest release date
Aug 11, 2022
Original Unity version
2018.4.34
Support
Visit site
Quality assets
Over 11,000 five-star assets
Trusted
Rated by 85,000+ customers
Community support
Supported by 100,000+ forum members
Unity logo
Language
Feedback
Partners Program
Partners
USD
EUR
Copyright © 2025 Unity Technologies
All prices are exclusive of tax
USD
EUR