#use hash map for the pixel management for efficency

3 messages · Page 1 of 1 (latest)

glass bolt
#

pixel_map = {
(10, 20): {"color": "red", "owner": "player1", "timestamp": 1672508400},
(15, 25): {"color": "blue", "owner": "player2", "timestamp": 1672508500}
}

#

If every pixel in a massive grid is stored individually, memory consumption could become an issue. Consider sparse storage (only store non-default pixels) to optimize memory.

#

and just add make sure 2 threads cant acess the same pixle data at the same time