Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

NPC snippets overhaul, part 1. `talk_tags.json`

Open Uwuewsky opened this issue 1 year ago • 4 comments

Summary

Infrastructure "NPC snippets overhaul"

Purpose of change

Some short snippets (<very>, <ill_die>) could create strange sentences out of place. Or be used ambiguously (<swear>). Or the snippet became a mishmash and lost its original meaning (okay). Some snippets were rarely used or not used at all, hanging around as dead weight. Some snippets, on the contrary, could be expanded or slightly reworked for a better result.

Describe the solution

Move talk_tags* to a separate folder (which is why PR counts so many changes).

Deprecate the following snippets: <shitty>, <dumb>, <very>, <really>, <monster>, <happy>, <sad>, <get_lost>, <ill_kill_you>, <ill_die>, <move>, <fuck_you> <okay> - in favor of <acknowledged> <swear> - renamed to <freaking> to eliminate ambiguity, because the snippet was used both as an adjective and as a stand-alone curse word. Now it is used only as an adjective before a noun. The occurrences in the text of these snippets have been replaced, and the definition itself has been moved to a separate file in data/json/obsoletion_and_migration_0.I/. Just in case, so that simple replacement of snippets does not cause errors in third-party mods or anywhere else.

Some snippets have been merged into one pool, creating a hierarchy. For example, <general_danger_h> uses snippets from <general_danger> in addition to its own unique ones. Or <kill_player_h> is now the same as <kill_npc_h>.

Some snippets have been split into multiple categories that will be concatenated to create more variations: <heal_self>, <kill_npc_h>, <greet>, noise warnings.

<swear!> is now a complete sentence: For crying out loud!, Damn<punc…!>, Are you kidding me?!.

3 new snippets with punctuation, chosen randomly: <punc.!>, <punc…!>, <punc.…>.

Describe alternatives you've considered

Testing

Ummm... all these changes are split into 5 parts, but they should be tested together, merging separately will most likely not even allow the game to load the world. And it is possible that its will break the build, since one of the header files has a removed snippet, which was replaced in... part 5?

~~Wait, I actually created a patch of all the changes before breaking it, here it is:~~ snip.zip. Nah, it's a bit outdated without a couple of minor fixes.

Nothing much has changed from the player's point of view, but here are some screenshots:

Details

snip3 snip6 snip7 snip8 snip10 snip11 snip12 snip13 snip14 snip15 snip16 snip17 snip_obsolete ^^^All snippets, including deprecated ones^^^

Additional context

It would be fun to have snippet categories for factions instead neutral-friendly and hostile.

Uwuewsky avatar Oct 27 '24 08:10 Uwuewsky

What's your reasoning for moving the file?

Procyonae avatar Oct 27 '24 11:10 Procyonae

All these snippets were split into 5 files. It is more convenient to work with them in a separate directory.

Uwuewsky avatar Oct 27 '24 12:10 Uwuewsky

I don't fully understand the rationale. For example, you're removing the <get_lost> tag because of... what? Because it's used exclusively by prisoners in island prison type B? If so, what's bad in that? Removing the giant diversity of answers provided by that flag in favor of handful of fixed answers doesn't seem good to me.

I think you should provide a complete rationale for every tag you're deprecating.

Night-Pryanik avatar Nov 24 '24 05:11 Night-Pryanik

The thing is, the removed snippets didn't create any particular diversity by replacing a couple words somewhere in the NPC's backstory.

They caused more pain than benefit, it's hard to tell if a replacement will be appropriate without knowing which line will be randomly selected, and it's hard to edit a snippet to fit all of its occurrences without knowing the context in which it might be used. (<shitty>, <dumb>, <very>, <really>, <monster>)

Sometimes snippets exist for few dialog strings, like get_lost. Yes, there's nothing wrong with that, but it's still overkill to have a snippet that's larger than the string it's used in. So I replaced their occurrences with text and removed them. (<get_lost>, <ill_kill_you>, <ill_die>, <move>, <fuck_you>)

To summarize some rationale, perhaps it's to reduce bloated and complicated infrastructure, hopefully it makes sense.

Uwuewsky avatar Nov 30 '24 02:11 Uwuewsky

please remove snippets that no longer exist from this test https://github.com/CleverRaven/Cataclysm-DDA/blob/92f70f2500d07fa0ca15393abf27a4d08e0f06aa/tests/npc_test.cpp#L205-L217

GuardianDll avatar Jan 08 '25 09:01 GuardianDll

it seems you missed something, the test is still failing

GuardianDll avatar Jan 08 '25 13:01 GuardianDll

I'll add the new snippets to the test back later.

And if this PR will be merged, I assume the tests for the other PRs will also be successful after the restart?

Uwuewsky avatar Jan 08 '25 13:01 Uwuewsky

If you resolves the test for all snippets removed in the rest of PRs, then yes, merging this PR and then updating the branch for the rest would solve the problem

GuardianDll avatar Jan 08 '25 13:01 GuardianDll

now the error is due to a ‘bad tag’, I'll take a look at what's wrong a little later.

um, I moved <swear!> to another file and didn't take it into account when I split the PR (which I probably shouldn't have done).

Uwuewsky avatar Jan 08 '25 16:01 Uwuewsky

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • UEE HEE HEE!
  • Aaaaand nope.
  • Bananope.
  • Damnit<punc…!>
  • Fuckit<punc…!>
  • Nada.
  • Nope, ain't happenin'.
  • Nope, nada, never.
  • Not happenin' chief.
  • Oh, lordy<punc…!>
  • Shitballs!
  • SpIrAlS

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

github-actions[bot] avatar Jan 08 '25 17:01 github-actions[bot]