HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
11.97k stars 4.09k forks source link

Split out mechanical and fluff descriptions of gear #2028

Closed SabreCat closed 7 years ago

SabreCat commented 10 years ago

At the moment, there's just one description field for each equippable item, which includes both the RPGish fun description and the annotation of what it does to your stats. This is great in the Rewards shop and the Gear portion of your inventory, but it's weird and misleading in the Costume area.

Costume popovers should only display the fluff text, not the attribute bonuses. We'd need to change up the content.coffee data structure a bit.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

quin-jay commented 10 years ago

Can we do a paragraph break in the tooltip? If we separate them such that you only see the attribute bonuses in the Equip section and the fluff descriptions only in the Costume section, then a large subset of users will never see the fluff descriptions, and I think they'd be missing out on some fun :3

hwrdtm commented 9 years ago

I'd like to try and fix this up a bit (I'm a newbie programmer so it might take some time)!

So I take it that ideally there should be both fluff and attribute descriptions in Gear & Rewards, and just fluff in the Costume section.

I was thinking of a really easy fix which would just be to add another complete set of descriptions for all the gear in gear.json in /locales/en/ without the attribute stuff but that doesn't seem efficient.

Alternatively, I could write something in content.coffee to just print the description up until the penultimate full stop (the last sentence is always either "Increases....." or "Confers.....") for the Costume section.

Does my suggestion seem like a possible / doable fix?

Alys commented 9 years ago

@howard611 "Increases....." or "Confers....." isn't always the final sentence. For example, the Limited Edition gear (e.g., the current spring gear) has another sentence at the end, as does the Mystery gear. Those sentences must appear in the Costume area. A regex that removes the Increases|Confers sentence should be possible, if we want that to be done.

Adding another complete set of descriptions, or breaking up the current descriptions into two sets is not an easy fix because it would require all the translations to be redone for all the languages - a huge body of work.

Alys commented 9 years ago

@lemoness Would you like this change to be made? On the Costume side of the Equipment page, the item descriptions would no longer contain the sentence that shows what stats they give. For example, for the Fireproof Helm, the description would change from this: "Fire? HAH! You squeak fiercely in the face of fire! Increases Perception by 9. Limited Edition 2015 Spring Gear." to this: "Fire? HAH! You squeak fiercely in the face of fire! Limited Edition 2015 Spring Gear."

There would be no changes to how future descriptions are added, and no re-translations would need to be done.

lemoness commented 9 years ago

Yes, I like that!

On Mon, Mar 23, 2015 at 1:20 AM, Alys notifications@github.com wrote:

@lemoness https://github.com/lemoness Would you like this change to be made? On the Costume side of the Equipment page, the item descriptions would no longer contain the sentence that shows what stats they give. For example, for the Fireproof Helm, the description would change from this: "Fire? HAH! You squeak fiercely in the face of fire! Increases Perception by 9. Limited Edition 2015 Spring Gear." to this: "Fire? HAH! You squeak fiercely in the face of fire! Limited Edition 2015 Spring Gear."

There would be no changes to how future descriptions are added, and no re-translations would need to be done.

— Reply to this email directly or view it on GitHub https://github.com/HabitRPG/habitrpg/issues/2028#issuecomment-84880793.

Alys commented 9 years ago

@howard611 If you'd still like to do this, please do! If you have any questions or run into problems, you're welcome to ask here.

hwrdtm commented 9 years ago

@Alys Alright, thanks! I'll work on it now :D

hwrdtm commented 9 years ago

Hey @Alys, I've managed to write out the first version of the code for querying the equipment descriptions. Here is the link to the repo and everything important is under the script tag in the html:

https://github.com/howard611/regex-test

I also have 2 things to ask you:

  1. For the "Increases....." statement, it's going to be printing digits instead of the < > tag before the full stop, so I really should be querying digits instead of the actual ending > tag in the regex, right?
  2. Where should I be injecting the script into? I was thinking of either /website/views/options/inventory/inventory.jade or into /common/script/content.coffee

If I were to inject it into content.coffee, won't I have to duplicate each equipment's text & notes, query it, then access the filtered text from inventory.jade?

Alys commented 9 years ago

@howard611 :

  1. Correct. Note that some gear can increase two stats. The easiest way to find examples is to hover over the equipment you own. If you don't own much, you can use the json data below, taken from my account - add it to a test user in your local database and that user will have almost all the equipment it's possible to have. I think I'm missing some small hammer or something, but that's not important.
  2. inventory.jade would be best.
        "gear": {
            "costume": {
            },
            "equipped": {
            },
            "owned": {
                "armor_healer_1": true,
                "armor_healer_2": true,
                "armor_healer_3": true,
                "armor_healer_4": true,
                "armor_healer_5": true,
                "armor_mystery_201402": true,
                "armor_mystery_201403": true,
                "armor_mystery_201405": true,
                "armor_mystery_201406": true,
                "armor_mystery_201407": true,
                "armor_mystery_201408": true,
                "armor_mystery_201409": true,
                "armor_rogue_1": true,
                "armor_rogue_2": true,
                "armor_rogue_3": true,
                "armor_rogue_4": true,
                "armor_rogue_5": true,
                "armor_special_0": true,
                "armor_special_1": true,
                "armor_special_birthday": true,
                "armor_special_candycane": true,
                "armor_special_fallHealer": true,
                "armor_special_fallMage": true,
                "armor_special_fallRogue": true,
                "armor_special_fallWarrior": true,
                "armor_special_gaymerx": true,
                "armor_special_ski": true,
                "armor_special_snowflake": true,
                "armor_special_springHealer": true,
                "armor_special_springMage": true,
                "armor_special_springRogue": true,
                "armor_special_springWarrior": true,
                "armor_special_summerHealer": true,
                "armor_special_summerMage": true,
                "armor_special_summerRogue": true,
                "armor_special_summerWarrior": true,
                "armor_special_yeti": true,
                "armor_warrior_1": true,
                "armor_warrior_2": true,
                "armor_warrior_3": true,
                "armor_warrior_4": true,
                "armor_warrior_5": true,
                "armor_wizard_1": true,
                "armor_wizard_2": true,
                "armor_wizard_3": true,
                "armor_wizard_4": true,
                "armor_wizard_5": true,
                "back_mystery_201402": true,
                "back_mystery_201404": true,
                "back_special_wondercon_black": true,
                "back_special_wondercon_red": true,
                "body_special_summerHealer": true,
                "body_special_summerMage": true,
                "body_special_wondercon_black": true,
                "body_special_wondercon_gold": true,
                "body_special_wondercon_red": true,
                "headAccessory_mystery_201403": true,
                "headAccessory_mystery_201404": true,
                "headAccessory_mystery_201409": true,
                "headAccessory_special_springHealer": true,
                "headAccessory_special_springMage": true,
                "headAccessory_special_springRogue": true,
                "headAccessory_special_springWarrior": true,
                "head_healer_1": true,
                "head_healer_2": true,
                "head_healer_3": true,
                "head_healer_4": true,
                "head_healer_5": true,
                "head_mystery_201402": true,
                "head_mystery_201405": true,
                "head_mystery_201406": true,
                "head_mystery_201407": true,
                "head_mystery_201408": true,
                "head_rogue_1": true,
                "head_rogue_2": true,
                "head_rogue_3": true,
                "head_rogue_4": true,
                "head_rogue_5": true,
                "head_special_0": true,
                "head_special_1": true,
                "head_special_2": true,
                "head_special_candycane": true,
                "head_special_fallHealer": true,
                "head_special_fallMage": true,
                "head_special_fallRogue": true,
                "head_special_fallWarrior": true,
                "head_special_gaymerx": true,
                "head_special_nye": true,
                "head_special_ski": true,
                "head_special_snowflake": true,
                "head_special_springHealer": true,
                "head_special_springMage": true,
                "head_special_springRogue": true,
                "head_special_springWarrior": true,
                "head_special_summerHealer": true,
                "head_special_summerMage": true,
                "head_special_summerRogue": true,
                "head_special_summerWarrior": true,
                "head_special_yeti": true,
                "head_warrior_1": true,
                "head_warrior_2": true,
                "head_warrior_3": true,
                "head_warrior_4": true,
                "head_warrior_5": true,
                "head_wizard_1": true,
                "head_wizard_2": true,
                "head_wizard_3": true,
                "head_wizard_4": true,
                "head_wizard_5": true,
                "shield_healer_1": true,
                "shield_healer_2": true,
                "shield_healer_3": true,
                "shield_healer_4": true,
                "shield_healer_5": true,
                "shield_rogue_0": true,
                "shield_rogue_1": true,
                "shield_rogue_2": true,
                "shield_rogue_3": true,
                "shield_rogue_4": true,
                "shield_rogue_5": true,
                "shield_rogue_6": true,
                "shield_special_0": true,
                "shield_special_1": true,
                "shield_special_fallHealer": true,
                "shield_special_fallRogue": true,
                "shield_special_fallWarrior": true,
                "shield_special_ski": true,
                "shield_special_snowflake": true,
                "shield_special_springHealer": true,
                "shield_special_springRogue": true,
                "shield_special_springWarrior": true,
                "shield_special_summerHealer": true,
                "shield_special_summerRogue": true,
                "shield_special_summerWarrior": true,
                "shield_special_yeti": true,
                "shield_warrior_1": true,
                "shield_warrior_2": true,
                "shield_warrior_3": true,
                "shield_warrior_4": true,
                "shield_warrior_5": true,
                "weapon_healer_0": true,
                "weapon_healer_1": true,
                "weapon_healer_2": true,
                "weapon_healer_3": true,
                "weapon_healer_4": true,
                "weapon_healer_5": true,
                "weapon_healer_6": true,
                "weapon_rogue_0": true,
                "weapon_rogue_1": true,
                "weapon_rogue_2": true,
                "weapon_rogue_3": true,
                "weapon_rogue_4": true,
                "weapon_rogue_5": true,
                "weapon_rogue_6": true,
                "weapon_special_0": true,
                "weapon_special_1": true,
                "weapon_special_2": true,
                "weapon_special_candycane": true,
                "weapon_special_fallHealer": true,
                "weapon_special_fallMage": true,
                "weapon_special_fallRogue": true,
                "weapon_special_fallWarrior": true,
                "weapon_special_ski": true,
                "weapon_special_snowflake": true,
                "weapon_special_springHealer": true,
                "weapon_special_springMage": true,
                "weapon_special_springRogue": true,
                "weapon_special_springWarrior": true,
                "weapon_special_summerHealer": true,
                "weapon_special_summerMage": true,
                "weapon_special_summerRogue": true,
                "weapon_special_summerWarrior": true,
                "weapon_special_yeti": true,
                "weapon_warrior_1": true,
                "weapon_warrior_2": true,
                "weapon_warrior_3": true,
                "weapon_warrior_4": true,
                "weapon_warrior_5": true,
                "weapon_warrior_6": true,
                "weapon_wizard_0": true,
                "weapon_wizard_1": true,
                "weapon_wizard_2": true,
                "weapon_wizard_3": true,
                "weapon_wizard_4": true,
                "weapon_wizard_5": true,
                "weapon_wizard_6": true,
                "back_mystery_201410": true,
                "armor_mystery_201410": true,
                "head_mystery_201411": true,
                "weapon_mystery_201411": true,
                "eyewear_special_summerRogue": true,
                "eyewear_special_summerWarrior": true,
                "eyewear_special_wondercon_red": true,
                "eyewear_special_wondercon_black": true,
                "armor_special_2": true,
                "armor_mystery_301404": true,
                "eyewear_mystery_301404": true,
                "eyewear_mystery_301405": true,
                "headAccessory_mystery_301405": true,
                "head_mystery_301404": true,
                "head_mystery_301405": true,
                "shield_mystery_301405": true,
                "weapon_mystery_301404": true,
                "head_special_winter2015Mage": true,
                "armor_special_winter2015Mage": true,
                "weapon_special_winter2015Healer": true,
                "armor_special_winter2015Healer": true,
                "head_special_winter2015Healer": true,
                "shield_special_winter2015Healer": true,
                "weapon_special_winter2015Rogue": true,
                "armor_special_winter2015Rogue": true,
                "head_special_winter2015Rogue": true,
                "shield_special_winter2015Rogue": true,
                "head_mystery_201412": true,
                "armor_mystery_201412": true,
                "weapon_special_winter2015Warrior": true,
                "armor_special_winter2015Warrior": true,
                "head_special_winter2015Warrior": true,
                "shield_special_winter2015Warrior": true,
                "shield_special_goldenknight": true,
                "head_mystery_201501": true,
                "armor_mystery_201501": true,
                "head_special_nye2014": true,
                "armor_special_birthday2015": true,
                "weapon_special_winter2015Mage": true,
                "weapon_mystery_201502": true,
                "headAccessory_mystery_201502": true,
                "weapon_warrior_0": true,
                "weapon_special_spring2015Mage": true,
                "armor_special_spring2015Mage": true,
                "headAccessory_special_spring2015Mage": true,
                "head_special_spring2015Mage": true,
                "weapon_special_spring2015Warrior": true,
                "armor_special_spring2015Warrior": true,
                "head_special_spring2015Warrior": true,
                "shield_special_spring2015Warrior": true,
                "headAccessory_special_spring2015Warrior": true,
                "weapon_special_spring2015Healer": true,
                "armor_special_spring2015Healer": true,
                "head_special_spring2015Healer": true,
                "shield_special_spring2015Healer": true,
                "headAccessory_special_spring2015Healer": true,
                "weapon_special_spring2015Rogue": true,
                "armor_special_spring2015Rogue": true,
                "head_special_spring2015Rogue": true,
                "headAccessory_special_spring2015Rogue": true,
                "shield_special_spring2015Rogue": true
            }
        }
lemoness commented 8 years ago

I still think that this ticket is a good idea, but it's very low priority, so I'm not sure we should leave this ticket open unless someone is hoping to work on it.

khipkin commented 8 years ago

I'm not entirely clear on what this ticket is requesting.

SabreCat commented 8 years ago

@khipkin: Each piece of equipment has a single blob of text describing it, that includes both fanciful description irrelevant to its game effects ("Its glittering facets tell the tale of a hero.") and the in-game effects of equipping that gear ("Increases all attributes by 6."). Displaying the latter in the Costume area is misleading or at best irrelevant: equipping a Costume piece does not change attributes. To strip the game effects from the Costume description, we'd need to split up the two chunks of information for a given piece of gear.

Does that make more sense?

khipkin commented 8 years ago

@SabreCat Oh yeah, that makes sense! So the ticket is just for splitting up the description strings and then making the costume section only reference the "fanciful" strings.

Alys commented 8 years ago

@khipkin Yes.

My concern with this issue is that splitting the strings creates a huge number of changes for the translators to do (and the players see the English versions until that's done), or we handle it by not splitting the locales strings but using a regex to break them up when displaying the Costume versions (open to failure if the strings don't contain the words that the regex expects; regexes might be slow too for many pieces of gear; some gear has fluff descriptions before and after the stats, leading to complex regexes). However if we're splitting the strings, the sooner we do it, the less translation work is needed.

khipkin commented 8 years ago

@Alys Maybe environment variables could be used temporarily to keep track of which locales haven't been re-translated yet, then the old strings could be used for those locales (meaning there would be no change visible to the user) until the new translations are added.

crookedneighbor commented 8 years ago

If this is something we decide to do, I think the best course of action would be to remove the stats information entirely from descriptions and have a function that takes in the gear object and outputs the stats information. Rather than having a two translation strings for each piece of gear. (Forgive me if that was suggested already, been a while since I've looked at this)

Might be best to wait till after the redesign so we know how the gear will be presented.

Alys commented 8 years ago

@crookedneighbor That sounds great. I'm marking this as on hold.

lemoness commented 7 years ago

Given the fact that in the current version of the redesign, the costume filter is toggled at the bottom of the page and the outfits are not separated out, I think this change might be more confusing than clarifying, so I am closing this ticket for now. If necessary, we can always open a new one.