Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Solving the memory slot problem  (Read 743 times)

mikekchar

  • Bay Watcher
    • View Profile
Solving the memory slot problem
« on: September 08, 2020, 08:49:21 pm »

I was very interested to read Toady's description of how the memory slots work and especially how memories are promoted into short term memory, long term memory and core memory slots.  At first, I took heart and thought that all I needed was a variety of different experiences to "kick out" bad memories, but after I mulled it over for a while I realised that it is currently not possible to kick out most memories.  I will explain the problem and suggest a simple solution.

I will only talk about short term memory slots because that's enough to understand the problem.  For simplicity, imagine we have 5 memory slots.  Let's also imagine that each memory has a category and a strength.  The strength is between 1 and 5.  Again, this is just a simplification to aid in understanding.  Initially we have some experiences that get put into memory slots.  If there is a slot available, a memory for the experience is placed in the slot.

It doesn't really matter what the starting condition after we have filled the slots is, but let's say that we have one memory of each strength in the slots.  So the slots look like [1, 2, 3, 4, 5].  When we have another experience, we check the slots to see if there are any with in the same category.  If we do keep the memory that has the highest strength.  In this way, the average strength of memories increases over time.  Let's pretend that we have strengthened all of our memories an have the result [5, 5, 5, 5, 5].  Note, this is just a random scenario, it really doesn't matter what happens as I hope you will see later.

Now, let's imagine that we have an experience in a new category.  It will replace the lowest strength memory slot, even if it is of a higher strength.  Let's say that our new memory is of strength 3.  All of the current slots have the same strength, so let's choose one at random to replace.  The result is: [3, 5, 5, 5, 5].

At this point, when we have a new experience, it will either be of the same category or a new category.  If it is of the same category the only thing it can do is raise our 3 to a 4 or a 5.  If it is of a new category, it can *only* replace the 3!  So if we have a new category with strength 1, we will end up with [1, 5, 5, 5, 5].
The next experience will do exactly the same thing.  No matter how many experiences we have, we will always replace the same memory slot.

Now, you may be thinking that I've stacked the example, but the same thing generally happens no matter how the slots are filled.  Let's go back to [1, 2, 3, 4, 5].  If we have a new memory category and a strength of 3, we will end up with [3, 2, 3, 4, 5].  If we get one of 1, then it will be [3, 1, 3, 4, 5].  Next 4: [3, 4, 3, 4, 5].  Next 5: [5, 4, 3, 4, 5].  2: [5, 4, 2, 4, 5].  I could go on, but you can see that fairly quickly you get into a static pattern where only one or 2 memory slots can change.  Importantly the 5 on the right hand side will *never* change unless *all* of the memory slots are of strength 5.  And even then, there is only a 1 in 5 chance of it changing.

This means that strong memories get stuck in the memory slot (or optionally get replaced with stronger memories of the same category) and *can not get shifted out*.  They *will* end up as long term memories eventually.  From there, the exact same thing will happen and they *will* eventually become core memories and will change character traits.  This is what we all observe from playing the game for a long period of game time.

Suggestion for how to fix it:  It is very simple.  Instead of using the strength alone as the metric for whether a memory gets replace, use a function of the strength reduced by the amount of time it has sat in the memory slot.  This means that as new experiences happen, the older the memory, the more likely it is to get replaced (simple cache starvation avoidance strategy ;-) ).

By the way, we need dining philosophers in this game.  And spaghetti.  But that's a different suggestion (I guess).

Edit: Error in example
Edit: And again... :-P
« Last Edit: September 12, 2020, 10:59:45 pm by mikekchar »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Solving the memory slot problem
« Reply #1 on: September 11, 2020, 08:03:28 am »

Just because of your edits: "slow" in the second paragraph, last sentence should be "slot" ;)

And yes, having effective memory strength decay with time makes a lot of sense.
Logged

mikekchar

  • Bay Watcher
    • View Profile
Re: Solving the memory slot problem
« Reply #2 on: September 12, 2020, 11:00:21 pm »

Cheers!  I typed that in the car when it was about 36 C and I was having trouble concentrating :-)
Logged

thompson

  • Bay Watcher
    • View Profile
Re: Solving the memory slot problem
« Reply #3 on: September 14, 2020, 11:21:19 pm »

Random replacement weighted by memory strengths could be a good option as well. So, if we have memories [1,2,3,4,5], we generate a random number between 1+2+3+4+5=15 (lower numbers are stronger here). The odds of memory 5 being replaced are then 5/15, or whatever. It’ll make weird decisions from time to time, but should get it about right on average. You could also add the new memory to the new memory to the calculation so there’s a chance it isn’t added. Or use quadratic or exponential weights. Allow weights to rise over time (higher numbers are weaker), or whatever.
Logged

Brabygg

  • Bay Watcher
  • unknown frozen plant substance
    • View Profile
Re: Solving the memory slot problem
« Reply #4 on: September 15, 2020, 01:43:20 am »

Now, you may be thinking that I've stacked the example, but the same thing generally happens no matter how the slots are filled.  Let's go back to [1, 2, 3, 4, 5].  If we have a new memory category and a strength of 3, we will end up with [3, 2, 3, 4, 5].  If we get one of 1, then it will be [3, 1, 3, 4, 5].  Next 4: [3, 4, 3, 4, 5].  Next 5: [5, 4, 3, 4, 5].  2: [5, 4, 2, 4, 5].  I could go on, but you can see that fairly quickly you get into a static pattern where only one or 2 memory slots can change.  Importantly the 5 on the right hand side will *never* change unless *all* of the memory slots are of strength 5.  And even then, there is only a 1 in 5 chance of it changing.

This means that strong memories get stuck in the memory slot (or optionally get replaced with stronger memories of the same category) and *can not get shifted out*.  They *will* end up as long term memories eventually.  From there, the exact same thing will happen and they *will* eventually become core memories and will change character traits.  This is what we all observe from playing the game for a long period of game time.
I mean, it's realistic. You're pretty unlikely to ever forget extremely traumatic or extremely happy memories.
Logged
Quote from: Lytha
...dwarves rolling through the corridors in the shape of amorphous, obese globs of fat don't quite seem to be as much of a good thing as dwarves running around with a "very tough" line in their description though.
Generation 2: Add this phrase to your signature, but replace one word in it with one of its synonyms. BETTER social experiment.