Giter Club home page Giter Club logo

npcs-names-distributor's People

Contributors

adya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

npcs-names-distributor's Issues

"Clan" Priority

Extend list of available priorities with Clan priority. It will be higher than Faction priority.

This addition will match number of priority levels in each tier:

  • Race/Class - for whole population
  • Faction/Clan - for groups of people
  • Individual - for each person

Short Names

Add ability to shorten generated names and display those where appropriate.

Configuration options will be provided separetely.

Switch from Load3D hook

Turned out #43 hadn't fixed the root cause, but only mitigated some symptoms. The problem seems to be that RaceMenu's BodyGen changes lifecycle of an Actor. In particular, it calls Load3D function earlier than the original game did, and at this moment there are no keywords on an Actor yet. This consequently causes NND to fail to pick any name and caching empty result, effectively breaking name generation for that Actor.

The solution would be to switch the hook.

Circumfixes

A circumfix (abbreviated circ)[1] (also confix or ambifix) is an affix which has two parts, one placed at the start of a word, and the other at the end.

Add a flag that will allow treat Prefix and Suffix components as circumfixes:

When enabled, will synchronize picked prefix and suffix, e.g. when there are 3 prefixes and suffixes, Name Definition will pick one index for both lists.

Note that number of prefixes and suffixes must match, otherwise length of the shortest one will be used.

Obscuring Names

Rework Obscuring Names to make more sense.

  • Instead of enabling obscuring by default unless excluded with NNDKnown this feature should be disabled by default unless included with NNDObscured. see comment.
  • Name should be revealed as soon as NPC is activated

Algorithm for obscurity:

  1. If definition for obscuring names present - use it
  2. If not present (or names wasn't picked) check title
  3. If custom title is provided - use it
  4. If no custom title and isTitleless = false - use preferred obscuring name (originalName or ???. Original name is default option when not titleless)

Change DISTR file to use FormIDs

Currently, by using names in SPID filters, games in other languages won't work, since SPID would fail to distribute.
By switching to FormIDs mod will become truly language-independent.

Use GetFullName or GetShortName to substitute original name

In cases where originalName must be used within generated names NND should take TESNPC's GetFullName (or GetShortName depending on requested name style).

The originalName that is passed from hooks is unreliable and may provide altered names (e.g. updated via SetDisplayName or other means). Additionally it would carry over a bug with multiple generated names, since those are stuck as "original names" (see #30)

DispalyName Formats

In addition to #13, allow customizing name formats when title is used.

This would be a port of existing feature in NND 1.0:

List of options:

  • None: Torvar Stormwall
  • New Line: Torvar Stormwall
    Whiterun Guard
  • Hyphen: Torvar Stormwall - Whiterun Guard
  • Round Brackets: Torvar Stormwall (Whiterun Guard)
  • Square Brackets: Torvar Stormwall [Whiterun Guard]
  • Comma: Torvar Stormwall, Whiterun Guard
  • Semicolon: Torvar Stormwall; Whiterun Guard
  • Full Stop: Torvar Stormwall. Whiterun Guard
  • Space: Torvar Stormwall Whiterun Guard

Allow defining completely custom format using [name] and [title] placeholders.

Linked Scopes

When multiple Scopes are specified in Name Definition, the first picked name from this Definition should fulfill all scopes and do not look those names further.

Round of Compatibility patches :)

Review some requested mods to provide built-in compatibility

Allow distributing titles to unique NPCs

Currently Unique NPCs are completely ignored by naming.

Allow using Custom Titles to attach those to unique names of the NPCs.

Note: Only Custom Titles can be attached. If Custom Title is not provided then the original name will be used (as it is now)

Clean issues after NND 1.0

After #29 There will be a single place that will be able to un-bake stuck obscure names and multiple names.

Not sure whether this needs to be done in first release (or at all) since NND 2.0 will reroute all names.

Compatibility with Compass Navigation Overhaul

Compass Navigation Overhaul seems to not use any existing calls to GetDisplayFullName, so that generated name never shows up on compass.

One way to solve this is to introduce some API, and patch CNO (and also TrueHUD) to use this API to obtain correct name. One benefit of this solution would be ability to control name style with separate context.

Safe guard empty sFormat

Ensure that when sFormat is explicitly set to empty string NND will use default format instead.

Migration to YAML

Name Definitions in YAML format should be more compact and cleaner, thus easier to understand.

Rework default names

Currently default titles and obscurities are being stored within NNDData.
This leads to the need for cumbersome checks and storing extra data in cosave when it's not needed there.

To mitigate this NNDData::UpdateDisplayName() and NNDData::GetName() should be updated to receive an Actor and be able to substitute GetFullName() for title when needed.

This would also remove the need to store UpdateMask::kObscurity since it will never be persisted in a cosave.

To extend this even further we can remove the need for UpdateMask::kDisplayName, by not saving displayName either.
It will be reconstructed anyway, so why bother.

Mannequins are broken

Mannequins are detected as talkable, and thus affected by obscurity which in turn breaks their default behavior and instead offers to "talk" to them.

Rework special keywords

Currently NNDTitleless is used for both Title and Obscurity scopes. This poses certain limitation, as original name can be either used in both or none at all. Furthermore, with introduction of separate Title scope a keyword NNDTitleless is confusing (it doesn't affect custom titles).

To solve these issues we're gonna need to:

Streamline keywords naming

  • NNDTitleless -> NNDDisableDefaultTitle - a bit more wordy, but makes it perfectly clear on what it does
  • NNDExcludedTitleless -> NNDEnableDefaultTitle - now this makes even bigger impact
  • NNDExcludedUnique -> NNDNotUnique - this should add a bit more clarity.
  • Preserve NNDUnique - this is fine ๐Ÿ™‚
  • Preserve NNDKnown - this is also fine. Note: Known keyword doesn't need a counterpart like others, because by default everyone who can be obscured will be obscured.

Untie obscurity from NNDTitleless

Create a new pair of keywords similarly to new title keywords, but that will work for obscurity.

  • NNDDisableDefaultObscurity
  • NNDEnableDefaultObscurity

Backward compatibility

Renamings should automatically happen along with other routines in modernize
Actually, backward compatibility will be embedded using this distr:

Keyword = NNDDisableDefaultTitle|NNDTitleless
Keyword = NNDEnableDefaultTitle|NNDExcludedTitleless
Keyword = NNDNotUnique|NNDExcludedUnique

This should silently distribute new keywords without needed to update all custom made patches.

Refresh NNDData when reloading

When reloading, cached NNDData entries must be updated if they have unresolved fields.
So if title was not picked last time (e.g. originalName was used). Then this data needs to be regenerated, to see if title has changed.

For this feature to be efficient NND needs to save the composition of last used Name Definitions in form of pairs: NameDefinition's file name + checksum of that file.

Before loading NNDData entries, serializer should load this segment and determine whether data needs to be updated (e.g. whether composition of Name Definitions has changed since last time).

If changes are detected, then the following fields should be considered:

  • title
  • obscurity

If those segments used default values (e.g. empty or defaultName or originalName) then an update is warranted.

UpdateDisplayName must also be called after that regardless of whether Name Definitions have changed, and/or any new names were picked, to account for possible change of DisplayName::format. (perhaps also cache last used format). Changes in options had also been added to snapshot.

Hook individual calls to GetDisplayFullName

Hooking GetDisplayFullName doesn't provide context as to where the name will be used.

As such it should only be used as default fallback option. Whereas specific calls to this function should be hooked to provide context-aware name replacements.

Feature Toggles

Allow toggling features using hotkeys:

  • Ctrl+Shift+N: Toggle Names distribution. This will enable/disable generated names. Redundant as the mod can now be safely removed anytime.
  • RCtrl+O: Toggle Obscuring distribution. This will enable/disable obscured names.
  • RCtrl+L: Reload settings.
  • RCtrl+RShift+G: Regenerate all names. Show a message box with confirmation.
  • RCtrl+G : When crosshair points to an NPC, regenerate this NPC's name. No confirmation.

Probably allow customizing these hotkeys in INI.

Add support for placeholders in display names in different contexts

With recent release of wSkeever's mod it is now apparent that any further useful dynamic additions to the name is not possible.

To mitigate this NND should be able to:

  1. Substitute placeholders in any context.
  2. Add support for several placeholders:
    2.1 [race] - race
    2.2 [sex] - sex
    2.3 [relation] - relationship disposition
    2.4 [class] - class or combat style (e.g. warrior, mage)
    2.5 [carry] - show carry weight
    2.6 [break] - new line

Pre-cache NNDData when Actor is loaded

In order to keep NNDData up-to-date with external configuration (Name Definitions, _DISTR files, options) NND needs to be able to refresh flags for all cached NNDData, e.g. to detect the following events:

  • New Name Definitions added
  • NNDKeywords distribution changed (someone was marked as unique and/or as titleless and/or as known)
  • Customization options changed

Some of these were already handled in #28. But it performs continuous checks to determine whether an update is needed even though it's only needed once.

The problem is that NNDData is created in-place when requested for the first time and then is reused.
This makes it hard to update NNDData once per session, since the only way to do it now is to continuously run this routine when a name is requested (which happens a lot).

Instead of introducing yet another flag and keep checking it, NND can do pre-caching of NNDData when an actor is loaded for the first time in this session. This would give a chance to refresh all flags.

"Title" Scope for Name Definition

Allow Name Definitions to be used for Titles. Custom titles will replace original names where they were used as titles.

Note: Custom Titles ignore NNDTitleless keyword, since this keyword used to indicate when originalName should not be used as title.

Flatten Name Definition Behaviors

Nested Behavior objects proven to be redundant. As such all options presented there will be moved to top-level object.

Also Combine behavior should be renamed to Inherit for clarity.

Conflict with Racemenu's BodyGen

Apparently, it causes issues ๐Ÿ™‚ presumably conflicting around Load3D, which prevents any name generation from happening.

Details are in Discord's PM

Reanimated NPC stuck with obscure name

If an NPC is killed while being obscured their name will be forever frozen to obscure. Not sure how to handle that yet.

Also, for reanimated npc using kDisplayName doesn't look good. Fixed. NPCs will automatically reveal their name.

I probably need to introduce a separate category for Reanimated. Done. kCrosshairMinion

Configurable Name Styles

NND 2.0 defines 3 Name Styles:

  • Display Name: Shows both Full Name and Title.
  • Full Name: Only shows Full Name
  • Short Name: Shows a shortened version of the name if available. Otherwise shows Full Name.
  • Title: Shows only Title if available (either a custom Title is provided or isTitleless = false). Otherwise shows Full Name.

Each of these styles can be used in one of the following places:

  • Crosshair
  • Crosshair Minion
  • Enemy bar
  • Subtitles
  • Inventory menu (pickpocketing/followers inventory)
  • Barter menu

User will be able to customize which style is used in those places separately in INI config file.

No more formatting styles that determine how Title is appended to a Full Name. (at least for now)

Papyrus API

Expose some Papyrus functions to GetRandomName
And Get various generated name variants. Also Setters might be useful.

This would allow patching other mods that want to dynamically change NPCs names to merge generated names with their variants.

Name Definition Scopes

Scopes feature replaces and extends old Behavior.Obscuring, by allowing Name Definition to be used in arbitrary number of scopes.

Possible scopes will be: Name Title Obscuring

Several scopes can be combined in a single Name Definition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.