Infinite-Chess / infinitechess.org

Infinite Chess Web Server
https://www.infinitechess.org
GNU Affero General Public License v3.0
171 stars 40 forks source link

Store piece sprites as vector graphics #69

Open tsevasa opened 1 month ago

tsevasa commented 1 month ago

Lichess stores all its piece sprites as vector graphics (see here, for example) and each piece is less than 1KB in file size. In contrast, our spritesheet is a png file and takes up 1MB in total.

We should also store piece sprites in svg format.

Naviary2 commented 1 month ago

This would be great, and a huge performance boost!! As long as we can convert the vector graphics back into textures on startup!

Naviary2 commented 1 month ago

All piece's have now been converted to an SVG! Next we can take steps towards using those svgs and re-forming the spritesheet on the client-side with them!

See discussion here https://discord.com/channels/1114425729569017918/1261070585476288674

Naviary2 commented 2 weeks ago

I imagine we would group all the classical pieces into one http request (as svgs are just text afterall, there has to be some way to split them into individual svgs eith javascript afterward), and other fairy pieces may or may not be in groups! Atleast, a pair of a black and white piece should atleast be merged into one request.