Npc with inventory?


If you have played (or know about) a game in which NPCs could have an inventory, I will appreciate it if you name the game and explain a bit about the use case :slightly_smiling_face:


1 Like

MUDs do this. Text based Multi User Dungeons. They also have a skill called peek, which allows some players, not all, the ability to peek at the inventory. Usually a thief, or some multi-classed character with similar skills. Peek would also work against a PC as well.

Allows thieves to practice against NPC so they can determine whether the NPC has inventory or not to steal. Allows thieves to determine if they want to risk being attacked for failing the steal. Maybe the NPC is stronger than they are and the item they Peek in the inventory is not worth the risk for example.

Peek is not 100% guaranteed to show everything in inventory either. Its like any other skill, the more you use it the better you get with it and the more it shows. Another good use of Peek skills is it can be combined with another skill called Locate Object. So a mage or some other spell casting class can locate an object thats somewhere in the world and who is carrying one item of whatever it is.

Tito is carrying one.
One is on the ground in Central city.
The Motania Gate Guard is carrying one.
The Janitor of Elendare is carrying one.
One is in the Donation Pit.

The last thing that is great about it is you can add random treasure generation, based on NPC levels and strengths paired with rarity, so that items are potentially generated upon spawn as well as death. Items potentially inserted upon death are of Treasure Type, items inserted when spawned are Randoms.

Randoms would be the BEST, most sought after, so most powerful, whereas Treasure Types, which are known to players based off the mobile, would say be at most 3/4 as good, whereas items easily obtained by picking them up are almost worthless.

Edit: You could also allow mages to imbue the Peek or Locate spells into scrolls or have Randoms scrolls imbued with one of theses since usually all players are allowed to use scrolls.


The fallout series NPCs have inventories. And even pick up items they consider useful. They will use the best weapon and best armour in their inventory and if they lose that weapon they will switch to annother (or go searching on the ground for fallen weapons).

It is also possible to pickpocket NPC and this inventory is what is pickpocketted from. Similarly when NPCs are killed that inventory is available to be looted

Separately, some NPC merchants have large inventories of stuff for sale


What do exactly you mean “could have an inventory”? (player can give to them and they use it or what?)

  • Fallout/Skyrim/etc
  • Atom
  • Kenshi
  • Wasteland?
  • X-COM games(or Xenonauts)
  • Elex/Gothic?
  • Crusader Kings with items as perks

i belive it could be much more of them but dont remember.

its also not real “inventory” in many games since in case of new item, they “replace preset” with “preset+item” as itemlist i remember in many games. Not-touched NPC inventory often is just a preset first to save memory. (and random items+preset on drop) depend on games.


In my Outside engine, NPC and Player components are a subclass of a CharacterComponent, which contains a InventoryComponent. It is extremely useful to let NPCs have a fully managed inventory for working with things like what clothing the npc is wearing, or what items, armor, and weapons the npc has available. Since Outside is designed for multplayer games, the items in the inventory of NPCs are actual unique instances of the item that exist in the world. Items are tracked uniquely in the engine, which enables Outside to track who owns an instance of an item, and how an item was acquired. This is especially useful for items that have addition metadata that needs to follow the item, or items that were acquired via a microtransaction that have additional rules about how the player can transfer/loss the item. Outside uses the same InventoryComponent for item tracking inside of WorldObjectComponents that may contain items such as a chest. Outside being a fully component based system allows for the same InventoryComponent being reusable in any situation requiring tracking items for another component.


I think a lot of RPGs have NPC inventories. I know that in Neverwinter Nights that you equipped NPCs just like any other player… and the standard AI scripts were setup to look through inventory for stuff, etc…

Quite common I think.

1 Like

Thanks guys. :slightly_smiling_face:

In LOL ‘League of Legends’, quite famous online strategy game by Riot, opponents have visible mage card inventories (they are mainly read-only, ie you cannot add/remove them except for your own), you can do the same approach but substitute online players with local AI NPCs, & make the mage card inventory or whatever the type of inventory it is, to a read/write/apply approach.

Think about the training battle tournament, in which you train with a read/write/apply inventory based NPC…it then depends on the game whether write/apply approach is before the game starts or during the game loop…