Modeling Turn-based Games
2 posters
Page 1 of 1
Modeling Turn-based Games
I am trying to model a game in which 2 players take turn to play. Each turn generates turn specific facts. As part of the requirements we need the game duration as well. I know I would need a fact table at the grain of each turn with facts corresponding to each turn. Now, what is a good way to model for game duration. I was thinking of having another fact table at the grain of the game with start and end date/time which I could use to get the duration. If I do that, should I have 2 rows per game (one for each player). If I do that duration would be doubled unless I divide it by 2 :). Or I can have one row per game which I would then lose user data.
arowshan- Posts : 23
Join date : 2011-10-18
Location : Vancouver, Canada
Re: Modeling Turn-based Games
Game is a dimension. Each turn record would reference the gameID for that specific game. Game duration would be max(turnDate) - min(turnDate) grouping by the gameid.
TheNJDevil- Posts : 68
Join date : 2011-03-01
Re: Modeling Turn-based Games
I understand that I can do that in SQL. I am trying to come up with a model that is easy to work with in OLAP engine like SSAS. I actually realized that I need turn duration as well. Here is the sequence of events that happen:
Game Starts
Player 1 starts his turn by spinning the wheel with 4 reels and ends up with 4 cards (like a slot machine)
Each card then gets applied and could have affects on each player such as health and gold
Player 2 spins the wheel
...
When one of player's health goes down to zero game ends
So, in terms of lowest level of granularity, it would be the event when each card is applied for each user, card, turn#, Game# and date/time. The question is, is it best to incorporate turn duration and ultimately game duration in this fact table. If so, I think I would have to maybe write MDX calculations in SSAS to come up with durations which I can't really think of off top of my head.
Game Starts
Player 1 starts his turn by spinning the wheel with 4 reels and ends up with 4 cards (like a slot machine)
Each card then gets applied and could have affects on each player such as health and gold
Player 2 spins the wheel
...
When one of player's health goes down to zero game ends
So, in terms of lowest level of granularity, it would be the event when each card is applied for each user, card, turn#, Game# and date/time. The question is, is it best to incorporate turn duration and ultimately game duration in this fact table. If so, I think I would have to maybe write MDX calculations in SSAS to come up with durations which I can't really think of off top of my head.
arowshan- Posts : 23
Join date : 2011-10-18
Location : Vancouver, Canada
Similar topics
» Modeling of dimensions based on location
» Data model for Reporting needs - Event based or fact based
» A design based on junk dimension
» MDX(or something else) for getting history based on last dimension characteristic for SCD.
» Range based dimension
» Data model for Reporting needs - Event based or fact based
» A design based on junk dimension
» MDX(or something else) for getting history based on last dimension characteristic for SCD.
» Range based dimension
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum