AncientSwordRage / nWoD-db

Web app for creating new world of darkness characters and browsing character data (Mage spells, vampire disciplines merits, etc)
1 stars 0 forks source link

Create character model JSON structure #1

Open rozza2058 opened 9 years ago

rozza2058 commented 9 years ago

Initial idea with two possibilities for specialties and using the term "Level" for primary/secondary/tertiary:

{
    "PlayerId": 1,
    "Player": "Rory",
    "Character": "Roran",
    "Attributes": {
        "Physical": {
            "Level": 1,
            "Strength": 1,
            "Dexterity": 1,
            "Stamina": 1
        },
        "Mental": {
            "Level": 2,
            "Intelligence": 1,
            "Wits": 1,
            "Resolve": 1
        },
        "Social": {
            "Level": 3,
            "Presence": 1,
            "Manipulation": 1,
            "Composure": 1
        }
    },
    "Skills": {
        "Physical": {
            "Level": 1,
            "Athletics": {
                "Dots": 2,
                "Specialties": [
                    "Archery"
                ]
            }
        },
        "Mental": {
            "Level": 2
        },
        "Social": {
            "Level": 3
        },
        "Specialties": [{
            "Skill": "Athletics",
            "Specialty": "Archery"
        }]
    },
    "Merits": [{
        "Name": "Quick Draw",
        "Subset": "Firearms",
        "Dots": 1
    }],
    "Characteristics": {
        "Size": 5,
        "Defense": 1,
        "Stamina": 6,
        "Willpower": {
            "Max": 2,
            "Current": 2
        },
        "Energy_trait": {
            "Max": 10,
            "Current": 7
        },
        "Power_level": 1,
        "Morality": 7
    }
}
AncientSwordRage commented 9 years ago

It looks like this should motivate me to improve my models (create a characteristics model, add max/current etc).

As a side note I'd favour grouping the specialities with the skills as you do like so:

"Athletics": {
            "Dots": 2,
            "Specialties": [
                "Archery"
            ]
        }

As I should be able to easily pull all specialities out from my model and push them to a separate url.

Make sense?

rozza2058 commented 9 years ago

I agree. I initially went through it in my mind thinking "Attributes, Skills, Specialties" and then realised I could add them inline. Let's go with this format then.

AncientSwordRage commented 9 years ago

Agreed. Also I prefer for the 'levels' the term 'priority'. But I've entirely neglected them as they don't matter past character creation, right?

rozza2058 commented 9 years ago

Right, but character creation is a thing. I guess it doesn't need to be part of the model in the database, but it should be part of the form and the validation.

On Mon, Feb 2, 2015 at 4:33 PM, AncientSwordRage notifications@github.com wrote:

Agreed. Also I prefer for the 'levels' the term 'priority'. But I've entirely neglected them as they don't matter past character creation, right?

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/1#issuecomment-72488012 .

rozza2058 commented 9 years ago

Although if you want to persist your character creation session and come back to it, these details need to be stored with it to save you having to reselect them.

On Mon, Feb 2, 2015 at 4:49 PM, Rory Jennings rozza2058@gmail.com wrote:

Right, but character creation is a thing. I guess it doesn't need to be part of the model in the database, but it should be part of the form and the validation.

On Mon, Feb 2, 2015 at 4:33 PM, AncientSwordRage <notifications@github.com

wrote:

Agreed. Also I prefer for the 'levels' the term 'priority'. But I've entirely neglected them as they don't matter past character creation, right?

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/1#issuecomment-72488012 .

AncientSwordRage commented 9 years ago

I was going to leave it at having a publish function that validated (taking into account how different templates effect different attributes etc) that the attribute values follow the 5/4/3 pattern, skills follow the 11/7/3 etc. It makes it smoother to change during char-gen, and gives less info to store. Thoughts?

rozza2058 commented 9 years ago

So the publish would apply the template afterwards? Or the validation would take the template into account? Not a bad idea, but from a UX perspective, live client side validation is a very good thing. Also 11/7/4.

On Mon, Feb 2, 2015 at 4:54 PM, AncientSwordRage notifications@github.com wrote:

I was going to leave it at having a publish function that validated (taking into account how different templates effect different attributes etc) that the attribute values follow the 5/4/3 pattern, skills follow the 11/7/3 etc. It makes it smoother to change during char-gen, and gives less info to store. Thoughts?

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/1#issuecomment-72492140 .

AncientSwordRage commented 9 years ago

So the publish would block you from publishing characters 11/11/11 in skills (for example). Perhaps a tick box on the form saying 'Yes I know I have too many skills, publish anyway'. If your template gives a +1 to an attribute, then the publish method can check this and 'remove' that bonus before running the validator.

As for doing this on the front end I'm not sure what would be considered 'front end' as Django can show you validation warnings on the page.

AncientSwordRage commented 9 years ago

Although thinking of it the level/priority setting is valid for other 'traits' marking things such as arcana to be Ruling/Common/Inferior (1,2,3) or Disciplines in-clan/out of clan (1,2) so it might be worth adding in.

AncientSwordRage commented 9 years ago

rest_api promo

AncientSwordRage commented 9 years ago

@rozza2058 I currently have the following as my output. I'll summarize the the difference below

{
    id: 3,
    player: "admin",
    name: "gandalf",
    sub_race: "Foo",
    faction: "Foo",
    is_published: false,
    power_level: 1,
    energy_trait: 7,
    virtue: "prudence",
    vice: "lust",
    morality: 7,
    size: 5,
    arcana: {
        Prime: 0,
        Death: 0,
        Time: 0,
        Forces: 0,
        Spirit: 0,
        Life: 0,
        Space: 0,
        Mind: 0,
        Fate: 1,
        Matter: 0
    },
    mental_attributes: {
        Wits: 0,
        Resolve: 0,
        Intelligence: 1
    },
    physical_attributes: {
        Strength: 0,
        Dexterity: 0,
        Stamina: 0
    },
    social_attributes: {
        Manipulation: 0,
        Composure: 0,
        Presence: 0
    },
    mental_skills: {
        Politics: 0,
        Investigation: 0,
        Medicine: 0,
        Occult: 0,
        Science: 0,
        Computer: 0,
        Crafts: 0,
        Academics: 1
    },
    physical_skills: {
        Athletics: 0,
        Drive: 0,
        Firearms: 0,
        Stealth: 0,
        Weaponry: 0,
        Brawl: 0,
        Survival: 0,
        Larceny: 0
    },
    social_skills: {
        Socialize: 0,
        Intimidation: 0,
        Streetwise: 0,
        Subterfuge: 0,
        Persuasion: 0,
        Animal Ken: 0,
        Expression: 0,
        Empathy: 0
    }
}

There's no nesting, so all things like energy_trait are loose, and they don't show current vs maximum. Likewise Skills and Attributes are loose, but still grouped. This should be easy to correct. A few characteristics might be missing, but they can be added.

No support for merits currently. I'm unsure, for instance, you mean by "Subset": "Firearms", and how that is determined? I could add a 'merit' tag that would mean you could add tags like 'combat' or 'fighting style' but I'm not sure if that's needed.

Also, currently all skills are shown, even when they are at 0. Let me know if that's a problem.

rozza2058 commented 9 years ago

I think all skills is best. For merits, subset is a bad word. I meant things where you have to make a choice, like dots in an order you have to choose the order, or for quick draw you have to choose melee or firearms and can take one for each.

On Mon, Feb 16, 2015 at 2:13 PM, AncientSwordRage notifications@github.com wrote:

@rozza2058 https://github.com/rozza2058 I currently have the following as my output. I'll summarize the the difference below

{ id: 3, player: "admin", name: "gandalf", sub_race: "Foo", faction: "Foo", is_published: false, power_level: 1, energy_trait: 7, virtue: "prudence", vice: "lust", morality: 7, size: 5, arcana: { Prime: 0, Death: 0, Time: 0, Forces: 0, Spirit: 0, Life: 0, Space: 0, Mind: 0, Fate: 1, Matter: 0 }, mental_attributes: { Wits: 0, Resolve: 0, Intelligence: 1 }, physical_attributes: { Strength: 0, Dexterity: 0, Stamina: 0 }, social_attributes: { Manipulation: 0, Composure: 0, Presence: 0 }, mental_skills: { Politics: 0, Investigation: 0, Medicine: 0, Occult: 0, Science: 0, Computer: 0, Crafts: 0, Academics: 1 }, physical_skills: { Athletics: 0, Drive: 0, Firearms: 0, Stealth: 0, Weaponry: 0, Brawl: 0, Survival: 0, Larceny: 0 }, social_skills: { Socialize: 0, Intimidation: 0, Streetwise: 0, Subterfuge: 0, Persuasion: 0, Animal Ken: 0, Expression: 0, Empathy: 0 } }

There's no nesting, so all things like energy_trait are loose, and they don't show current vs maximum. Likewise Skills and Attributes are loose, but still grouped. This should be easy to correct. A few characteristics might be missing, but they can be added.

No support for merits currently. I'm unsure, for instance, you mean by "Subset": "Firearms", and how that is determined? I could add a 'merit' tag that would mean you could add tags like 'combat' or 'fighting style' but I'm not sure if that's needed.

Also, currently all skills are shown, even when they are at 0. Let me know if that's a problem.

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/1#issuecomment-74513664 .

AncientSwordRage commented 9 years ago

@rozza2058 :+1:

'choice' would be a good word, but it might be protected. I'll work something in.