Hi, I’m wanting to make a basic blackjack game, and have the basic code down (I think…) but I’m trying to figure out where I can store my card pictures temporarily. I’m thinking about storing them on github and then downloading them each time the game initializes. Does anyone have a better idea, or options they have used?
That sounds like a good plan. Other options could be firebase, azure storage, aws, or even google drive. One option could be easier depending on the language you are using to program.
For me, I am typically able to store images directly in Unity’s streaming assets folder. However, I have also used firebase to serve files that occasionally need to be updated. I will probably use azure storage with Unity next time I do something similar, as they provide free tiers and are very compatible with C#.
The more I look at this the more appealing the idea of one sprite, downloaded once and sitting in memory. It would be one sheet containing all fifty-two card faces.
Since every facet of the sheet would be equidimensional, the top left and bottom right of the unit card is simple to compute. We simply give an image of that size derived from those positions of the sprite.
Bottom line, one file download, fixed usage of memory. The app could be disconnected from the web at that point. Not fifty-two png or jpg files, but one. Not to mention we can compress the heck out of it so long as it displays acceptably well. That means a small download and lower bandwidth drain on a busy site.
This ‘contact sheet’, sprite approach would be in a fixed format. How vector graphics fit this same scenario is beyond my knowledge, though one suspects we would be looking for a similar download and disconnect applicability. An app should run offline if its data store is cached on the device.
Following is some interesting reading from twenty years ago. We only need to look around to see what it inspired.