Game multiplayer

I am trying to create a multiplayer game where

  • For every 2 players the server will create 1 room (my game is PvP, one against one)
  • Each room handles the logic of the game.
  • I use Java.Util.Timeras my game loop
  • FPS server = 5
  • Each room will handle the movement of players and a little physics.

To the question:

Which game loop should I use in accordance with the paragraphs below? What are the pros or cons of each type of game cycle below.

  • Each room will have its own game cycle (timer)
  • All rooms are processed in one game cycle (timer)
  • The whole room is processed in one game cycle, but when the total number of rooms = 50, the server will create a new game cycle.

EDIT

What I have tried so far:

1, . , - Java.Util.Timer.

+4
2

, .

"" , , , 1v1.

"" , . , "" .

, , TCP/UDP-.

, , . ++, Java,

SFML

0

. , . kryonet, .

. ? ? UDP/TCP? ? ? ? ( , , .

, , , .

/- --- ----- > Room1
                           ...............................................--- → Room2 loop
     .............................................. ---- → Room3 loop

, fps, -, . fps.

, .

, , TCP- , , .

, , .

.

0

All Articles