Data

Discussion in 'Wiki Additions' started by Locke, Apr 16, 2015.

  1. Locke

    City Guard
    Wiki Editor

    Messages:
    59
    Likes Received:
    32
    I started working on some data infrastructure. Goals are (in order):
    1. Eliminate duplication of data so it only needs to be updated in one place when it changes in-game.
    2. Accessible and easy to modify by anyone, even without lua, template, or even MW experience.
    3. Common look-and-feel for all data listings throughout the wiki
    I put some WIP test cases and examples specific to skills here: http://tria.tv/wiki/Template:Skill/testcases

    Specifically, "Inline", "Full", and "Get" are actual use-cases (anywhere, on the class page, and on the skill page, respectively). What other use-cases are there? Where else would we need to display data about skills?

    Looking at "Full", I obviously didn't do much css work yet. That's really not my forte, so if someone else could tinker with that it'll turn out better. The code for that is in http://tria.tv/wiki/Module:Skill in "function p.full( frame )". What other information needs to be there? Type (active/passive/action), level/skillbook requirement, cooldown/sp cost, video... Any advice is welcome at this point. Or if it's gone in a completely wrong direction, I'd like to know now before I go any further.

    All the data on that page is scraped from here: http://tria.tv/wiki/Heaven's_Light/data. Is that easy enough to understand and update? I'll write a Help article when it's finished, which will explain things like how the <parameters> and |pipes| work.

    Once we're all satisfied with Skills and the Data system itself, it can be expanded for use with Monsters, Equipment, etc. Since it'd end up being so prevalent, I want to make sure everyone's on board first.
     
    EllieKK, Nic, Zelkova and 1 other person like this.
  2. Zelkova

    Royal Warden
    Administrator

    Ironclad

    Messages:
    1,596
    Likes Received:
    635
    IGN:
    Shugo
    Level:
    30
    Job:
    I understand it pretty well. I've been waiting to start uploading skill icons, I have ones that were ripped from the game rather than screenshots.

    [​IMG]
     
  3. Locke

    City Guard
    Wiki Editor

    Messages:
    59
    Likes Received:
    32
    Do you have the class icons too?

    I've been considering an alternative. Instead of using a subpage of the main article, we could subpage Module:Data, and use an actual lua table.

    e.g. Heal/data:
    Code:
    class = Priest
    weapon = Scepter
    type = Active
    video = {{Video|heal|320|200}}
    level = 15
    description = Heals the player and nearby allies.
    details = Use <sp> SP to heal the HP of yourself and <targets> allies within a 3m radius using <regen>% of your magic attack.
    tableheadings = SP|HP Regen|Additional Targets
    tablerows = <sp>|<regen>%|<targets>
    max = 5
    sp = 15|15|13|13|10
    regen = 150|165|180|195|225
    targets = 3|3|4|4|5
    crystalshards = -|?|15|25|50
    redcrystals = -|-|3|5|10
    chaoscrystals = -|-|-|-|1
    Module:Data/Heal:
    Code:
    return {
        class = "Priest",
        weapon = "Scepter",
        type = "Active",
        video = "heal",
        level = 15,
        description = "Heals the player and nearby allies.",
        details = "Use <sp> SP to heal the HP of yourself and <targets> allies within a 3m radius using <regen>% of your magic attack.",
        columns = {
            { heading = "SP", row = "<sp>" },
            { heading = "HP Regen", row = "<regen>%" },
            { heading = "Additional Targets", row = "<targets>" }
        }
        perlevel = {
            max = 5,
            sp = { 15, 15, 13, 13, 10 },
            regen = { 150, 165, 180, 195, 225 },
            targets = { 3, 3, 4, 4, 5 },
            crystalshards = { "-", "?", 15, 25, 50 },
            redcrystals = { "-", "-", 3, 5, 10 },
            chaoscrystals = {  "-", "-", "-", "-", 1 }
        }
    }
    benefits:
    -much easier to code. less parsing.
    -can import modules directly instead of relying on transclusion. this is faster, and much simpler in cases where more than one data source is needed. (e.g. Skill needs the class icon, which would be in the Class data.)
    -generally more flexible and robust

    drawbacks:
    -I think it's slightly less user-friendly, since it enforces lua syntax. Users will definitely be turned away by anything that looks like code.
    -can't use templates (e.g. the video tag will have to be constructed in Module:Skill, instead of using {{Video}} -- in fact, I think even extension tags like that can't be used.)
    -if you ever decide to protect the Module namespace, then that would limit who can update the data.

    I'm leaning toward keeping it as-is.
     
    Zelkova likes this.
  4. Zelkova

    Royal Warden
    Administrator

    Ironclad

    Messages:
    1,596
    Likes Received:
    635
    IGN:
    Shugo
    Level:
    30
    Job:
    I'm good with either way personally. I do agree that if it looks the slightest bit like "coding" that it will be a turn off to newer wiki editors. That and the loss of extension tags kind if is a lose/lose in my book.
     
  5. Zelkova

    Royal Warden
    Administrator

    Ironclad

    Messages:
    1,596
    Likes Received:
    635
    IGN:
    Shugo
    Level:
    30
    Job:
    Are we ready to start building skill pages?
     
  6. Locke

    City Guard
    Wiki Editor

    Messages:
    59
    Likes Received:
    32
    Yeah I think so. The css just needs to be moved over to Common.css and improved.
     
  7. Locke

    City Guard
    Wiki Editor

    Messages:
    59
    Likes Received:
    32
    Common.css is protected so I can't edit it. Something like this should do, then these can be removed from the modules. Feel free to make improvements, also pick colors for active/passive/action.

    Code:
    .databox {
        width: 800px;
        border: 1px solid #aaa;
        background-color: #f8f8f8;
        padding: 3px;
    }
    .databox-header {
        overflow: hidden;
        width: 100%;
        background-color: #2f3b49;
        color: #fff;
    }
    .databox-header a {
        color: #fff;
    }
    .databox-header > div {
        float: left;
    }
    .databox-header .databox-title {
        font-size: 30px;
    }
    .databox-header .databox-title small:before {
        content: "(";
    }
    .databox-header .databox-title small:after {
        content: ")";
    }
    .databox-header .icon, .databox .databox-header .right {
        margin: 2px 5px;
    }
    .databox-header .right {
        float: right;
        text-align: right;
    }
    .databox-img {
        float: right;
    }
    .databox-extra {
        background-color: #c5e7ff;
        padding: 3px;
    }
    
    /*
    .databox.skill-active .databox-header {
        background-color: ;
    }
    .databox.skill-passive .databox-header {
        background-color: ;
    }
    .databox.skill-action .databox-header {
        background-color: ;
    }
    */
    
    .skill-inline img {
        max-height: 30px;
        width: auto;
    }
    
     
  8. Zelkova

    Royal Warden
    Administrator

    Ironclad

    Messages:
    1,596
    Likes Received:
    635
    IGN:
    Shugo
    Level:
    30
    Job:
    Updated common.css

    Would you mind showing me a page that has fully implemented your modules etc for skills?
     
  9. Locke

    City Guard
    Wiki Editor

    Messages:
    59
    Likes Received:
    32
    on class page: http://tria.tv/wiki/Priest
    on skill page (just threw it together): http://tria.tv/wiki/Heaven's_Light

    looking at them all together on the class page, I came up with some margin adjustments:
    in ".databox":
    Code:
    margin: 1em 0;
    in ".databox-header > div":
    Code:
    margin-left: 5px;
    in ".databox-header .icon, .databox .databox-header .right" replace margin with:
    Code:
    margin-top: 2px;
    margin-bottom: 2px;
    in ".databox-header .right":
    Code:
    margin-right: 5px;
    and add:
    Code:
    .databox-header .icon img {
        max-height: 44px;
        width: auto;
    }
     
  10. Zelkova

    Royal Warden
    Administrator

    Ironclad

    Messages:
    1,596
    Likes Received:
    635
    IGN:
    Shugo
    Level:
    30
    Job:
    HOLY SHIT I LOVE THE SKILL BOXES!

    CSS adjustments have been made.
     

Share This Page

Loading...