python - Possible Data Schemes for Achievements on Google App Engine -


I am creating a flash game website using Google App Engine. I am making achievements on this, and it is scratched on my head how to store this data. I have a (non-google) user model. I should know how to store each kind of achievement (name, description, picture) as well as linking them with the users who earn them. Also, I need to keep an eye on him, when he has earned it, as well as his present progress for those who have not yet.

If someone wants to suggest tips about other work experience related to achievement or other achievements.

Edit:

Non-Google User Model:

  Class BeardUser (db.Model): Email = Db.StringProperty () user name = db.StringProperty () password = db.StringProperty () settings = db.ReferenceProperty (UserSettings) is_admin = db.BooleanProperty () user_role = db.StringProperty (default = "user") datetime = db Unless your users are dynamically adding achievements (such as / in some cases like Konggate where users can upload their own games), you will find available The list will be static, meaning that you can store a list (name, description, photo) in your main dragon file, or as an achievement module, or something else, in the name of the name or id you specified in your dynamic data You can refer to achievements on the basis of. 

To indicate whether a given user has found an achievement, the simplest way is to add the ListProperty to its player model will fulfill the player's achievements. By default this will be indexed so that you can query which players have achieved achievements etc.

If you want to store the date / time of the user as well, then we are in an area where the underlying qualities are less ideal. You can add another list property along with the date list properties according to each achievement, but it is weird: What we really like, is a tupal or a decree, so that we have achieved the achievement ID / name over time And make it easy to add additional properties related to each achievement in the future.

My usual approach to such cases is to dump my ideal data structure in BlobProperty, but there are some disadvantages in it and you may like a different approach

One And the way that there are different achievement models from your user model, and a list of fans filled with contextual properties for all achievements received by the user. The benefit of this is to give you a very good indicator, but there will be an additional API CPU cost at runtime, especially if you have to see a lot of achievements, and work like deleting all user achievements compared to the above will be very expensive.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -