I would like to start developing my own game. Basically, the game has a "world" that players can travel around and modify. Think of it as a much more realistic version of Minecraft or an open world MMO.
I have thought of two possible ways of designing the server, both with problems.
The first is a single threaded design where one thread handles all the game mechanics and player interactions. The problem with this is that it cannot fully utilize a processor, and if one player does actions that cause lag, all players will experience that lag.
My next idea was that there is a separate thread for each player that renders the terrain around the player, handles physics, NPC interaction, etc. With this approach the CPU could be fully utilized and one player causing lag wouldn't affect others. However, the problem is keeping the different threads in sync. The entire server must be on the same "clock," (same day/night cycle, certain things take a certain amount of time, etc.), i.e., the different threads must be synchronized. However, this raises the problem that if one player's thread is lagging behind, the only way to synchronize the other threads would be to also cause them to lag, and this would eliminate one of the big advantages of a multithreaded game server, not to mention that keeping everything in sync can become extremely complicated.
So my question is, what would be the best way to design the game server using a multithreaded design where the server is kept in sync and one player causing lag won't affect others? Or is this even possible without dropping a significant amount of game ticks?