MassiveNet - XianWorld/xxxgame GitHub Wiki
Features
Unity3d UDP networking library focused on high-CCU, multi-server architecture.
MassiveNet will be somewhat familiar to those who have used Unity's built-in networking or uLink.
Some of its features and design goals include:
- Actor-like messaging and synchronization via NetViews.
- Easy RPC definition using the [NetRPC] attribute.
- Automatic network LOD/culling for NetViews, a crucial feature for large CCU games.
- Build large, open worlds with support for seamless client/NetView movement from server to server.
- Network instantiation of NetViews through tagged prefabs. (@Owner, @Proxy, @Peer, @Creator)
- Out-of-the-box serialization for common C# and Unity struct types.
- Supports serialization of custom types via delegate registration.
- Incremental synchronization of NetViews to avoid resource spiking.
Techniques
- NetStream: bit reader/writer on byte stream.
- HalfConverter: Fast Half Float Conversions.
- RPC:
- RPC attribute/definitions
- RPC info collection
- RPC dispatcher: how to invoke the RPC method, and how to process result of the method for client request.
- Reliable UDP: protocol of the RUDP.
- Chanel for (un)reliable udp
- NetMessage for RPC communication
- Peer: NetPeerRing
- NetScope: Maintains state and configuration for scope calculation, as well as events for when this particular scope goes in/out of scope for the connection associated with this socket. ViewId/Scope network level of detail (LOD) lookup for each in-scope view. 1=Every, 2=Every other, 3=Every fourth sync.
- int InScopeDist: How close a connection must be to the NetView for the connection to be set in-scope for the NetView.
- int OutScopeDist: How far away a connection must be to a NetView for the connection to be set out-of-scope for the NetView.
- int LevelOne: If within this distance, scope level will be set to one (the most frequent sync rate). Anything beyond this range will be set to either scope level two or three.
- int LevelTwo: If within this distance, scope level will be set to two (the middle frequency sync rate). Anything beyond this range will be set to scope level three.
- NetView/NetViewManager