How to stream GameObject via Realiable UDP Protocol.

Hello there,

I have this single question. I suppose the already implemented WWW class streams the data over http so it uses tcp protocol. In addition it streams plain files which can be openly downloaded by anyone else(other than the application itself).

Is it possible to write a seperate console server which will stream serialized GameObject data in binary form(not ascii) over Reliable UDP? Which I guess will be both safer and faster. Any alternatives which are close to this way in your mind?

Thanks.

I think that most networking solutions and frameworks do this to some degree. The main work of integrating any framework in Unity (or more precisely: your game, as Unity is not limiting you in any way) is that you need to serialize your objects and then transfer only updates (the data that changed).

Photon uses UDP not because it’s safer but because it has less overhead and you at least have the option to skip reliability. It’s not by definition faster but behaves more game-compatible when packages are lost in transfer.

What I mean by safety though is the need to actually store the binary content data within a database instead of plain assetbundle or unity3d files which can easily be accessed by the clients and may not be under server’s direct control. If it were to be stored in the database then unauthorized access would be much unlikely.

The speed difference is not much of an issue I know. But for a massive MMO any slight optimization counts. So I would prefer to go for UDP streaming instead of TCP as a design choice.

My biggest problem is serialization though. I know there are the MeshSerializer projects for mesh serialization but what about animations, skeleton, audio, physics and other stuff attached to the GameObjects?

Is there a way to serialize GameObjects with all of their referenced data and stream it that way?