View the AssetBundles Tutorial Video
An AssetBundle is the most advanced, fully featured asset type for Tabletop Simulator. An asset is created in Unity, and then expected in a special format to be imported into your game.
AssetBundles can do many things other custom Objects cannot.
- Customizable physics sounds
- Access to the full array of Unity materials
- Play custom sounds
- Triggerable animations and looping animations
- And more
Basically, if you can make the object in Unity using all of the default resources available, you can import it into your game.
In order to create an AssetBundle, you will need to:
- Download/Install Unity
- Download GitHub Project file
- Open project file in Unity
- Create Asset using Unity
- Export to AssetBundle
- Import in Tabletop Simulator
Follow the instructions for each step closely.
The first thing you need is Unity. But not just any version of Unity, it needs to be Unity 5.6.5.
You want the installer.
Wrong Unity Version
Using the wrong version of Unity will result in possible issues in your exported AssetBundles, if it works at all.
Run the installer and you will be asked which components to include. Be sure Windows, Linux and Mac are all checked.
Download the project file from GitHub.
If needed, unzip the files, and then place them into the directory of your choice.
Run Unity. A window opens, asking if you want to create a new project or open one.
Select Open and choose the folder obtained from GitHub.
Any number of methods can be used to create an Asset, so the steps you take here are based on the end-result of what you are trying to make.
The project file contains some examples of assets as well as an example scene that matches the Museum background's lighting.
You are not required to use any of these when creating your asset.
You can create any asset, but here is an example of basic asset creation.
There are 2 scripts included which you can add to Assets you create.
- TTSAssetBundleEffects: In Tabletop Simulator, this will add an option in the Object's context menu. There are two types:
- Trigger: Used to activate animations, sounds, lights, etc that run once and stop.
- Looping: Used to activate animations, sounds, lights, etc that continue running until another Loop is activated.
- TTSAssetBundleSounds: In Tabletop Simulator, this lets you replace the sound that this Object would make with custom sounds.
In Tabletop Simulator, Lua scripting is able to interact with these triggers. However you are not able to create/add your own Unity scripts to Objects.
Once you are finished creating your asset, you must turn it into a pre-fab.
Give it a unique name.
Then Build the AssetBundle by right-clicking anywhere in the project view and selecting Build AssetBundles.
The resulting file that is created will be found in the Project folder under AssetBundles.
The file format for an AssetBundle is
Open Tabletop Simulator and upload your AssetBundle to a webhost or the in-game Steam Cloud.
How you choose to import files impacts if other players can see them when you're finished.
For help with importing, visit Asset Hosting.
Secondary AssetBundles are an additional AssetBundle which are great for shared effects like sound or particle effects that you want to use on multiple objects without duplicating them in each individual asset bundle. Great for reducing memory and bandwidth usage.
In the example below, the main AssetBundle is the blue capsule and the secondary AssetBundle is the explosion and light effect. This allows you to reuse the explosion and light effect on any one of your AssestBundles for greater modularity and reduced memory and bandwidth usage.
- Avoid duplicating large assets like textures and sounds on multiple AssetBundles by using Secondary AssetBundles.
- Don’t use legacy, mobile, or custom shaders because they will most likely show up as pink on other platforms.
- If your textures don’t need transparency, use RGB Compressed DXT1.
- If your textures need alphas retained, highlight just those textures and change the format to RGBA Compressed DXT5.
- NEVER use uncompressed textures.
- Make sure the texture is the size that makes sense for it, but watch out for the size of the texture as that will eat up a lot of space.
- Save 4k textures for large boards and other similar items.