Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character model #6

Open
jtkaufman737 opened this issue Nov 7, 2018 · 5 comments
Open

Character model #6

jtkaufman737 opened this issue Nov 7, 2018 · 5 comments
Labels

Comments

@jtkaufman737
Copy link
Collaborator

jtkaufman737 commented Nov 7, 2018

Things that need to be persistent/universal I'm trying to include, things that aren't/don't I'm trying to leave to the frontend logic. There's some grays areas in that though so chime in.

  • character id: unique UUID field
  • user ID: FK UUID string
  • name: varchar
  • abilities: I can't tell if this, and the other random stuff like equipment, might be easier dealt with by sticking them in a normalized table where the different attributes could be grabbed. That would look sort of like the attached image, where the data would be collected through the mechanism of the pointer ID for the character (in this case, we'd grab the appropriate record under 6 for that character, and look up the values we need ad hoc)
    screen shot 2018-11-06 at 8 33 25 pm
    We could have a trigger on character creation that would create those records from random values and insert them into the normalized table. Or, it could I guess be a frontend function to randomize abilities and just write to the db through a POST.
  • languages: not sure what the most appropriate thing here is. May also be a candidate for normalized table
  • equipment: same deal, this will be multiple things and isn't well suited to a character table I don't think. Its going to change and have varying numbers of values throughout game play

The alternative I guess to dumping them in normalized tables or one big normalized table would be just having smaller other tables for each of these things - abilities - equipment - etc and dealing with it through joins as it comes up. (Although may be six in one, half dozen in another - both kind of get at the same point).

A SECOND alternative mentioned is that abilities may be an exception - they are going to be pretty universal to characters so maybe including them as additional columns is fair game. But maybe not the other stuff

@jtkaufman737 jtkaufman737 changed the title Character model (strap in) Character model Nov 7, 2018
@angelocordon
Copy link
Contributor

Just a bit of brain dump here:

character: {
  name: String,

  # to reference back to a User
  user_id: Int, 

  # I think `stats` and `abilities` are the same thing in this context, though we should 
  # settle on verbiage early on
  stats: { ... },

  # similar to `inventory` or `equipment`
  inventory: []
}

re: Abilities: I think abilities are more like skillsets, like spells or other things - not sure if that's something we want to implement (cc: @tyberious-1 )

re: Inventory: I feel that inventory should be the stuff that a character is carrying and equipment or item are the singular things that's in an inventory. Thoughts here?

I like the idea that the Inventory should be a separate table + model. Any cons to this you think? I'm just trying to think of when we load up a character, how big are these query calls going to get...?

@jtkaufman737
Copy link
Collaborator Author

Yeah, I can see that - we could have an inventory model and then maybe a bool for "currently equipped?"

@jtkaufman737
Copy link
Collaborator Author

So that is the long and short: I guess I either see us splitting a lot of this stuff out from character into different tables linked on Character ID with a one to many relationship, or lumping them into a flat(ish) data structure that could be dealt with uniformly (the normalized option). I'm ok with either.
That leads to an interesting question, I had originally pictured money as part of the character model - but it is closely functionally linked to the equipment obviously.

@angelocordon
Copy link
Contributor

angelocordon commented Nov 11, 2018

I think this is really great and there's some long term thinking here that we might not be ready to cross just yet. What do you think we'll need / should nail down from the super early release perspective? I think for me it may be just:

character: {
  name: String,
  role: String, default: 'fighter',
  race: String, default: 'human',
  user_id: Int, 
  stats: { ... }
}

I'd be open to getting stats nailed down but I'm not sure what that entails from the rule book perspective. Thoughts?

PS:
If we're going to nail down stats - maybe think about how we define the values or does everybody have a default baseline?

@angelocordon
Copy link
Contributor

PPS:
Also loved the money idea - there's so much we can do there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants