Jump to content

Rating System


unemployment

Recommended Posts

I'm making a game where you earn points and lose points based on the actions that you take and the actions that your opponents take.  What's the best way to create this system.  Should I use mysql to store all the data and if so, should I set up the actions in a seperate table or should I just join the actions from all of my other tables.  I'm not quite sure what the best method is.

Link to comment
Share on other sites

There is no way for us to really give you any good advice. There are a multitude of variables that would affect "how" you should set up your database. Besides, this is the PHP Coding forum - not the database forum.

 

Some things that would dictate the appropriate methods:

Do specific actions have specific points assigned? Are the points for the actions variable? If so, on what basis are they variable.

 

You will need to give a complete overview of how the point system works to get any useful information.

Link to comment
Share on other sites

Essential here is a sample system.

 

Points gain for tasks done -

 

Personal Profile completion = 200 points

Created or joined a verified company profile = 200 points

Having a company video = 50 points

Blog Post = 50 Points

Number of friends = 20 points each

Number of votes submitted = 5 points each

Number of fans your company receives = 10 points each

 

Twitter shares for blog post = 1 points

Facebook shares for blog post = 1 points

Google plus 1 for blog post = 1 points

 

It would kind of cool if this could be dynamic... If one user has 20500 point and one has 100 points and I become friends with both of themI don't want to be given the same 20 point gain.  I should be given more points for the person that has more points because they are a more valuable contact. 

 

Any thoughts on how to be code this out?

 

Some of this will be static and some of it will be dynamic.

Link to comment
Share on other sites

It would kind of cool if this could be dynamic... If one user has 20500 point and one has 100 points and I become friends with both of themI don't want to be given the same 20 point gain.  I should be given more points for the person that has more points because they are a more valuable contact. 

 

Huh? Where in your requirements does it state that the points for friends will be dynamic based upon their points. Your requirements state that the points for friends is 20 points each.

 

That issue aside, looking at some of the "tasks" I would assume some of them will be tracked via existing DB records (friends, votes, blogs, etc.) I would think those tasks could be programmatically determined by the tables for friends, votes, blogs, etc. For other "tasks", if they are not tracked via existing records, you would need to add a separate table (or tables) to track those tasks.

 

Calculating the points based upon fixed points to tasks is fairly stritforward - add up the tasks and multiple by the points. But, this concept of variable points for a friend will need serious analysis. For example, if I become friends with "Bob" and my points for that friendship are supposed to be variable based upon how "valuable" Bob is, are the points fixed based upon how popular Bob is at the time the friendship is made. Or, do my points for that friendship change as Bobs "value" changes.

 

The former would be fairly straitforward. At the time the friendship is made calculate how many points to assign and create a record for that relationship and the points awarded. If you want to go with the latter it will get fairly complex. In fact, it could lead to circular references if my points are partially determined by my friends' values and their values are determined by their points - which are in turn partially derived from their friends values, etc.

Link to comment
Share on other sites

Well yes, the points for friends would be dynamic not necessarily 20 points.  So the more points my friends earn, over time, not at the point of befriending, the more points I will earn.  So this will be a completely live system.  That's where the complexity builds in.  I'm not sure how to work that out.

Link to comment
Share on other sites

Well yes, the points for friends would be dynamic not necessarily 20 points.  So the more points my friends earn, over time, not at the point of befriending, the more points I will earn.  So this will be a completely live system.  That's where the complexity builds in.  I'm not sure how to work that out.

 

Neither do i, because as I said it will cause a circular reference and cannot be done. Take the following scenario:

 

Alan is friends with Bob, Bob is friends with Chris, and Chris is friends with Alan.

 

To Alan's score you have to calculate the points based upon his friendship with Bob (which will be based upon Bob's score). But, to determine Bob's score you first have to calculate the points he will get based upon his friendship with Chris - which required you to calculate Chris's score. To determine Chris's score you have to determine how many points he gets for his friendship to Alan. And THAT requires you to calculate Alan's score which is what you started out trying to determine.

 

The model you are proposing is not possible. You can have a variable scoring model, but you need to come up with something that can be done. As I said, you can do this IF you only calculate the "friendship" score only at the time the friendship is made. But, if the friendship score is to be variable in real-time it just won't work.

Link to comment
Share on other sites

Well yes, the points for friends would be dynamic not necessarily 20 points.  So the more points my friends earn, over time, not at the point of befriending, the more points I will earn.  So this will be a completely live system.  That's where the complexity builds in.  I'm not sure how to work that out.

 

Neither do i, because as I said it will cause a circular reference and cannot be done. Take the following scenario:

 

Alan is friends with Bob, Bob is friends with Chris, and Chris is friends with Alan.

 

To Alan's score you have to calculate the points based upon his friendship with Bob (which will be based upon Bob's score). But, to determine Bob's score you first have to calculate the points he will get based upon his friendship with Chris - which required you to calculate Chris's score. To determine Chris's score you have to determine how many points he gets for his friendship to Alan. And THAT requires you to calculate Alan's score which is what you started out trying to determine.

 

The model you are proposing is not possible. You can have a variable scoring model, but you need to come up with something that can be done. As I said, you can do this IF you only calculate the "friendship" score only at the time the friendship is made. But, if the friendship score is to be variable in real-time it just won't work.

 

Hmm that really sucks.  I see your point.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.