game: map packing/unpacking refactoring