Hi Everyone,
It has been a while but I can finally show you the new editor we have been working on for the inventory system. Below I will showcase only the editor side of things, I won’t show the inspectors or runtime views simply because they are not yet ready to be shown.
In this showcase I will go through an example of how someone may want to set up a few items. And we’ll do so starting from scratch.
We’ll create a potion, and a big potion
We’ll also create some currencies bronze, silver and gold.
And finally we’ll create some recipes
- Create Database
- Create ItemCategories
- Create Currency
- Create ItemDefinition
- Create CraftingCategories
- Create CraftingRecipes
Watch "Create New Database 2020-02-03 12-01-37" on Streamable.
streamable.com
As shown above when creating a new database both ItemCategory and CraftingCategory are given an Uncategorized category. These cannot be removed. By design an ItemDefinition and a CraftingRecipe MUST have a category. When an ItemDefinition is created it will be given the Uncategorized category and you will be able to change it.
Once a database is created the first thing to do is create some categories. In this simple example we want 3 ItemCategories.
- Base : The base ItemCategory which we will use for all out items
- Consumable : The ItemCategory for the potions
- Materials : The ItemCategory for our crafting materials used to make out potions
For this example I want all the Items to have an icon and a price. In addition to that Consumable items will have a baseHeal.
For showcase purposes I’ll also add a CategoryIcon to Base and a bonusHeal to Consumables.
Watch "Create Categories 2020-02-03 14-40-17" on Streamable.
streamable.com
It is important to understand the difference between the Attribute tabs:
- Category attributes : Attributes that are defined in the category are the same for all the items in that category. For example “CategoryIcon” would be used in an inventory UI where items are split in category tabs, with each tab button being a “Category Icon”
- Item Definition attribute : Attributes that are defined in the ItemDefinition are the same for all items that share the same ItemDefinition. For example “baseHealAmount” will be the same for all “Potions”.
- Item attribute : Attributes that are defined in the Item are unique to that item instance. For example you can have two “Potions” with different “bonusHealAmount”
The magic of being able to set any attribute type you want was implemented by Justin. You can specify which assemblies and Types are shown in the type search field within a special window which is shared by Behavior Designer 2 and the inventory system.
You also saw that I specified the Base category as “abstract”, this prevents the Base category from having ItemDefinitions. When adding ItemDefinitions you’ll see that Base won’t appear as an option when changing the ItemDefinition category.
As a reminder, Mutability is set for items that should be able to change Item attributes after they are created. In our simple example that is not the case so I set them as immutable.
Since we have a price attribute of type CurrencyAmounts, I’ll first create the Currencies I want before the ItemDefinitions.
Watch "Create Currencies 2020-02-03 14-53-06" on Streamable.
streamable.com
The order In which I set the values is important as there are conditions which prevents a currency to fraction to another currency which is more valuable, similarly for overflow the currency cannot be less valuable.
Fraction and Overflow currencies are set for automatic currency conversion so that a currency that will go above its max value, in this case 99, will then convert to the overflow currency.
Example 1: 55 Silver + 50 Silver => 1Gold | 5Silver
Example 2: 2 Silver - 50 Bronze => 1Silver | 50Bronze
Now that we have our currencies set up we can set up some ItemDefinitions.
Check out this video on Streamable using your phone, tablet or desktop.
streamable.com
With that we have created a Potion, a big Potion , a HealWeed and a Spring Water. As you would expect all attributes set in the category are available in the Definition once the ItemCategoryField is set.
As shown we inherited the icon from Potion to Big Potion by making Big Potion a child of Potion. When setting the Override value the Variant Type is changed automatically for ease of use. We also show the attribute values in the list when possible so that you can easily view what the values are.
With the ItemDefinition done, it is time to show the CraftingCategories. In this case I want Two recipes. One will have ItemDefinition ingredients only and the other will have ItemDefinitions + Currencies Ingredients. To differentiate them I’ll create two CraftingCategories
Check out this video on Streamable using your phone, tablet or desktop.
streamable.com
Setting a custom CraftingRecipe Type will allow people to create their own complex crafting system. Out of the box we will have two CraftingRecipe types, the base one and the one with currency.
The difference will be obvious when we create the recipes.
Watch "Create CraftingRecipes 2020-02-03 15-25-49 (online-video-cutter.com)" on Streamable.
streamable.com
PS: At the end of recording everything I thought of swapping out the colored boxes by the “Icon” and “CategoryIcon” attributes if they are available.
To finish up this showcase here is the magic of the colored boxes (which can now also be icons)
Watch "Box Magic 2020-02-03 16-54-16 (online-video-cutter.com)" on Streamable.
streamable.com
I hope that you will find the editor to be very easy to use and especially very efficient. The goal is to allow designers to make a lot of items very fast while keeping everything very organized.
It is not shown in the gifs but the editor has a validation process that checks all objects in the database when the editor is opened. If something is wrong (i.e you deleted a category manually) the editor will auto fix as many things as possible.
If you have any questions or feedback on the things you see above please let us know. There are still things that we are working out but we are getting closer to a fully functional system.
For the next few months we will focus our time on bug fixing, polish, documentation and getting the demo scene ready.
We have a lot of plans for new features and improvements but they will have to wait for after the initial release.
I’m really excited for the next update when I’ll be able to showcase the demo. We’ve been working a lot on it but there is still a lot to do.