Unreal Engine 5.2 | Multiplayer Inventory "Slot Update" Issue clients.

The current setup consists of an Inventory Component, ItemData Struct, and a widget called WB_Slot.

Inventory

Within the Inventory Component, I have a function called “setSlotData” in which I simply insert the new data for the chosen slot using “Set Array Element”.

setSlotItem

This ItemData struct array is replicated and set to RepNotify. Here’s the problem: the array is not aware of the specific index that has been changed, so I can’t update the index specifically. In this case, I’m simply updating all of the slots (I’d like to change this to a system that updates only the slots that have changed specifically).

OnrepUpdate

Extra Info:

  • Yes, the Inventory Component is replicated by default using the checkbox.

  • Yes, the Inventory Component is added to both players and actors.

  • The player controller handles the updating part (drag/drop/move/split/stack).

  • The items are server-sided. Most of the function calls are done using RPCs, but the client is able to run “Owning Client” events if needed.

  • Yes, I tried creating an integer array that stores all the changed “Slot Indexes” and then looping through that array on RepNotify to update only the indexes that changed. The problem with this approach was that I couldn’t clear the list on RepNotify because the list is being filled on the server… So the list keeps getting bigger… essentially creating the same problem of updating slots that aren’t needed at that point.

  • I tried a simple RepNotify boolean, but it seems that the network isn’t fast enough, and items start disappearing even though they are present. This kind of inconsistent behavior will ruin the gameplay experience. I don’t have this issue when I update every single slot.

Hopefully, this has informed you enough! If you have any ideas, feel free to share your thoughts! I would appreciate it since I have been struggling with this for months now. :blush: