   What to send over socket when making a DX9 network game?
  Hello, I''m trying to make a multiplayer 3RD Person network game demo. I have looked at the DX9 SDK tutorials about client server.. When I have managed to setup my connection, what data should I send to the clients and server? I mean like model type, position and stuff like that.. Should I send it like an array or what?Thanks!opengl_coder 
  You could send the input or some kind of structure that describes gamestate changes. I give you the advice to drop the multiplayer part of your demo and just focus on other things. Networking in games is a pain. ;  The done thing for networking games is to transfer what the player is intending to do, for example to begin moving forwards. You shouldn''t tell the server at what speed you wish to move, as this could be exploited to have lightspeed characters. The server would then respond to the clients informing them that object X is moving at speed Y in direction Z.A little example:[CLIENT->SERVER] BEGIN_MOVING [angle][SERVER->CLIENTS] OBJECT_MOVE_SPEED [object_id] [angle] [speed]note: object_id in this case would be the player model[CLIENT->SERVER] SHOOT [angle][SERVER->CLIENT] SHOT_FIRED [from_object_id] [gun_elevation] [gun_rotation]Obviously BEGIN_MOVING, SHOOT, etc would be byte tokens for the commands, so the SHOT_FIRED command might take:1 byte for the command ''SHOT_FIRED''2 bytes for the from_object_id4 bytes for the gun_elevation4 bytes for the gun_rotationHope that helps.   [[ Pancake Meat ]] ;  Yes, thank you! But how should I send the data : )Should I create a struct like below and send all the dataat the same time?struct tPlayer{//player info like pos and rotation};max_player = 4;tPlayer player[max_player];//function callsend_player_info(player[client_id]);And if this is the right way to send player info,how can I send this type (player[id]) as bytes, should I just typecast it?Thanks again!   [edited by - opengl_coder on February 13, 2004 11:49:38 AM];  One big struct will work.Yes, you can take the address of your struct, and cast it to void*, and send it to the other side (make sure to use sizeof() on the struct to get the right number of bytes).However, it sounds as if you''re not clear on how data is stored in memory, and what pointers, bytes, data, and structs really are. This leads me to believe that trying to do a multi-player network game will frustrate you more than teach you. You need to know the basics before you can do advanced things. ;  Removed   [edited by - opengl_coder on February 16, 2004 2:38:44 AM]