Replicate a UObject via Fast TArray Replication and getting the error “Attempted to send bunch exceeding max allowed size”

I am making a game in the survival genre. I created the items in the game as UObjects and created an inventory to hold them using FFastArraySerializer.
(I used LyraStarterGame’s inventory system as a reference.)

At first, this seemed to work well, but when I tested it with the largest storage inventory in my game, which can hold hundreds of items, I ran into the error that the BunchSize exceeded the MaximumSize.

Inventories that can hold hundreds of items seem to be common in games of this genre, but it seems like the engine has too tight a limit. Is there a good way to solve this problem? Your help is greatly appreciated.

Don’t replicate whole UObjects. Better to use structs or Data Assets that have simplified data in them

  • item id
  • current amount
  • can be stacked
  • maybe rarity (can be an uint to keep data low)

Keep the full information linking the item to it’s details in a data table
The data table will handle the heavy lifting like retrieving the icon, name, attribute prefix and suffix, base class as soft class reference etc

If need be add a nested modifier struct if it’s an rpg with item variants.

Send the whole inventory list once then try sending only what is changed. So item at slot 5 for instanced swapped place with item at slot 10 or used x items in slot 3. Have server side functions to handle specific cases.

Most cases include

  • Swap slots(slot1 index, slot2 index)
  • Use slot(slot index)
  • Split slot stack(slot index)
  • Join slot stack(slot1 index, slot2 index)
  • Remove slot(slot1 index) => destroy or drop item => spawn in world based on soft class ref
  • Fill slot(slot index, Item struct)

Also no need to replicate the inventory to other players. Only rep notify the characters current equipment.

If you want players to trade then only send information on what items are to be traded.

There was a pretty good breakdown of handling data in an unreal presentation