Best way to update inventory data from client

What would be the most efficient way to update inventory data from a client? I have a grid based inventory system similar to Minecraft and I couldn’t really figure out the best way to do this.

Some methods I’ve thought of:

  1. Save a list of all the interactions and send it to the server to update one by one
  2. Send the updated inventory layout and have the server check if new layout is valid(not sure how I would do this on the server)
  3. Send data to server every time a new interaction has happened

When I say interaction, I mean like moving from 1,2 to 1,4 in the grid.

Here’s an example of how my inventory works:

Any help is appreciated!

1 Like

One and two both seem valid to me but which you decide to use would have to be determined by game mechanics. More information on what type of game and what interactions inventory will have on gameplay would be needed for me to give a decisive answer.

Regardless, I would likely use option one and validate all interactions on the server before applying them.

1 Like