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.29k stars 57 forks source link

Remove redundancy caused by the back face of cards. #39

Closed drwhut closed 3 years ago

drwhut commented 3 years ago

Is your feature request related to a problem? Please describe. The way cards are imported is such that each card has one texture, with both the front and back faces on the texture. However, the fact that most card packs in general almost always have the same back face, means that the back face is being copied unnecessarily in every texture file. If the back face can't compress well, this can lead to huge folder sizes!

Describe the solution you'd like Change how cards are imported so that each texture is just the front face of the card - then, in the config.cfg file, the back face can be set with a new property:

[*]
; Set the back face of every card in the pack.
; The BackFace.png file is also in the folder.
back_face = "BackFace.png"

[BackFace.png]
; Optional, but if this wasn't here, you would
; have another card with both the front and
; back faces being this texture.
ignore = true

This way, the back face only takes up one file, and the redundancy is gone! This also means that the front and back faces could potentially use different formats, so e.g. the front face can be a vector image while the back face is a pixel image.

Describe alternatives you've considered Keeping the current system as is, but I can't sleep at night knowing the cards/ folder is twice the size it needs to be!

Additional context Ideally, the new cards shouldn't have two separate meshes for each face, but rather one mesh with two surfaces that can have two separate materials.