drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.28k stars 55 forks source link

Use image thumbnails instead of rotating previews in the objects menu. #268

Open drwhut opened 1 year ago

drwhut commented 1 year ago

Is your feature request related to a problem? Please describe. The rotating 3D objects in the objects menu have been the source of quite a few issues due to the way threading works in the game. After having conversations with other Godot developers with regards to these issues, I've come to the conclusion that while the way I've implemented threading in Tabletop Club is flawed, it is also doomed to fail because of the fact that handling resources in multiple threads in any way is not safe in Godot. Therefore, in order to be thread-safe, the objects menu needs to at the very least use different resources to those used within the room.

Describe the solution you'd like Use static, 2D thumbnails instead of dynamic, 3D ones to represent objects in the objects menu. They can be created during the import process and stored on the disk for later use. If the thumbnails are sufficiently compressed, then they can be kept in memory as to avoid having to load them in another thread altogether.

Describe alternatives you've considered Keeping the current system - but as described above, it is fundamentally flawed. We could potentially duplicate the imported resources and dedicate one set to being shown in the objects menu, but this would take up a lot of disk space.

Additional context This would end up fixing #216, #265 (only in the objects menu), and #267.