Please bear with me, I am completely new to game networking. Any help and improvise in this question will be appreciated!!!
I have been playing around with BJS (babylon.js) for a while now, wanting to make a real-time multiplayer game.
I have been searching around the web about game networking, and read this:
It gave me a clear idea of how should I go ahead. But in all the forums, I hear people saying game networking is very hard, not to waste time on it rn, and stuff.
So I thought to give it a try. I used node.js for server with socket.io to communicate to the client back and forth. What I did was, when I receive the server's update about the location, I would compare that to the location of the client (which was predicted, or more like comprehended on the client side) to check whether the difference was under 0.1 (or any number). If it was not, I would redirect the player back to location sent by the server. (there is still some minor jitter in the gameplay)
After doing the above, I felt it like a piece of cake. I felt on top of the world! But, I was still trying to figure out what people really meant by "hard".
So after bit of more research, I found out nengi.js, a game networking engine for node.js. I noticed people comparing socket.io and nengi.js. Aren't they two different things? socket.io is used for bidirectional communication between client and server, and nengi.js is a game networking engine! This has created a huge confusion in my head. Could anyone please help me with this?
Also, please clarify whether the process I did above for client prediction is correct or not?
If you need anymore details/info, please let me know!
Thanks a lot for reading through! Thanks in advance!