Protocol Change is not Reflecting and Lag
The game is working fine in most of the cases but there is a problem which we are facing.
In our game we have a concept of tournaments which run with a lot of players in the room.
What is happening is when the number of players increases in the room like more than 200 , the game starts to show some lag on client side.
The messages which are coming from server are coming without any lag but the action which I send from client side to server side it is taking a lot of time to reach at the server.
I tried switching the protocol from TCP to UDP (by changing sendreliable to false in sendOperation() method) to see if it reduces the lag, but its not changing.
I have used Wireshark on the server side to check the protocol with which the packet is arriving and its still showing TCP.(Please check screenshot)
Also Wireshark shows a lot of messages being sent between client and server which i am not understanding like if I am sending only 10 messages from client to server then how it is showing that much packets on server side.
Please guide me on this, I am not sure how to debug and where to start debugging, but as far as I can think the lag is coming when Client is sending message to server , also is there a way I can check the following:
- Number of messages being sent from client to server or how many messages server is receiving in a second
- Size of each message that is sent to server
- is there a message queue on Client or Server(because if there is then maybe it is taking a lot of time to iterate over that queue)
- What is the optimal send and receiving rate in terms of number and size for client
I have put console in SDK file on client side in socket.onMessage() function and noticed a lot of messages coming to client. I could not understand them much but they are not those game messages which I have put in my Game. I have taken a screenshot of those and attached it. Maybe it will be of some help.
Also I have a video of the issue that I am facing if anyone is interested. I can share a clip of that too.
Thanks a lot!!!