- By opening this merge request, you agree to release your code and all other changes under the GPL 3 license and to abide by the terms set by this license.
- Migrations have been added if applicable ...oh yes, yes they have.
- Significant changes of this merge request have been added to the changelog.
- Ensure the migration is updated if there have been any new item assets added at the point this MR is merged
- A play test using a clone of the live server database must be undertaken before this MR is merged
This MR is an overhaul of persistence, the key changes being:
- Items are no longer stored as JSON in loadouts or inventories
- Items are now stored individually as records in a new
- Items now have a unique
item_idonce they have been persisted
- Structs from the main game engine are no longer directly persisted as serialized JSON and now pass through a conversion layer (
- The concept of
pesudo-containeritems has been introduced in order to allow items to belong to a specific player's inventory or loadout, without the need for separate
loadouttables (see below for further description of containers).
loadouttables have been removed as they are no longer necessary.
- Item assets are no longer directly loaded via the asset system and are now created with
- Added additional
all_itemsoption to the item data export tool
- Moved migrations to run earlier in server startup
- Moved character loading and updating code out of
A full migration from the previous schema is included - there should be no discernible difference for players after this change.
Items / Containers
item table supports infinitely nested containers, with each item having a
parent_container_item_id which represents the container it exists within. To support this hierarchy, the concept of pseudo-containers has been introduced. These are "pseudo" items that are automatically created for characters - the following types currently exist:
- World - This is created by the migration added by this MR, and acts as the root container of all items in the database.
- Character - Created for each character created - uses the Character ID as its item_id and exists to provide a parent for the
- Inventory - Created for each character created, the player's inventory items are contained within this pseudo-container
- Loadout - Created for each character created, the player's loadout items are contained within this pseudo-container
[World]-+ +--[Character] | +--[Inventory] | | +--[Bag] | | | +--Some Item | | | +--[Another Bag] | | | +--Cheese | | +--Health Potion | +--[Loadout] | +--Helm Item | +--Boots Item
Although Veloren does not currently support actual containers within a player's inventory such as extra bags etc, this MR lays the foundation for such support to be added with relative ease.
Closes #678 (closed)