19 hours ago, Angelic Ice said:
Well, the issue is, if the player-object wants to move from field 2 to field 3, there will be an animation that transforms the position of the player-object. If a serialisation occurs during this progress, the player will be saved in-between.
I don't see any issue, tbh. Conceptually, a save+load is a no-op (well, that's how you code it usually at least). That is, after load, you should get the same situation as that you had if you never saved+loaded. I don't see how save affects player movement.
Right now, you have a way to move the player. You may keep the player in one grid, and at the end of a move assign it to the new grid, or you can continuously update its position, and it changes grid when it passes the border, or whatever.
save+load is a no-op, which means you restore to the exact same situation that you had when you pressed "save". If you move the player to the new grid at the end of the move, then the player is logically in the originating grid until the very end of the move. The destination grid is then empty until the moment that the move ends. That is what you want to happen after load too, since "load" acts asif the movement was never interrupted.
The fact that the display suggests that the player is in a different grid position than it logically is, is a display-trick in that case, fooling the user into believing a smooth move (which is fine). This is however following from your decision how you move your player, not from any save or load.
19 hours ago, Angelic Ice said:
Even worse: Imagine the playing stopping the game just briefly after saving has been successful, what would happen if the player wants to load this later?
I have no idea what worries you have here. When you press save, the game-state at that moment is saved, such that you can load it back to the exact same situation later. What happens after a save is not part of the saved game-state, and thus won't happen if you load that state again. It's no different then you're standing next to a gem, you press save, you pick up the gem, and you load the save. The gem is back on the floor and not in your inventory.
19 hours ago, Angelic Ice said:
I could of course say, once an object's centre passes the border to a new grid-slot, it will automatically moved to that slot within the vector/list/.. . Therefore, when adding objects from file to field, I would have to calculate, where each centre-point fits in.
How are you going to restore the exact same game state from that? It seems overly complicated to me.
Of course, technically, there is no need that save+load is a no-op. You could restore to an equivalent state instead, and continue from there. That however complicates matters since you then have multiple ways to express the same thing, which means all code has to deal with each way that may happen. That usually quickly explodes into toooo many options to deal with.
19 hours ago, Angelic Ice said:
This avoids having empty slots in the file, which is ideal,
Huh? All slots are always filled, except during a move?