- Home /
Too many Lists?
Dear Community,
this might not be the right place to ask this question. If so, I apologize. I don't know my way around the coding community and didn't know where else to ask.
In my game I have a world. Within the world I have a list of teams. Within every team I have a list of team members.
Every world also has a few different Card Decks. Those are comprised of lists for the deck itself and the graveyard.
In addition every team member (and that's up to 30) has lists for their card decks. Again those are comprised of the cards in their hand, their deck, their graveyard.
And it goes on with other collections like cards to buy etc. You get the picture.
I don't know how many lists I will end up with. But definitely a lot. Now it says that lists are not as good as arrays. I could be using arrays but it would be so much more difficult for me (being a beginner) to take care of sorting, adding and deleting.
So what I am asking is this: Do I need to worry about having say 1000 lists? Should I build my decks, and teams and members differently?
It's probably difficult to say. Nonetheless I'd be grateful for a hint. Thank you.
I imagine it's probably a little hard to read, but are you experiencing any sluggish behavior now or is this just curiosity / proactive?
I was just curious / worried. So far behavior is fine.
Answer by tormentoarmagedoom · May 23, 2019 at 02:11 PM
I'm not sure, and I'm not an expert at all.... but:
I think the problem its not the number of lists, the problem is, its a list of what?
I mean, storing lists of integrers or strings is not a problem. But lists of prefabs its another dimension, much more bigger.
But also having lists is not a problem for performance. What can slow performance is to be reading multiple list constantly at same time. If you are smart to make the game to not beeing reading and writing multiple list each frame, i think you will have no problem
It's mostly lists of integers. And also so far I am not reading from many of them simultaneously. You've helped in cal$$anonymous$$g me down. Thank you sir!
Your answer
Follow this Question
Related Questions
List/Array should handle another List/Array - Upgrade System - Performance 1 Answer
How do I swap two gameObjects order in a list? 2 Answers
Performance and memory 1 Answer
How do I add new instances of a object into a list? 1 Answer
Performance question - Loading large-ish amounts of text data in a mobile game? 1 Answer