Suppose you and another client wantedtwo players in a game want to build a city together on a blank tile-based game world simultaneously. via P2P You clickedsimultaneously in a peer-to-peer connected context.
When a player clicks on tiles and changed their 'state' ora tile ID. This changedit changes the respective valuestate (sor tile ID) onof that tile, which is saved into a text file which the renderer was responsible for later reading and interpretingby the worldrenderer.
Here you modify the 2,7,12,17 tiles. For example, in the image below a player has modified some tiles from "empty" (1) to "road" (2):

What would be the algorithm/approach to do this?
From what What method should I imagine so far it would be:
Client 1:
Select Tile 2,7,12,17 ID {01} from event listener.
Modify text file values 2,7,12,17 from {01} to {02}
Send Packets to other client of 2,7,12,17 modifications.
Check Incoming Packets.
Refresh Screen
Client 2:
[no change]
[nothing to modify yet]
[nothing to send]
Receive packet to change 2,7,12,17 from{01} to {02} Append file
Refresh Screen
Is this the Universal approachemploy to transmit these changes to connected peer-to-peer clients? Pardon my knowledge on game design, I was never taught it.
Also would an 2D Array be faster than a text file for storing ID values for the renderer?