Logic/design for storing achievments and progress for users


I have a game with a databse of users, I now want to implement unlockable achievments in my game. How would I best go about saving this data for each user? I am still fairly new to using a database.

Relevant info:

  • Each user in the users-table has an ID
  • There are 30+ achievments
  • Many achievments are longer processes, that require the ability to save the progress of that achievment for users, ex: Win 8 rounds in a row.
  • When the game is started it should load all finished/unfinished achievments as well as progress for each.

I don't even know where to start, any sort of help is appriciated.

Best Answer

I think it would be a good idea to create an 'Achievement' table with required condition to be unlock (ex:Win 8 rounds in a row) and an association table 'UserAchevement' to indicate users.the same To store every user progress (the number of Wining round for exemple) a 'Progress' table is needed.