1

I'm working on a personal project, and run across the following situation, and am not sure how to proceed. I am attempting to handle some cards from a board game (Gloomhaven, if you're familiar with it!) and am working on the Monster Groups in the game. Each monster group can have normal and elite versions of monsters, and occasionally a boss monster. Right now, my MonsterGroups table looks like this:

MonsterGroups
int ID
Varchar(250) Name
int MaxSize

I also have a table that will (hopefully) represent their combat statistics:

MonsterCombatStats
int ID
int MaxHealth
int Movement
int damage
int range
varchar(max) StaticAbilities

Since there can be multiple profiles for a monster, and these profiles always show up together, how should i represent the relationship between a MonsterGroup and their three possible profiles?

The best I could come up with is putting an identifier in the association table, telling me 1/2/3 which profile it is:

MonsterGroup_CombatStats
int ID
int MonsterGroupID
int MonsterCombatStatsID
int ProfileType

I'm concerned about hooking this into my database framework in the code, since it doesn't generally handle this sort of addition well. Any advice?

  • You have the correct way. As a Group may be Elite in one instance and Normal in another, the version is not an attribute of the group, but of the relationship between the group and the set of stats. Thus the version indicator should be in the table defining the relationship. – TommCatt Mar 4 '17 at 22:51
  • @TommCatt Lovely! I'll go ahead and convert your comment into an answer. I really appreciate it! – Adam Wells Mar 6 '17 at 15:48

Your Answer

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

Browse other questions tagged or ask your own question.