I'm working on a game where users can have a lot of items (50-100k). The items are stored in a database, they are all unique because they have metadata (achieved time etc.).

We would like to allow the users to have a decent overview and select items (for example to trade, gift or whatever). But rendering 50k items is undoable.

I could also remove the uniqueness of items and have a count column which stores duplicates (note I wouldn't be able to store metadata here). This way users still can have 50k items but if there are only 500 unique items I can safely render 500 since that is still doable.

Does anyone have an idea how I could realize this?

P.S. I initially asked my question on stack overflow but I was told that it was off-topic and this is a better place to ask the question (https://stackoverflow.com/questions/68305296/html-show-large-amount-of-checkboxes). Would be great to get some thoughts!

  • 1
    Not a direct answer but, with 50k+ items, I would have thought they could be broken into groups and subgroups of co-related items - surely something like that would enable a user to sort through the items more efficiently and would mean that you only have to display a limited number at once. Jul 26, 2021 at 15:30

2 Answers 2


I would imagine something similar to the way that Google Photos manages selection of individual photos:

  • allow searching and sorting (on object type/category, name, metadata, date found/used, etc.)
    • items can be part of the selection whether or not they are included in the current search (so you can select 3 weapons, then do another search and add 5 food items to the selection)
  • provide a checkbox to select entire categories
    • the user can click once to select all results of a given search, or all objects of a certain type/category
  • make the items themselves clickable to select/deselect, rather than a small checkbox next to them; this makes it much easier/faster to select a lot of items at once

I don't know what kind of game it is - but unless it's some kind of simulator for an over-enthusiastic librarian, 100k different items seems absolute nonsense!

Either the uniqueness of the items doesn't matter at all in the game, in which case you can safely drop it. Or it does matter, and it gives a player an advantage to sort thousands of items - then you run the risk of spoiling the experience. A game that requires you to spend most of your time organising your inventory to remain competitive doesn't sound much fun to me.

It would also be imaginable to save metadata only for very special items. Then you can stack your Magic Daisies and keep your Sword of a Thousand Truths as a solitaire.

Admittedly, once you've stacked the less important items, you have to deal with handling stacks, taking single items off a stack etc., but things become much easier for the player.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.