-
Notifications
You must be signed in to change notification settings - Fork 9
/
designNotes.js
73 lines (54 loc) · 7.24 KB
/
designNotes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Extended World Information v2.0
// This scripts focuses on the processing and alterations of the functionality behind world entries.
// This is achieved through an attribute tagging system where letters assigned to its keys are short-hand abbrevations for an associated functionality.
// The following attributes should be placed as a bracket-encapsulated keyword without any delimiters within the bracket. e.g [wagfi]
// All attributes accept an assignment operator that further tweaks their functionality, mostly in the form of duration management that permits the 'lock-in' of e.g a sequence of frontMemory, authorsNote etc.
// The assignment operator is '=' e.g [f=10] will reserve the entry for frontMemory for 10 turns.
// i - Makes the AI ignore the World Entry during it's normal detection processing [Controls the 'lastSeen' property of the entry]
// a - Assigns the entry in authorsNote mode. Once detected it will be set as the authorsNote, an entry whose keys is simply [a] will be the default/fallback authorsNote. [Controls 'state.memory.authorsNote]
// f - Pushes the detected entry into frontMemory and prefixes the final line(break) of the most relevant entry with '\n> ' to process it an action that plays off the other front memories, or the previous actions if only one is detected. [Controls 'state.memory.frontMemory']
// g - Flags the entry as 'auto-generated by the AI' to permit automatic management of it. This can result in it being deleted so use it with caution. [Controls the 'autoGenerated' property of the element]
// w - Assigns a weight to the entry that makes it become prioritized by the AI when sorting in situations that don't have room for every activated entry. By default the w attribute assigns a weight of ten, but by extending it with e.g w=1000 you can manage and sort it however you wish, higher value trumps lower values. [Controls the 'count' property of the element]
// q - Sets the contents of the entry as the active quest upon detection. Quests do not accept linebreaks, but in the event linebreaks are present the last line of the entry will become the activeQuest description. [Controls 'quests', awaiting scripting support]
// r - This will change the entry's status from hidden to visible once it activates, this can be used to slowly reveal the characters, spells and mysterious of the world without spoiling it all immediately. [Controls 'isHiddenFalse' property]
// c - Allows the assignment of a category. Requires a case-sensitive, custom category name e.g c=SPELL. This will sort all worldEntries according to their matching category then by alphabetical order and finally by weight if assigned. [Intention is to permit sorting/grouping]
//############################################
//########### Additional Notes ###############
//############################################
// [i] the lastSeen attribute:
// A default assignment of 'i' indicates that it should be in a perpetual state of absence from the native keyword processing.
// 'f' will disregard the 'i' statement and always pick up on the entry. If 'i' is assigned a value e.g 2 then 'f' will respect the cooldown.
// An assigned value e.g i=10 will implicitly set it on a cooldown for ten turns when detected without fulfilling the native requirement of verbatim presence in history.
// This is intended to further reduce repition and to interplay with the other flags. A 'q' flagged entry should will most of the time be accompanied with an 'i' flag.
// [a] the authorsNote attribute:
// 'a' looks for a fallback entry that has no extra keys beside the 'a' attribute which it will utilize if present and no other 'a' attributed entries are currently active.
// The assignment operator controls how many turns it's guaranteed to be active.
// A default 'a' entry remains active until it is overriden by another.
// An 'a=10' assignment keeps the authorsNote set to the entry content until ten turns have passed at which point it goes back to the fallback note or replaced by the next entry with an 'a' attribute.
// [f] the frontMemory attribute:
// Default 'f' assignments are sorted in the order of relevance where the most recent mention of its corresponding keys yields higher relevance (it will be the frontMemory that it acts upon)
// All 'f' detected entries within the character limit ~500 will be stacked into frontMemory in an sorted order before applying '\n> ' to the last line of the most relevant entry.
// This will result in an action that's based on either all of the other frontMemories with past actions in mind while also telling the AI do to something with that information.
// Assigning a value to 'f' e.g 'f=10' will reserve the prefix to the frontMemory entry for 10 turns. If multiple entries with an assigned value is present then it bases it on the weight/count.
// This can be utilized to enforce certain events, but be careful with your phrasing. e.g an entry that states 'It continues to burn.' might be appropriate after having casted a fireball and you don't wish that to be disregarded immediately.
// [g] the autoGenerated attribute:
// Unless the AI begins to accurately update worldEntries then this doesn't serve too much of a purpose at the moment, but in the event that it does it will be a nice way of tracking certain things e.g 'your health'.
// Still... one might find some neat use for it. 'g=10' would of course keep it in its autogenerated state for 10 turns on detection before reverting to normal whereas the default assignment is a persistent auto-generated flag.
// [w] the 'count' attribute:
// The idea is to interplay with categories for sorting and to better control the flow of how worldEntries are processed.
// With finetuning the weights (not related to AI finetuning or weights) one can better prioritize the order that the text is assembled without relying on having all relevant keywords appearing for the 'count' to increase.
// [q] the 'quests' attribute:
// 'q' will pull the contents of the entry and set it as an active quest upon detection.
// 'q=10' will make the quest expire after the amount of turns have passed.
// A yet undecided attribute might be able function as a 'quest-reward' if the quest is fulfilled within the timer and pull its content as a reward sequence e.g '\n> You are rewarded with the legendary sword'
// [r] the 'isHiddenFalse' attribute:
// Default 'r' reveals the entry once a keyword is detected. I'm considering using a scoring system where the user is tasked with mentioning all keywords before revaling it.
// For now the assignment is planned to reveal it for a set amount of turns, but alternatively the idea is to have 'r=3' signify that the user must resolve three keywords before its revealed.
// [c] the category attribute:
// This will create and assemble custom named categories and sort the worldEntries array accordingly to better group things up.
// There are a ton of use-cases for this, but mostly to improve the readability of extensie worldEntries list.
// e.g creating divider, dummy entries that look something along the lines of:
// ##########################################
// ####### KNOWN CHARACTERS #################
// ##########################################
// Then below there have all entries tagged with 'c=CHARACTER'