Adding Items

chrisk

Active member
Hi, Justin,

I'm trying to understand the item system and I have a couple of questions. I'm not sure if UCC is designed from the beginning that it can be extended to support many items but it doesn't seem so. Or maybe I don't quite understand how to structure the items so that I can add many items. When I mean many, it means few hundreds to thousands.

1. First of all, to create an item, you will need to create ItemType for each unique item. Is this correct?
If so, it's probably not a good name since it's more like an ItemID. We of course, will need unique ID but we need more than that. From the name, I thought it was more like item classes and under an each type you create multiple items. Anyway having just an ID is not good enough to tell what kind of item it really is.

We will need more categories of classes to be able to tell what the item is without setting many properties at the individual level (categorizations). For guns, we usually have several Main Classes. Primary, Secondary, Melee, Support. And under the Main Class, we also have SubClasses. For Primary Class, we have, AssaultRifle, Shotgun, SMG, MG, SniperRifle and so on. And finally, we add weapons to each SubClasses. When you have 100s of items, you need to group them and having a group can be useful(sometimes necessary). You can give specific information to each group, such as ammos, animations, instead of setting them to individual items. It helps to reduce errors and make the management easier.


2. And it also looks like I have to create Items and add into the scene in order for me to use it in the game. Is this correct?
I may have 1000s of items in the finished game and the most of them doesn't need be loaded. Instead of having listed in the scene, will you support dynamic loading of items from the Assets in the future?

Anyway, UCC Item related stuff is bit confusing and hard to grasp at first. Some classes named item that are not really items and ItemType is really an ItemID, and there ItemSet I didn't quite understand. It seems like you have to enter ItemType(again, why are you enter ItemType here? Shouldn't it be ItemClass? If it is a specific ItemType, do we have to enter all of the items in the game in order for it to work)

I hope things get clearer as I learn more but I wanted to make it clear that we are on the same page.

Thanks a lot for your help.

-chris
 
Hi Chris,

1. That's correct. ItemType contains more than just a unique ID (such as the capacity) and it may be expended in the future so I wanted to make the naming generic enough. The category aspect is getting into the inventory side of things which is a rabbit hole that I don't want to go down for this asset and instead focus on the character controller aspect.

2. You can pickup items at runtime. Take a look at this page (there's a video at the bottom):

https://opsive.com/support/documentation/ultimate-character-controller/items/runtime-pickup/

This page also explains the Item Sets:

https://opsive.com/support/documentation/ultimate-character-controller/inventory/item-sets/
 
Hi, Justin, thanks for the quick reply.
If you mean to use ItemType more like Item categories but you are just using it as an ID for now, I think makes sense. I'll assume that will expand into categories.

You mean it supports dynamic loading from the Project folder, right? I probably missed the dynamic loading of items. Your demo setup has all the items already listed in the scene so I thought I have to add them to the scene in order to pick it up.

Thanks.
 
If you mean to use ItemType more like Item categories but you are just using it as an ID for now, I think makes sense. I'll assume that will expand into categories.
ItemType will never function as a category because each item must have a unique item type. Item Type will just contain more than just a unique id (such as the capacity and drop items like it does now)

You mean it supports dynamic loading from the Project folder, right? I probably missed the dynamic loading of items. Your demo setup has all the items already listed in the scene so I thought I have to add them to the scene in order to pick it up.
Yes, you can load items from prefabs. In the demo scene the bow and the katana are loaded this way.
 
ItemType will never function as a category because each item must have a unique item type. Item Type will just contain more than just a unique id (such as the capacity and drop items like it does now)

Hmm.. I'm not sure how you will support categories then. I fully understand you will need a unique ID. If ItemType is a unique ID, to me, it is an ID. And I'm not sure why ItemType has Capacities. You already have an Item class and it should be a property of Item, no?

Anyway, when dealing with items, you will need categories. ItemSet requires ItemType, a specific item. Shouldn't it require weapon categories instead? So that you can switch to rifle classes when you have several rifles. In the current setup, it looks like you will have to list all possible rifles to make the switch. In this case, I think it makes more sense to use categories rather than an actual item. Hope it makes sense.
 
Hmm.. I'm not sure how you will support categories then.
Categories more relate to the inventory side of things so I do not plan on implementing categories for items. The inventory is extremely simple and I did that on purpose so it could be easily extended with another integration or your own implementation.

You already have an Item class and it should be a property of Item, no?
Not necessarily - take the case of the pistol. Both left and right pistols use the same ItemType, but the ItemType is used by two different Items. In that case which instance would I use? In addition, the ItemType doesn't always map to a specific item, such as pistol bullets.
 
Hmm, the relations between Item and ItemType is still not very clear. I think left and right pistol should be a property external to item but it isn't really crucial. I'm used to using ID as just a simple ID.

More potential problem is that I have to use ItemType where item category should be more appropriate. How would you explain Itemset referencing Itemtype? Do we have to list all of the items in order allow the weapon switch? It seems little too convoluted to use specific Item ID in inventory switch. Again, I may end up having 100s of items and I'm little concerned that it will become unmanageable pretty quickly.
 
More potential problem is that I have to use ItemType where item category should be more appropriate. How would you explain Itemset referencing Itemtype? Do we have to list all of the items in order allow the weapon switch? It seems little too convoluted to use specific Item ID in inventory switch. Again, I may end up having 100s of items and I'm little concerned that it will become unmanageable pretty quickly.
The Ultimate Character Controller inventory has no concept of categories. The only time the category term is used is for the ItemSetManager and that is so it can manage which ItemType should be equipped next. Definitely take a look at the ItemSetManager page as it provides as good amount of use cases.

If you only want to be able to have a subset of items equippable then you'll want to enable/disable the ItemSet within the ItemSetManager based on what items you want to be able to be equipped. In your case I wouldn't use the Inventory component at all and instead create your own implementation by implementing the InventoryBase component. This is what I think will be done for the Inventory Pro integration. When you do this you can then manage the ItemSets as well as the inventory so you can limit which items can be equipped.
 
Sure, no problem. I can implement the stuff on my own. I just wanted to understand how things work in UCC so that there is no duplication of work.
There may be more questions like these in the future so please have little patience with me until I figure out.
Without knowing the design decision behind, I may have some trouble understanding the system.

If I may add one more thing, I wish the naming be more specific. In my opinon, naming are little too general to figure out what it really does.

Cheers!
 
For what it is worth, I was also slightly confused on whether it was meant to be a 1:1 with ItemType and Item. For example, I thought intitally that I could use ItemType Pistol with multiple pistol variants, such as a Five-Seven and a P226 both being of ItemType Pistol. I now see that I need to create a separate ItemType for each different weapon.

To be honest, I didn't expect much more than rudimentary inventory management within this asset, so this is not a big deal. I will probably use the new Rucksack system for my inventory.

I really appreciate all your hard work with this asset, Justin. Thank you!
 
Top