0

I'm building a game in which a User does Activities, in each activity the player passes certain Areas, now after the game the player is awarded points for each area he passed through during an activity.

Therefor I assign a certain amount of points in the activity_area table.

What also happens is that the player can receive a points for a certain area of his at random moments, so points can be given for a certain area of that player without concerning an activity.

I created the user_area table to save the areas that a user owns (these are areas he has passed though during an activity). and the user_area_points table to save the random points received.

What I'm now worried about, is that 'points' are stored in two places, in the activity_area table and the user_area_points table.

Should this be further optimized?

enter image description here

1 Answer 1

1

No, there is no problem.

activity_area points are the attribute for the activity.

And the user_area_points points are an attribute to user_area.

i don't see why you put the pints into its own table, it is clearly an attribute to user_area

4
  • Well a user has many user_area, and a user_area can have many points awarded? Let's say that on monday and tuesday, points are awarded for a certain user_area, that would make two rows in the user_area_points table, since I can then look back and see when and how many points are awarded. Instead of having points on the user_area and incrementing it. does that make sense? May 9, 2021 at 10:27
  • the problem is that you don' gain more information if you have five rows with 1 point or 1 row with 5, as long you don't have more information to that points for an area, i don't see the use
    – nbk
    May 9, 2021 at 10:29
  • you could ave the loaction where you can got the points or the time, so every row would be different, but with points for every area, there is no need for multiple rows
    – nbk
    May 9, 2021 at 11:31
  • Ah I see what you mean, there is a timestamp in the real table, I omitted data that was irrelevant to the question, although now it seems that the created_at field is relevant. Thank you May 9, 2021 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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