Tabletop Simulator

Tabletop Simulator

View Stats:
Baryonyx Mar 30, 2019 @ 2:27pm
Asset bundle LODs?
After experimenting with asset bundles and getting some more advanced things working, I am starting to get into quite severe performance issues.

Obviously none of the custom assets have LODs set for them.
(for those who are not familiar with the term, LOD means level of detail and describes the practice of showing a less detailed model to the viewer at greater distance, to improve performance)

I tried searching around for this on the web and have not found much if this would be possible to do with asset bundles in TTS. Can anyone with experience tell me if this is possible or not?
If not, I would like to request this feature for a future update, if it can be implemented somehow.

Thanks.
< >
Showing 1-14 of 14 comments
ulia  [developer] Mar 30, 2019 @ 4:23pm 
Quite easily with LOD groups which works fine for assetbundles https://docs.unity3d.com/Manual/class-LODGroup.html

Use the docs, Unity is very well documented.
If you are seeing "severe performance issues" as you call it I wouldn't imagine LOD to help you as much as learning about asset optimization in general.
Baryonyx Mar 30, 2019 @ 5:42pm 
Thanks, that is good news.

But if it is not the detail of the models, what else is the biggest problem with these guys?
https://steamcommunity.com/sharedfiles/filedetails/?id=1679164000

I want to learn, but I'm only just starting to get a feeling for unity editor as I have explored more of it and learned a lot about it when I followed the tutorial referenced in that mod.
ulia  [developer] Mar 30, 2019 @ 6:12pm 
I only have very minor troubles with the scene containing all 40+ assets strictly with SSAO enabled (primarly because I'm on 4K) which is behavior I would pretty much expect for continuously animated assets in high quantities with SSAO being applied in runtime.

By all means explore LOD bias if anything then just to learn but most of the performance hit is attributed to this particular post effect, animations and the rest of the overhead with using TTS as opposed to just Unity on it's own. As such you will likely not really improve performance if only for the absolute lowest end of hardware that particularly struggles with the polycount.
Last edited by ulia; Mar 30, 2019 @ 6:15pm
Baryonyx Mar 30, 2019 @ 6:52pm 
Very interesting, thank you again. This SSAO is a setting in the asset bundle too? I have not enabled this intentionally, where would I disable it?
ulia  [developer] Mar 30, 2019 @ 8:12pm 
Graphics settings in game options (TTS). SSAO is a common culprit for performance dips in videogames.
https://docs.unity3d.com/540/Documentation/Manual/script-ScreenSpaceAmbientOcclusion.html

The Unity doc doesn't explain this particular feature in detail so if you care about how it works you can find countless documentations elsewhere on the intrinsic concept.
Last edited by ulia; Mar 30, 2019 @ 8:12pm
Baryonyx Mar 31, 2019 @ 8:45am 
Ah ok. Hmm, I don't even have that enabled, but turning down shadows from ultra to high and reducing MSAA from 8x to 4x helped performance too.
I will experiment with the LODs then to see if that does anything.
Thanks for the help!
Baryonyx Apr 13, 2019 @ 2:37pm 
Alright, I have tried to do the LOD process for one of my animated soldiers. But I got stuck.

I have followed this tutorial:
https://www.youtube.com/watch?v=ifNyVS2_6f8
(Which essentially explains "Make several versions of your model in Blender, put them into different layers, name them with _LOD[number] according to LOD level, so that unity recognises it")
The original model was consisting of several parts in blender, but it has worked fine. However, since it seems you have to name each object in Blender with the _LOD tag for unity to recognise it, I joined the parts together, making sure the armature still works and the UV map was intact afterwards.
Then, working off of the result I got from this tutorial:
https://www.youtube.com/watch?v=j-0iaZUgsTk
I set up the model as described, changing animation type to humanoid, assinging the animator controller I have created and unchecking root motion to keep the model in place.
After having assinged the material to each LOD level, I pressed play. At this point the model should animate correctly in the viewport, but this one with the LODs does not. Apparently the armature does follow the animations as can be seen by the red rings. But the model does not pose. What's wrong?

https://i.postimg.cc/KZGL7cH9/grafik.png
Last edited by Baryonyx; Apr 13, 2019 @ 2:38pm
ulia  [developer] Apr 13, 2019 @ 4:42pm 
You can also manually set the LOD meshes without any particular renaming and just drag in the meshes in to the LOD component values.

In assigning LODs your animations most likely lost a lot of references to gameobjects, in fact as I am not versed in using both LOD and animation together for things strictly outside of the Unity editor such as assetbundles I can not say for sure this will work without C# scripts (meaning not at all as you can't bundle any scripts).

Feel free to export a unitypackage containing only one dude (only need one for testing) and I can have a look at it.
Last edited by ulia; Apr 13, 2019 @ 4:43pm
Baryonyx Apr 14, 2019 @ 6:41am 
Never mind, I figured it out. Just got confused because when I tired to do it manually, the original model didn't want to go away. I thought unity would automatically detect the original as LOD0, but you have to set it first for it to disappear when going to LOD1 distance.

https://i.postimg.cc/D2pyV8WW/grafik.png
The different colored skins show different LOD stages.

Performance has increased greatly.
Baryonyx Apr 14, 2019 @ 11:31am 
New problem:
The LOD stages do not follow the animation effect stages... :steamfacepalm:
I.e. the model, upon choosing loop effect 2 the LOD0 goes into kneeling position as expected, but LOD1 does not do it and still stands. The weapon however does go into the correct position and stays there.
Baryonyx Apr 15, 2019 @ 7:41am 
I suppose I will have to accept your kind offer for help, CHRY.

I hope everything is included in here, because the export package window with all the drop down menus being open is not exactly helpful in finding things. I tested it on a different unity project and it worked there.
https://www.media
fire.com/file/q2s1op9ndxxp9ue/LOD_soldier_unitypackage.rar/file
Last edited by Baryonyx; Apr 15, 2019 @ 7:41am
ulia  [developer] Apr 15, 2019 @ 9:01am 
I am not an expert on working with LOD and animation together, but I have conducted some troubleshooting science for you. Your animations and their references work fine, in fact the whole asset works as intended but under the constraints of the Unity editor.

To explain the structure of your current asset:

You have a primary gameobject containing mesh renderers and bones as your primary LOD that contains it's own animations.

You also have two secondary groups of gameobjects for the LOD1 and LOD2 states, these are duplicates of the primary but with mesh renderers using the lower poly meshes.

In the editor, you can zoom out to have the LOD component toggle between these three LOD groups. In effect it basically swaps between these game objects, and the crux is that the animations are duplicated to create new, unique animations with references to only their own duplicate bones and only work if called separately, as the animator for LOD0 does not have any references to objects in LOD1 or LOD2.

You can test this by selecting the clones and playing it's respective animations. The asset works as intended, but the structure of it is not great.

There are ways to work around this, but seeing as I think you did not create this model and it's animations you will not have a fun time going back and properly assigning bones. None of these solutions will be quick and easy, but the probably easiest one is tying everything to one animator calling the animation on all LOD group gameobjects. The other, probably not recommended option is not using an animator but instead calling a list of animations to play at once. Third is just remaking the animator states and animations for each set of sub bones in a structure that is correct to begin with.

What I've listed here is how it's done, maybe if you're lucky you could find a tool to do it for you, though I couldn't say and doubt it at all exists. Unfortunately you don't have access to C# scripts which would make this a whole lot easier, and the TTS effects script does not seem to support more than one animator param per loop.

You could potentially run through the animations with LUA instead of the contextual menu using trigger effects, but I can not guarantee this working flawlessly.
Last edited by ulia; Apr 15, 2019 @ 9:13am
Baryonyx Apr 15, 2019 @ 5:00pm 
Originally posted by CHRY:
[...] tying everything to one animator calling the animation on all LOD group gameobjects. [...]
How exactly would i do this? I have already given the LOD stages the same animator controller and set their avatar to the LOD0 stage (i.e. the original)
ulia  [developer] Apr 16, 2019 @ 3:35am 
Your animator should either call all 3 animations (primary + duplicates) per parameter or you need to go back and rework all animations so the sub group mesh renderers are tied in to the bones of the primary without having duplicates of the bones + animations.

I suspect you're in for a whole lot of manual reassignment work.
< >
Showing 1-14 of 14 comments
Per page: 1530 50

Date Posted: Mar 30, 2019 @ 2:27pm
Posts: 14