-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Persistent parrot memory: Polly knows what you did in round #17512 #39075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…? isn't that a good joke? I'm ok
|
|
||
| // order isn't important in this list so we can use the faster means of removing | ||
| memoryComponent.SpeechMemories.RemoveSwap(i); | ||
| i--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug that I didn't catch in the last PR, this wasn't clearing messages correctly.
|
I am guessing my substandard understanding of async and how we interact with the database is failing the tests. I'll have a look into it. |
|
me whispering "SHITSEC" 800 times every round to the bird |
|
I'm going to tweak this a bit more today and add one or two things. I lied I'll do it tomorrow |
|
I thought about adding a pin functionality, allowing messages to stay forever if an admin deems them based, and adding pagination to the parrot messages UI so it'd show like 10 pages at a time. But I'd rather not touch the UI at all anymore and defer to whatever input maints or admin have in the reviews instead. |
|
Why block messages and not just remove them forever? Are blocked messages gonna be always acceasible via the menu? |
Yes, blocked words stay there forever. The blocked words are also supposed to never be re-learnt by parrots. I seem to have forgotten to actually implement this part, though. I'll do that still. It'd be a very low effort way of filtering what the parrots can learn if people keep trying to teach the parrots the same bad things. |
|
Made it so blocked words are never learnt again, and also added a cvar for the number of memories a parrot retrieves from the database every time it refreshes. I noticed that people really like it when they see a parrot has learnt something from them and see it parroted, and the old behavior would just replace everything in the parrot's memory. With the cvar set at the default 15 it should only replace some of the messages learned in the current round. |
About the PR
Added the ability for Polly the parrot to commit memories to the database
This is basically exactly the implementation I had in mind, but in terms of functionality I am looking for input regarding:
I hope the UI code is sane and I am doing the async stuff correctly.
Why / Balance
SS13 did it. Fun. Gaslights players into thinking there's a tesloose/zombie/murderous ninja/nukies if they don't read who's saying it.
Technical details
General
Several-thousand LOC PR to make a parrot funny.
Overall, the following: Players who have at least 10 hours of playtime and who pass all the basic learning checks of the ParrotMemoryComponent/System, have their messages committed to the database.
Memories are kept for 7 days at the time of writing.
Before we start, how much data is being saved, here?
I made a python script to fill the parrot memory table full of messages by simulating:
This would add something like 6,5k messages to the database, an average of 62 per round, and kept 103 rounds.
With multiple servers this would be more, but it should give you a decent indication of how much is stored in the database.
I don't want to think about how much actually ends up being used.
Database
This adds a table to the database that contains parrot memories. It stores:
Adds a bunch of functions to retrieve/update these memories for parrots and for admins.
Components
Adds a
ParrotDbMemoryComponent. Only contains the next refresh time pointSystems
Adds a
ParrotDbSystem, which:ParrotMemoryComponentand aParrotDbMemoryComponentlearns a new chat messageParrotMemoryComponentwith new memories when the refresh time point is passedAdmin tooling
Adds a Parrot Memory browser window. This allows admins to:
When a player is erased it sets all parrot memories sourced from that player to blocked.
CCVars
Adds four CCVars:
parrot.db_refresh_interval: How often a parrot's round memory is filled/refreshed with memories from the databaseparrot.db_refresh_num_memories: How many memories to retrieve from the databaseparrot.db_min_overall_playtime: The minimum overall playtime of a player before their messages are committed to the databaseparrot.db_max_memory_age: The maximum age of memories before they are truncated.Anything else?
Yes this fixes removing parrot memories from a player when they're erased. That was broken in certain cases, I didn't test it well enough.
Media
Basics - polly's inter-round memory
1.mp4
Admin tooling - Memory manager basics
2_s.mp4
Admin tooling - Blocking messages
3_s.mp4
Admin tooling - Erasing players and ahelping
4_s.mp4
Admin tooling - Filtering message text
5_s.mp4
Requirements
Breaking changes
Changelog
🆑 Crude Oil
ADMIN: