Inventory and object rarity

Hello,

lets say that I want to have object rarity in my game. You know, for example you have Shotgun, and it can be in common rarity, uncommon, rare, epic etc… and the rarity will modify object stats, better the rarity, better the stats. For example damage, reload speed and so on. So far I have figured two possible ways to do it:

  • First idea - lets talk about the shotgun. I can simply create one shotgun object for each rarity. One will be Common Shotgun, next one Uncommon Shogun etc each one with different stats according to its rarity. As far as this one looks like simple method for me, I dont like that idea, because If I have 5 rarity levels in my game, it will be 5 different objects for each kind. 5 objects for shotgun, smg, armor etc … and that do not sound very effective to me. Also sounds like alot of unnecessary work.
  • Second idea - probably the better one. Simply one shotgun object, and then rarity will be applied on it and its stats will be modified and then saved. For example: rare rarity - damage x1.3, reload speed x0.8 etc. Sounds alot more effective to me, but Im not sure how to do it.

So is there anyone who can tell me some tips on how to do it? Some ideas? If I will pick the second idea, I need this: player will for example finnish game level or open a chest with loot, game will roll the loot he will receive, and then roll the quality. So if in the end, he receives a pistol and rarity epic, I need to somehow apply the epic stats modifier on that basic pistol, probably change its name, so its not a pistol, but Epic Pistol (or something like that so that player can tell it apart from other pistols in inventory), and then save the result in player inventory, so player can equip that Epic Pistol in customization menu.

Or if there is even better way of implementing this game mechanic, Im open to learn how to do it.

Thanks for any help

I’m a total newbie, but I think it would help to have more details. Have you made something yet or are you still in the planning phase? Because the answer to your question could vary wildly based on how you set up your project.
I’m gonna try and give you an example based on how I would set it up:

Shotgun’s object variables:
DamagePerBullet
ReloadSpeed
Range
Rarity

Events:

When you pick up the weapon:- - - - - - - - - - - - - - - - -Change Rarity to Random(1,2)

IF Rarity = 1- - - - - - - - - - - - - - - - - - - - - - - - - - - - Change DamagePerBullet to [Default]
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Change ReloadSpeed to [Default]
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Change Range to [Default]

IF Rarity = 2- - - - - - - - - - - - - - - - - - - - - - - - - - - - Multiply DamagePerBullet by 1.5
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Multiply ReloadSpeed by 0.8
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Multiply Range by 1.2

And so on for each different rarity. Some cons of this system: The object can only have one Rarity at the time, so you can’t have multiple Shotguns with different variables active in the scene.

Just something I whipped up in a minute, hope it helps

Also you may wait for someone more competent to reply lol

For now im in the planning phase trying to find the best possible solution for implementing this, I havent made anything yet. Im not sure if what you said will work for me, but you for sure gave me some ideas I need to explore and test.