2.4.0
The one that revamps how items are stored
Major Changes
New Item Slot Container!
This version of Arc Inventory contains a massively improved Item Slot Container that powers both the inventory component and the item stacks. This container is no longer an array with fixed indices, but instead a Hash Set that hashes slot ids and tags and allows for O(1) lookup from an Item Slot Reference. This also eliminates the need for item slot generations, as now references cannot go stale. Item Slot creation is O(1) now as well, as is deletion! In general, creating and deleting item slots is trivial, and you can add or remove them as often as you would like.
Sub Item Stacks on items are COMPLETELY reworked, and major breaking changes have happened there to accomodate the new Item Slot Container for them. Sub Item Stacks now have slot references.
Improved LootItem() behavior
The LootItem() function on the Inventory Component is one of the most useful tools in the inventory. However, controlling where the item will go in a Loot Item call has long been difficult. The function would simply pick the first possible slot for the item. Now, you can provide preferences to the LootItem() call and processors can use those preferences to score slots better.
Also, LootItem has been massively optimized! Prebviously, each processor would loop through every item slot. Now, the Processor is provided a map of Item Slot References and Score and is expected to fill out scores for each item!
Proxy Item Slot References
You can now create item slot references that do not exist, but may exist in the future! This is extremely useful for processors that can fake having many slots, but only promote those fake slots to a real one if an item attempts to be placed into that slot. This is useful for things like large grids of item slots, large lists, or similar processors.
Improved Data Coherence and Push Model Support
For various reasons, almost every public property across the plugin's classes have been made private and getters/setters have been added for them. The Item Slot Reference mainly has been made immutable, as now it's a hashable object for the item slot cotnainer. All replicated classes now support UE's Push Model replication, bringing about a massive performance increase when replicating the inventory system.
Added Inventory Presets
A new data object has been added to split out the inventory setup code and help prevent blueprint data corruption issues. Inventory Presets allow you to set an inventory's default slots and processors, and you can share them across multiple classes. They also support some inheritance!
They also really help when working with source control locks
Improved logging and data validation
Across the plugin, Data Validation has been added to prevent incorrect data setups. These validators will now throw errors, prevent objects from being saved so long as the error exists, and fail your builds if there is an error. This has additionally allowed the removal of some safety checks, improving performance, as things like nulls can no longer slip in to certain lists in item definitions and the like.
Additionally, LogInventory now logs all inventory actions if you enable verbose logging. Try log LogInventory verbose
sometime!
All Patch notes:
General
- Breaking - Across the plugin, all replicated properties have been made private, and functions to get those properties were added. This is to support Push Model replication.
- Added far more robust logging when LogInventory is set to verbose. This should give you a really good idea what is happening in the inventory when you enable verbose logging.
- Active Item Swapping is now entirely predicted! You can just call the swap active item calls on the client and server at the same time, and the active processor will resolve mispredictions.
- Equipment Processor now fires it's On Equipped events regardless of whether or not there is an AbilityInfo on the item.
- Added
ArcInventory.Debug.PrintInventory
console command which prints out the same debug information as the ShowDebug Inventory command. Useful for copy+pasting! - Forced support for 5.1+ Replicated Subobject List (this is a massive perf increase)
- Added support for slots and slot refs to be owned by any object
- Removed the ArcInventoryExtras plugin from the github distribution. This plugin is wildly outdated, and is not useful anymore
Item Stack:
- Added more functions to control how sub items work with the item stack
- Added an event that surfaces when sub items change
- Added Push Model Support
- Added the ability to query where fragments are coming from in a Find First Fragment and Find All Fragments call. You can now exclude subitems from FindFirstFragment queries
Item Slot Container
- Added push model support
- Better (and less buggy) callback ordering for when item slots are deleted
- Fixed a number of bugs around replicating slots
Item Slot:
- Added Fake Item replication, which pretends to clients to be a real item (useful for hiding actual loot values from clients until they observe the container)
Inventory Query:
- Added a quick way to make a query that matches an item definition
- Added support for querying against item slot references (Useful for proxy slots)
Inventory Component:
- Added info to the Item Slot Update params to indicate if a slot was created or deleted
- Updated Loot Item to take a preference struct instead of just a query, so that way preference can indicate an exact desired slot
- Added support for Push Model
- Added context tag and what processor an event comes from in the event payload
- Improved BindToAsc logic to actually track the bound ASC and prevent double binding, or even missing an unbind.
- Added TryFindEmptySlotForItem, which will return the first slot the inventory thinks will hold an item. Using this slot may fail to place the item in the slot if an inventory takes only part of the item (in the case of stacking)
Item Definition:
- Added support for Item Defs to add Slot Definitions to item stacks
- Added Stat Tags to item definitions
Item Stack Stat Tags
- Added Push Model Support
- Added a Most Recent Changed Context tag (so we can explain why stat tags have changed)
- Added RemoveOnZero parameters to SetStack and RemoveStack for Stat Tags, so that you can prevent the tag from being removed when it hits zero. This is useful now that item definitions provide stat tags.
Item Processors
- Breaking - Inventory Processor Process Loot function has changed signature (again) to support the new preference structure
- Added push model support.