Create Collision Model Tutorial

Collisions for entities in Space Engineers are created in Blender and then exported to a .hkt-file format to be integrated into the final .mwm-files the physics engine of the game (Havok) uses. There are a number of requirements for how those collisions are set up, which this tutorial aims to cover.


I. Create Collision Models

Create a Collision-collection and assign it to either the Main-collection of your scene or one of the BSx (Build Stage) collections. Build Stages will default to use the Main-collection’s collisions if none are defined for them.

SEUT creates a default Collision-collection and assigns it to the Main-collection.

While SEUT supports assigning individual collision collections to the Main-collection and each BS-collection, there is currently a bug in Space Engineers that prevents more than one collision model per block from working correctly (collisions are only updated on a reload of the world). As such, it is not recommended to use this feature at the moment. A fix is somewhat unlikely, as vanilla Space Engineers does not use this mechanic in any of its blocks.

Create objects and place them inside the Collision-collection. These objects should generally be simple geometric shapes and your aim is to use as little separate objects as possible. However, make sure that your objects are all convex - never concave - as Havok does not support concave objects.

Concave shapes will have their “gaps” filled in.

Collision objects that are concave will be simplified during conversion into the HKT format to not have any concave section. You can only achieve concave collisions by creating multiple collision objects and arranging them accordingly.

Select the first of your collision objects and in its Properties under Physics Properties, assign it a Rigid Body. Then, select a shape which can reasonably represent your collision. If at all possible, you’ll want to use anything but Convex Hull, as they are more performant, though often Convex Hull is the only viable option. You cannot use Cone, Mesh or Compound Parent as Havok does not recognize them. Repeat this for all your collision objects inside the Collision-collection.

 

 

 

 

 

 

 

 

 

 

 

 

After you’ve exported your block, it’s time to test the collisions ingame. Make sure to do so in a Singleplayer world set to Offline, as some dev tools might not be available otherwise. Once loaded into a savegame, place your item or block and then hit F11. In the menu, enable Debug Draw and then Physics Primitives. Note that you might have to toggle Physics Primitives on and off a couple times for it to start working.

You will now see light blue and red shapes representing the collisions of all entities ingame. Red denotes Convex Hull, blue Box, white Sphere, orange Cylinder and yellow Capsule. Use these to verify the shapes and as a guide to make adjustments in Blender.


Troubleshooting

Collisions are not accurate ingame

There are several different reasons why this may be the case:

  1. Is your collision shape concave?
    Remember: Concave shapes will have their “holes” filled in. You have to replicate the shape using several convex collision objects instead.

  2. Does your collision go outside the Bounding Box of your block?
    Space Engineers does not allow this and may revert your collision back to a box collision.

  3. Is the collision ingame just slightly larger than what you have in Blender?
    This seems to be a weird particularity about the conversion process into .hkt. You’ll have to make your collision shapes slightly too small in Blender to compensate. (This is also what Keen has done when they adjusted armor collisions to not clang out so much in Spring 2021.)

  4. Do you use individual collisions for your BS and Main models?
    While SEUT supports assigning individual collision collections to the Main-collection and each BS-collection, there is currently a bug in Space Engineers that prevents more than one collision model per block from working correctly (collisions are only updated on a reload of the world). As such, it is not recommended to use this feature at the moment. A fix is somewhat unlikely, as vanilla Space Engineers does not use this mechanic in any of its blocks.

Changing collisions has no effect ingame

Special Note: Collisions on Subparts

Learnings

 

Overview

 

Related