Extract assets contained within .lvl
files to Unity. This project began as a fork of Ben1138's modtools importer, but diverged and conflicted so significantly that it made sense to separate it. It is one of the many projects under the LibSWBF2 umbrella.
Tested on MacOS Catalina, Ubuntu 18.04, and Windows 10.
- Import multiple .lvl files and automatically resolve references between them
- Handles:
worlds with skydomes, mesh or heightmapped terrain, regions, and props,
static and skinned models, animations,
collision meshes and primitives.
- Objects can also be imported free from association with a specific world
- Animation, Prefab, Model, Material, and Texture assets can be saved with each import
- This repo itself should only be cloned if you plan on contributing, it does not contain the required native plugin builds (see bottom). If you wish to simply use the tools, please download a ZIP release!
- Unzip and place the
LVLImport
folder into yourAssets/
directory. If theSWBF2
menu entry doesn't appear, check the error log.
- Click on
SWBF2 --> Import .lvl
. - Add/Remove
.lvl
files, dependency order does not matter. Import Worlds
to import the worlds and their dependencies into your project/active scene.Import Objects
will import all the objects (ODFs) contained within the loaded lvl files and space them out under a root object in the project/active scene. CheckSave World
if you wish to save terrain and skydome assets. CheckSave Objects
if you wish to save/instantiate the converted GameObjects as prefabs. The other options are self explanatory,- Note that if you are saving assets, the import process may take quite some time depending on the lvl size, with no direct progress indicator. This will be fixed soon, but requires precise use/testing of the
AssetDatabase
API, which I'm still grappling with.
- More finely grained extraction, eg, per-model, ODF in each
.lvl
file - Sounds
- Particle effects
- Lightmap UV generation
- Full ODF inheritance + properties for root classes like
hover
,solider
,prop
, etc - Special handling for soldier classes
- This importer relies on native plugins (libLibSWBF2.so/.dylib on Linux/MacOS and LibSWBF2.dll on Windows), which are not included in this repo
- Munged script data is the focus of this project
- LibSWBF2 contains the first working animation unmunger, and thus this importer can import animations correctly, apply them to GameObjects, and save them as clips. However, SWBF2 animations identify bones simply by name, while Unity requires a full transform path, so some anims may fail to be properly attached. Moreover, some animation dependencies are hardcoded into the root classes, eg
soldier
. These are not handled yet, so unless the imported object's ODF explicitly defines anAnimationName
property, the required animations will not be imported. - Many objects depend on common assets defined in
ingame.lvl