Can someone, please tell me how variables are structured and handled in case of a different-stats entities of the (initially) same kind?
For exaple - In games like “Xcom”, “Disgaea” and “Darkest dungeon” there’s a such thing as a recruitable soldiers - we buy them as “items”, they stored in “inventory”, but they are independent (as far as i understand) entities with their own personal stats. (Strenght, Speed, Health etc.)
They are get their level-ups and ubgrades independently from each other.
Or - in some games we can upgrade/level up equipment. Or put attachments into slots.
Or even - when we have in inventory three same pistols with different quantity of ammo left in theirs magazines.
I’m not asking for detailed “do this and do that” instruction (although, i would be glad to).
All i want - to know the “main theory” behind those mechanics.
Posting a links to some other’s publications on some other sites will be fine too (even if it will be about other engines and programming languages).
Once again - i know, how inventory works, and how STANDART, multiple items of the same kind are stored there.
I don’t know, how UNIQUE items stored there.
So, please - explain me.
Thanks in advance!
—!!! Update !!!—
I’ve got a very satysfying answer for my question, but i’m not gonna mark this topic as “solved”, because i would be glad to see more information. If someone wants to say something different, or say something extra, or just give an advice - you’re welcome!
Feel free to share your knowledge. Your opinion on this topic is highly appreciated.