I think about creating a multiplayer game with Libgdx.
Now i just want to ask which kind of data should handle the server and which kind should handle the client.
Basicly the game should be a 2D platform-shooter kind of game, where you can create your own levels/maps. So i think the map files should be placed in the server files, and sent to the client on connect. Is this right?
Later i think every client should handle its own movement (including collision detection) and send the current position (as Vector2) to the server. Again the question: Is this how it should work?
And one more thing:
If a client shoots, should he:
- Only send "I am shooting" and the server decides, which kind of bullet to shoot (depending on clients current weapon)
- Manage this himself and again send only the position of the bullet as
Vector2
(and the type of bullet) to the server
In case
The server would need to update the position of all bullets and manage their collision detection and then send the positions (and effects, if bullet hits someone/something) to both clients.
The client would handle the collision with walls and himself and send data to the server, which would send it to other client. Then the other client needs to check for collision with this bullet. So both clients need to check for collision with the bullets + one client checks bullets-wall collision.
Which way is better or is there an even cleaner solution?