I'm building a game engine on the OpenTK framework that needs to support multiple players.
How I have the basic framework established is that there is a Client and a Server. The Server binds and listens on a specified port, and the Clients connect to the Server's IP Address and Port to make a TCP socket. The server then transmits a World object to all clients as they connect.
A World object contains all of the Light objects, Surface objects, Mesh objects and Camera objects. With all of these objects, the World is responsible for rendering the game environment.
My idea is that each Camera object has a Unique ID, a position (X,Y,Z), and 2 angle values representing Zenith and Azimuth. When any of these values changes (only the camera can move at this point. Basics first!) I want to Serialize and send the updated Camera object to the Server, which then transmits this object to all of the Clients. The Client then deserializes the new Camera object, uses its Unique ID and updates the existing Camera object in the World. Since the Camera object consists of only 5 double values (X,Y,Z,Az,Ze) it shouldn't be a lot of data being sent over the network, but my implementation seems to slow down the Game Screen significantly
Is there a better model for Multiplayer network communication? Is there any built in functionality in C# that handles this kind of communication?
Basically, I just need to update all of the other Clients when one Client's Camera changes.
Thanks for any help!