Tabletop Simulator

Tabletop Simulator

29 ratings
How to make a collider for custom 3D models
By Baryonyx
This guide will try to teach you how to create an efficient collider for custom models in Tabletop Simulator, using Blender. With a bit of practise, this can be done in some minutes.
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
If you have played Tabletop Simulator for some time, then you probably have come across issues with collision of custom objects. Lets take this elephant as an example:


A default collider

When you bring a custom object into the game and make no extra collider for it, Tabletop SImulator will create a box around your model to serve as collision. This however will mean that objects with long protrusions (such as dragons with long tails and open wings or a banshee with floaty hair and clothing) will end up having very large collision boxes that can easily prevent them from fitting into tight areas and mess up other pieces aswell.


How you have to imagine the standard collider

Often the model is too complex to make it use itself as collider - which would mean pasting the model file into the collider section. (See below) As Tabletop Simulator can work best with boxes as colliders, using this may bring no optimal result.

To get rid of these problems entirely, you can make yourself a collider in Blender. With a bit of practice and routine, this can be done quickly.

So naturally, the first step of this tutorial has to be that you download Blender. This tutorial uses Blender version 2.77.
You should also know how to move around in Blender. It is not that much different from Tabletop Simulator, but everything you should know can be found here:
https://www.katsbits.com/tutorials/blender/learning-keyboard-mouse-navigation.php



1. Extracting a custom model from the game
Presuming you found a model on the workshop that you want to optimise, you first need to get it out of the game and into Blender. To do that, bring the model you want to change on the table and right click it.
Note: You should be host or be in single player mode when you create or change custom game objects.
Then, click Custom and you should see a window with two tabs at the top and in the first tab there should be four possible lines, labelled Model/Mesh, Diffuse/Image, Normal/Bump and Collider.


The Custom Model screen

You need the first link of course, so you click that space once, which should automatically select the whole link. Then you press Ctrl+C to copy it and paste it into your browser of choice.

If you want to work along this tutorial, the link to the elephant model is:

Depending on the link, you will either get presented with a download prompt, or a page full of data.
In the latter case, right click and select save page, be sure to switch to all files in the download window and change the ending to .obj if it is something else than that (txt for example).
Alternatively, you can press Ctrl+A to select the whole document and then Ctrl+C again to copy the content. Create a new notepad file in a place you will find it easily (such as desktop) and paste the content of the file into it. Save and give it a name that you will recognise later.
Important: When saving, you need to change from Text Files (.txt) to all files and add .obj to the file name.


Saving the model correctly





2. Bringing the model into Blender

Once you have done that, it is time to start up Blender. After the splash window, you will be presented with the standard Blender screen and a cube.


The basic Blender screen

To import the model you just made, go to File -> Import -> Wavefront (obj.) and navigate to the file you created.


Importing an .obj file in Blender

Your model should then appear on the screen. It may be possible that your model is either very large or very small, so if you do not see it, try to zoom out or move the cube away by selecting it with right click (the cube should then have an orange border) and click & hold the arrows that show up, just like Gizmo mode in Tabletop Simulator.


How an Imported model may look like

Your model will probably be light grey upon import, but it can also have different colors like our elephant being black. This however is not important.
3. Adjusting a box to use as collider

Once you have your model in blender, you can start making the actual collider for it.
Select the box (right click) and move it into a good basic position.
Next, switch the 3D viewport into Edit Mode. You do that at the bottom left end of the screen, where it says Object mode. Click that to open a menu and select Edit Mode.
Alternatively, hit the Tab key while your mouse cursor is in the 3D viewport.


The box in Edit Mode

Next, to make adjusting the box easier should change into Face Selection. To the right of the object mode button, find a button saying Global. Directly right of that one, there are three buttons that let you change selection mode. They are from left to right: Vertex Selection, Edge Selection and Face Selection. You of course want to click the third button.


Face selection enabled

You should notice that in the center of each of the cube's faces there should now be a dot.
Now you can select and move the face that you want to adjust, again you do that with the arrows. This too works like Tabletop Simulator Gizmo.


A good collider for this elephant may look like this



4. Exporting the collider
Once you have the collider box in desired size you can export it.
This can best be done with the "Export selected" Script. It may not be enabled in your Blender by default. You can find out how to do that here:

https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Export_Selected
Note: The addon may already be installed in your Blender, so you probably don't have to download it again but just enable it according to the instructions on that page.

Get back to Object Mode and with the box still selected, click File -> Export -> Selected -> .OBJ and save at a location where you can easily find it.
I personally recommend using the name of the 3D model and adding _coll to it.


Exporting your collider
5. Bringing it into the game
Finally, the collider needs to be uploaded. If you do not want to use the steam cloud (which I do highly recommend), the way to do that is pretty much the reverse of extracting the model:
First, find the new collider that you just saved and open it with notepad. In the notepad window you hit Ctrl+A to select the whole content, Ctrl+C to copy it. Then open your browser and go to this website:
https://gist.github.com/
There you paste the content into the big window in the center. Giving it a name in the little space above is not needed but may be helpful.


The Github gist window with the collider pasted

Click Create secret gist and on the next page, click the button saying Raw.


The raw data of the collider

Copy the link of this page and paste it into the Collider slot of your model. Press import and your object should now behave according to the collider you just created.


The elephant with its new collider


Final Review
It is important to note that a 3D model and its collider always work relative to each other regarding size and location in Blender. This means that not all colliders work the same way for every 3D model. You can try to use a collider you made for a different 3D model, but bad collision including floating or sinking into the ground may be the result. Therefore I recommend that you first import a 3D model when you make a new collider, unless you want to change a homogenous group of models from the same author.

However, you can also use this to your advantage: If you want a model to be flying or part of it sinking into the ground, adjust your collider box in blender accordingly by making it larger or smaller than the 3D model.

Another thing to keep in mind is that the coordinate origin in Blender (that point in the center where all the colored lines meet) is the point where the object will rotate around. It is best if you put your models into or above / below the coordinate center. It is easy to fix uneven rotation behavior on a model if you import it into Blender, move it to the origin and then export again.

If your model is complex, you can make a collider consisting of several boxes by copypasting your first box in Blender and then adjust it as explained above. Make sure you right click the new box again after you pasted it. When you have all individual collider boxes as they should be, use Shift+Right click to select all the boxes. Make sure you do not select the actual 3D model in the process!
Then follow the "export selected" procedure as normal.

Please also consider that the collider determines where you can grab an object. If you make it extremely small, you may have a hard time finding the spot to pick it up.
Also note if your collider is really small or extremely flat, it may fall through the ground.



This is the end of my guide. I hope it is helpful to you.

If you have any questions or feedback, please post below!
36 Comments
Alp 6 Feb @ 12:11pm 
worked like a charm thanks a lot!
pedrorebelosantos20 31 Jan, 2024 @ 9:46am 
Thank you for your help! That was the exact issue. I've now looked into and leant how the combine tools work. 👍
Baryonyx  [author] 29 Jan, 2024 @ 10:23am 
pedrorebelosantos, that sounds a bit strange. Try using the combine attach tool in TTS in reverse: Click and hold on the figure with base, then drag into nothingness and let go. If the figure separates from the base, then you should now be able to fetch the model file.
pedrorebelosantos20 28 Jan, 2024 @ 3:57pm 
Hi Baryonyx! I'm a complete begginer at TTS and only picked up Blender today, so I'm sorry if this is a stupid question.
I want to edit a figurine to use in a D&D game. I followed your instructions, but when I open it in Blender only the model's base appears. I believe this may be because only the base of the model has collision.
I was lead here after a Google search and I think this is the post closest to the topic, so I decided to ask you: How do I view the full model so I can edit it in Blender?
Erik Taurus 23 Oct, 2022 @ 12:23pm 
Aeewww! xD Yes, they all had "grid" selected in toggles...
Thanks a lot, they now work as expected!
Baryonyx  [author] 22 Oct, 2022 @ 5:47pm 
What lag issue is there? I don't see anything wrong. If you mean that ghostly shape that is sometimes visible, that is a placement preview, because you have a grid on there or snap points or something. It can be turned off in the settings.
Erik Taurus 22 Oct, 2022 @ 1:54pm 
I'm using the mesh used here
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2876921012
Now split into two parts, the base and the upper "box", so not at all complex.
But it results in this
https://youtu.be/Z0U0Is7L1G8
Baryonyx  [author] 21 Oct, 2022 @ 1:32pm 
About the performance, it may have an impact if you use a super complicated collider or use the model itself as a collider (common practice, but doesn't work well all the time), but if you actually make boxes or use other simple shapes without excessive face counts, like I describe - and mind you, you shouldn't make hundreds of them, keep it simple - then it really shouldn't impact the FPS much.
Erik Taurus 21 Oct, 2022 @ 1:27pm 
Thanks!
I'm a visualisation type of guy, so for me images works better.

One thing I noticed with the advanced collision mesh is that a less powerful computer struggles with them in multiplayer.
Both "Full" and "Semi-lock" makes the game lag when a less powerful computer host a game.

PS. Opening the image in a new tab worked in a browser.
Baryonyx  [author] 21 Oct, 2022 @ 10:11am 
Erik, huh, that is true wit hthe images, but the links still work if you paste them into a browser. Must be a steam problem.

The process for several objects is pretty easy, just use ctrl+a to add a shape and then follow the steps in section 3 for each one.