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.

1 Answer 1


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.

  • Thanks, so in "UserAchievment" table I would just store userID and if the achievment is unlocked or not (one column for each achievment)? Then in the progress table I would store the userID and the progress of each achievment for a user (one column for each achievment)?
    – Green_qaue
    Commented Apr 18, 2016 at 15:20
  • Is there any way you could add an example for the colums/rows in your answer? would help me understand what you mean
    – Green_qaue
    Commented Apr 18, 2016 at 15:25
  • 'UserAchievment' store only user whom unlock an achievment. if in the progress table a user for exemple win 8 rounds then a row would be insert into 'UserAchievment' (USER_ID,Achievment_ID, and other attribute). and obvously in every win u will or the app will verfy the 'progress' table to identify if user has win 8 rounds to insert the achevement into 'UserAchievment' table.
    – Yassine LD
    Commented Apr 18, 2016 at 15:34
  • Thanks, so that means that if I have 30 achievments, each user will create 30 rows both in 'progress' and 'UserAchievment', is that okay? That can create two pretty big tables if I get many users.
    – Green_qaue
    Commented Apr 18, 2016 at 15:56
  • not exactly, a user will create 1 row in "UserAchievment" if the user progress is complete for example : in the 'progress' table user x has win 7 round until now there is no achievment and thus no row is inserted into "UserAchievment" but when for exemple in progress table we have 'Round = 8' here a row will be insert into '"UserAchievment" ' and yes two pretty big tables indeed
    – Yassine LD
    Commented Apr 18, 2016 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.