How to transmit data structures larger than the allowed packet size?

2018-02-23 14:36:59

The player avatars in my current project are rather complex and can be configured in a variety of ways. Configurations can be saved and switched between during the game, similar to e.g. an RPG where you can design and play multiple characters.

An avatar is assembled at runtime from a configuration object (that holds only the necessary information, in the form of primitives and arrays) and several prefabs. In single player mode, configuration objects are usually serialized and saved to a file.

In multiplayer, I would like players to be able to select a handful of configurations saved earlier and transmit those across the network so that each client can configure the other players' avatars locally. This would happen at the start of a match. Configurations do not change during a match, so synchronizing changes is not an issue.

However, I can't seem to find an elegant way to do this with Unity's new networking API. While not by much, the data's too big for a single packet.