I'm thinking about ways to manage destructible terrain (tiles/blocks) over a network in a multiplayer game. As players destroy or create blocks, these actions must be propagated to other players.
The way I'd originally approached this was to have the player make a change locally (a block is destroyed), notify the server, and have that sent to all clients (block is destroyed in their code). It's a fairly simple scenario but it's an example of how some management is needed. Player A destroys a block, player B also destroys the same block before the server has been notified (from A or B) and had a chance to let everyone know. The message from player A then gets to the server where some checking is performed (server has copy of blocks too, so it really manages actual state) and the message that the block was destroyed is sent out to everyone. The message from Player B (block destroyed) gets to the server next and the server rejects (it knows the block is already gone) and so sends back some form of rejection in a message. Player B accepts the fact that the block is gone, and it gets removed at their end. What I like about this model is that players will see their own changes (destruction/creation/damage) immediately, and then send data to the server for checking, and propagation.
Another approach I'd thought about was to send a message from Player A to the server to request a block is destroyed and if successful the server would notify all players (including A). While Player A had sent a request for block destruction to the server the block would not be destroyed locally until the server responded back. With this approach the main drawback is that local actions are not shown until the server responds which could cause a noticeable delay in local actions.
It seems to me that going with my initial approach is best. I'm just thinking this through so if there are any obvious problems, or better existing solutions/ideas/models please feel free to discuss, it'd be appreciated.