How much data is sent in multiplayer? Examples given..

Let’s say I want to spawn in item as a player… If I gave the server a struct, will the size of the data sent be the total of the entire struct? Or would if be a pointer to the struct? (like the first value or something?)

How about an array. If I send an integer array with a length of 4, would the size be 4 integers worth, or just one integer worth, the first index?

To limit network data sent and received, I was going to have the player communicate an item ID and other relevant data like stack size and modifications, but I won’t if sending just the struct acts sort of like just sending a pointer.

What is the best way to communicate using the least amount of data? I was also considering sending an enum (playerInventory) as well as an index to said item in inventory, and spawn that. (That’s how I have it setup right now)

Hope I explained that well enough.

You do not want to spawn items as a player. (possible cheating here).
Instead you send to server event that tells player did something that spawns item.
Then server spawns it.

Also pointers do not work over internets, both sides of blueprint (client and server) in most cases exist on different computers and have different pointers.
You do not need to send to server all player inventory, size and stats all the time, its server that tells your player all those numbers.
Also unless you are making MMO you will have just a dozen players at max, that does not make much traffic.
And if you are making MMO you need to write your own network layer anyway, and dedicated server for each zone, keep all player stats and inventory in real database etc.

Yes I know, I am having the player ask the server to spawn the item. The player passes a byte telling the server where the item comes from (e.g, inventory, action bar, whatever), and an index. The server then spawns the item from it’s own instance of the player inventory, hence preventing cheating by changing values or whatever.

Really this is just me curious as to how data is transmitted for struct/arrays. I’m aware actual pointers wouldn’t work, but say I send an array, is the first index sent (and length) rather than the entire array (hence acting like a pointer)? Or is each individual index sent?


Have you thought about installing wireshark and isolating the exe to view the packets size sent? Haven’t done it myself as my game is single player but I would do that.

Yup and that, just get packet sniffer and see what is going on, see how much data you can send before it lags etc.