tabletop-club
tabletop-club copied to clipboard
Stack display updating every time an object is added.
When loading a deck in the assets menu, the deck takes much more time than in earlier versions to load. It feels like all cards in a deck is being loaded, instead of the top one only.
Hmm... when loading a deck of cards, only the top and bottom cards should be loaded in. I'll have to do some testing on this on my end. Are you able to confirm which version of the game had faster loading times for decks?
I was using Beta 3 before.
Just checked this on my system, there is definitely a noticeable difference in the loading times - thanks for the heads up!
I've found the cause of the issue: dcb084d9b281cf6412d6a7775a0ff1ef2da3b852 introduced a workaround for a race condition in load by delaying the loading thread for 1ms before loading a resource. ~~When stacks are built, the metadata of each of the pieces is added to the stack, but for each piece its corresponding scene is instanced to check what collision shape it has (to check if it matches with the stack's current shape, e.g. a BoxShape cannot stack with a CylinderShape). This is where the extra delay in loading stacks is coming from, the loading times are padded by about 52ms.~~
~~For v0.1.0, I'll attempt to patch this by caching the piece's scene and using it each time the same type of piece is added. I'll optimise the root cause of the issue in v0.2.0, since I'm rewriting most of the code then anyways.~~
EDIT: It's not the collision shape that's the issue, that's only loaded once when the stack is first created. Instead, it's the stack textures updating every time a piece is added. This is more deep-rooted than I initially thought, so I'm pushing back the milestone to v0.2.0, and I'll make sure when rewriting the code to separate the actions of adding a piece to the stack, and updating the stack display.