LevelPost Bundle Tutorial

Install Unity

You need the same version of Unity that the game uses, which is 2017.4.10f1. Get it from: https://unity3d.com/get-unity/download/archive. Choose the Unity Installer to select which components you want.

Or download the Unity 2017.4.10f1 Installer directly.

You need the main component, Unity 2017.4.10f1 and the Linux Build Support and Mac Build Support to build asset bundles for these other operating systems.

After installation you need to create a Unity ID, select the Personal license, and fill in a short questionnaire.

Create a new Unity project

Create a new 3D project, for example named bundledemo.

Import texture assets

Download the yellow example textures: assets.zip. (they are from https://opengameart.org/content/50-free-textures).

Use the top Assets menu and select Import New Asset… and select the png files. You can also right click in the Assets panel below for the same menu or drag the png files from Windows Explorer into the Assets panel.


Create material

Create a new material with Assets -> Create -> Material and enter a name, for example cust_yellow

Assign textures

Select the Albedo texture for the material. This is the main visible texture, also called the diffuse or color texture. You can use the little circle icon before the word Albedo or drag the texture from the Assets pane to the square before Albedo.

Do the same for the Normal Map texture. The normal map sets the direction for every pixel, so the material doesn't look flat. Unity will warn that the texture is not marked as a normal map, let it fix it.

Preview material

You should now have a nice scratchy material in the preview.

Build AssetBundle

 

Click on the first None after AssetBundle in the material preview pane in the bottom right and select New…

Enter a name for the asset bundle, for example materials. This will be the bundle filename.

To actually build the asset bundles you need an editor script. Create a folder Editor in the Assets pane (right click, Create, Folder) and open the folder.

Now import the BuildBundles.cs script from the assets.zip above into the Assets > Editor folder by dragging or right-clicking Import New Asset…

If you get the error "The type or namespace name 'UnityEditor' could not be found." the file BuildBundles.cs is probably not in the Editor subfolder of the Assets folder.

Run build script

Now you should have a Build AssetBundles option at the bottom of your Assets menu. If it doesn't show up you might need to click in the Assets pane and wait a few seconds while it compiles the script. Click the Build AssetBundles option and it will show a small Building AssetBundle progress window. This window will appear three times, one for each operating system (Windows, Linux, Mac OSX).

If you don't have Linux/Mac OSX build support installed there will be errors like "Building an AssetBundle for target "LinuxStandaloneSupport" is not allowed because the required module is not installed." You can ignore these errors for now, the Windows bundle should still be build. If you want the level to be playable by Linux/Mac users, install build support for these platforms and build the asset bundles again. You can install build support by running the Unity Download Assistant again and selecting only the Linux Build Support and Mac Build Support options.

Check output

This should have generated three asset bundle files, one in each of the windows, linux and osx subfolders of C:\ProgramData\Revival\Overload\unityprojectname

Unity creates the .manifest and windows files for itself; they aren't needed for the level.

Setup LevelPost tool

Select the windows bundle for the Bundle file field.

Now create a png file in the level editor LevelTextures folder with the same name as your material, for example cust_yellow.png. You can use the Albedo texture for this. Create a level with this texture and export it, for example to bundledemo.sp

Convert level

Finally you can convert the exported level with the LevelPost tool. It should tell you it has found the new material in the bundle and that it has converted 1 texture (to the new material).