= replay
:author: 
:revnumber: 
:revdate: 2016/03/17 20:48
:relfileprefix: ../../../
:imagesdir: ../../..
ifdef::env-github,env-browser[:outfilesuffix: .adoc]



== Replay (Save/Load) & Memento

Read first:

link:http://sourcemaking.com/design_patterns/memento[http://sourcemaking.com/design_patterns/memento]

link:http://www.gamasutra.com/view/feature/2029/developing_your_own_replay_system.php[http://www.gamasutra.com/view/feature/2029/developing_your_own_replay_system.php]

This implement the Memento pattern which represent a view of neccessary imformations need (also call internal state) for later decision and observasion like in AI or replay.

For optimization purpose it's normally not a full view, it just save the differences compare to its previous state 
Also note that the context (Originator) in the Memento pattern here is the GamePlay. So any info from StageLevel or Network level, even physics… is unknown! 

In GamePlay level, available information is valids Input and Actions, etc..

In this RTS game, GameState contains the current Map object, Units object, the Player objects, the AI object and the time since the game started, in milliseconds…

This is the distinct difference between Atom's Replay version and others implementation.
