Dioramas to Levels in Sköll

Dioramas to Levels in The Attestation of Sköll


Our team's artist created a level plan for the first main level of The Attestation of Sköll in Blender, in the form of a sort of diorama. This approach meant they could get a good idea of the layout of the forest level without having to do anything in Unity, but it presents an issue when it comes time to actually get the level working in-game; The objects in Blender aren't easily tied to prefabs in Unity (essentially game objects that have Unity components attached etc.)
The brute-force approach for turning this diorama into a playable level would be to go through all the imported objects and add collision, physics, and components to all of them by hand, but this would result in multiple in-scene copies of the same objects in different locations, meaning any future changes would have to be made one-by-one.


We exported all the unique objects in the scene in a sort of atlas or collection, lined up in a grid, and then I turned each of those into a prefab and added any Unity components they needed - this left us with one final challenge, which was to somehow place all those prefabs into the scene in the same positions, scales, and orientations as their counterparts in the diorama.

Replacing Placeholders


To ease the process of matching the prefabs to the diorama's placeholder objects, I first replaced the materials on the diorama objects with a translucent material to allow a better visual indicator of how aligned a prefab is to the placeholder.


Placing each prefab by hand would take a long time, so I set about writing and editor script that would allow in-scene game objects to be selected and replaced with a prefab, copying their transforms. As some of the collection objects were at different scales or rotations, I added the option to use an offset rotation or use the default (1,1,1) scale. For most objects in the scene, this worked great with very minimal editing required after to align the prefabs.


Within a few days' worth of work, I managed to cover the whole level and set about adding some finishing touches, mainly in the form of collision geometry. Some collections of objects in the scene, such as a pile of torch posts, would need a collider to cover them as a group, rather than using their individual colliders; this ensures that the character controller won't have to deal with many small cluttered objects that would make locomotion erratic.

Comments

Popular Posts