GameLog #2: My First Experience with WebSockets in game development


Today I will share with you a bit of my knowledge about game servers/emulators.

 Recently in my personal project "RetroEngine" I've decided to use a websocket server and have success in implementation of this technology on my game.

An websocket server is a program that will make the bridge between the Client(where the user interacts) and the database/restricted files that store the informations of the game.

In a multiplayer game the server is one of the most important things. For a newbie like me before start  to learn about websocket it looks very hard to understand, but l let me show it in a simple way.

When a player make a moment for example he sends an message to the server using the "ws" protocol, the message is received on the server, interpreted, the server create the path, register the information on the database, and send to all players.

So this is what makes the magic happens on the games. Is very fascinating see the game happening in two places at the same time! :))

Implement this in a old project like my game was a hard talk, I had to reimagine all the functions but with my implementation i could see a huge difference in the game velocity, gains of performance, more control, security and many other things...

So hope this brief explanation could introduce you to the world of websockets without technical terms and all stuff, see you in the next post ;))