I'm currently building my own game using LIBGdx in JAVA but i'm facing some trouble. My game is base like this :
A player have a position and some other parameters that are float, int types. He also have a class name Launcher that contains 3 array list and every update of my game it sends way to much datas and it's making the game very laggy.
How my system work :
Serveur launch and is waiting for connection in another thread. Meanwhile the main thread of the server is updating the map. Suddenly a player connect to the server, it add a new PlayerGestion inside the server which allows me to receive update from this single player. Meanwhile the server keeps updating the maps with the players datas. My problem is that after every map update, when the server send datas to every players, it sends heavy datas that is the arraylist of players (containing the datas i listed below). So my question, is :
Is the way i'm doing a client / server good ?
Is the writeObject method good to use in a server / client
Is it possible to do an online by sending only the x / y players position ?
I'll be able to answer more question if you need to and show some line of code if it can help you help me.