GNU Backgammon uses the Smart Game Format (SGF) to store games, matches, sessions and positions. SGF is used in as a standard format for several other turn based games. The SGF files can store all the rolls and moves and cube decisions as well as commentary and analysis.
A game that uses SGF extensively is Go. The format is described at this site.