I'm using C# with MonoGame and I'm wondering what would be an efficient way to load more than a million card images for a collectible card game. More cards would be continuously added in future updates and what not. I'm sure there are some genius ways to go about this which are both elegant and efficient. I'm hoping to obtain some insight on how others would solve this problem.
The cards will all be on a client side application the user downloads. The server will make sure the players are not cheating. I'm trying to figure out what are efficient ways to manage a large amount of card images on the client side regarding the loading and unloading of the cards.
I understand the cards should loaded and shown only when necessary. However, there are points in the game where the user can look through their entire collection. I was thinking with a scrollbar or something along those lines. They can filter their cards based on certain properties of the cards. In this scenario, how would I manage the loading/unloading of the cards in real time to make it seamless and efficient.
You would NOT load all the images at once. Whether this is an online game or not it would be terribly inefficient to load all of them at once. One way around this would be to put them all into some kind of database and only load the cards needed when they are needed, like when a new hand is dealt, etc. If you are worried about query speeds slowing you game down check out this detailed article/contest on how to right the fastest queries, as well as these tips.
As to your edit:
You could still use a SQL database on a server and run queries to make sure they are not cheating. You don't need to check ALL their cards, just the ones they currently have or are dealing.
Hope this helps you!