How to send player position, health, stats in a packet ?

Started by
1 comment, last by BlackShark33 12 years, 9 months ago
hello everyone

i have been working on a top down 2d shooter using c++ and SFML and its almost finished and all is left is to implement network to the game, so i decided to use WinSock 2 to do the networking.
now i have been able to make a server and a client successfully where the server sends a message and the client receive it, but i don't know how to send the player stats and movement and enemy's and all that.
from what i understood from my research and the network FAQ that all these data are sent by packets but i really don't know how to make the structure, so i was hoping someone would give me an example or a simple code ?
so can you guys help please, keep in mind this is my first time to make a network based game.

thank you all
Advertisement
Question #12 in the Forum FAQ should help, in particular the links to how some FPS games did this.
Why not use SFML for networking? Its quite a bit easier than WinSock and has tutorials on how to use it.
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/

This topic is closed to new replies.

Advertisement