Let's say we have a 2d map 500*500 tiles in size. And each tile is editable by players and has many states. So it's 250k tiles. The game is multiplayer online game.

What would be the best approach from a server database perspective? Store each tile as an object in db with coordinates? Or store them in chunks? Or any other way?

  • \$\begingroup\$ Why not store initial map seed and basically data that it was "randomly" generated with(instead of whole world each block), and also store only edited blocks? Like DB = { creationSeed: 123111, editedBlocks: {(0;1) = 1, (0;7) = 2, (123213123, 87336737) = 0... and so on ? \$\endgroup\$
    – Nick
    Commented Mar 26, 2020 at 7:37
  • \$\begingroup\$ Yes, storing only edited blocks is a better idea \$\endgroup\$
    – lxknvlk
    Commented Mar 26, 2020 at 10:08
  • \$\begingroup\$ Ask yourself this: will a player's game client ever ask the server about just one tile, at random, without wanting to know about the whole chunk it belongs to? \$\endgroup\$
    – DMGregory
    Commented Mar 26, 2020 at 10:50


You must log in to answer this question.

Browse other questions tagged .