Networking Part 1
On the weekend I created the basics of networking in my game-engine.
Technologies I use:
- Networking lib: Vert.x
- Protocol: UDP
- Methodology: Server-Client
I decided to use Vert.x instead of Netty, because I don’t want to do deeper networking stuff. Vert.x is also built on the top of Netty and completely non-blocking, so it’ll be fine I think.
What you can see in the video that when I move my character, the player (client) sends it’s input (which button was down — WASD) and it’s other parameters to the server. The server receives those, calculates the new position of the player and broadcasts it to the all joined participants.
Current problems I have to solve:
- It’s laggy somewhy, maybe because the massive amount of debug log?
- UDP is not reliable, have to handle that
What I already solved:
- As UDP is not reliable it may changes it’s socket. If the server receives a new command from a client and see that the address was changed, it auto updates, so in future broadcast it won’t be a problem.
Also, this is a must to read: http://gafferongames.com/