This is a mechanic that I’ve been throwing around for a while in my noggin, and it seems that it is not going to be possible to release what I’m calling ‘v1’ (though I don’t think it’s very fun or playable at the moment, so I may need to revise my versionings) without implementing this, which is much sooner than I had expected.

What the memory system provides is the following gameplay mechanics:

  • A system for visually indicating important entities.
  • A way to seperate the true nature of an NPC from the things that other NPCs and the player character witness.
  • A way to track the location of important locations for entities (home, work, drug pickup locations, places to eat etc.)
  • A way to track friendly and unfriendly entities.
  • A way to keep track of short-term events. E.g., “I’ve just been attacked!”

If architected well, the same system can be applied to NPCs and the player.

NPC Mechanics

For NPCs, memories will allow for a place to store important coordinates for pathfinding purposes, and also allow for more complex logic when doing jobs.

This could be as simple as pathfinding to work from home and vice-versa. A bit more complex of an example could be when an NPC gets mugged; the attack action would emmit an event that could trigger a few things: put the victim in a ‘defensive’ state, log a memory in the victim “I’ve been attacked by entity X”, log a memory in the mugger “I attacked entity Y”. Then, on the victim’s turn they will see that they are in a ‘defensive’ state and perform the action associated with that state, which could be ‘search my memory for who most recently attacked me, set that person as my current target, and then attack my current target.’ Depending on how long the two entities fight, they could become permanent memories for each other, and upon a successful mugging, the mugger should certainly make sure to not target any body they have recently mugged by referencing a short- or long-term memory “I mugged entity Y.”

This could also allow for more complex decision making. If families are generated together, and a younger brother sees his older brother commit a crime, he might have to make some sort of weighted decision if the player questions the kid about a recent mugging regarding the NPC that is both his older brother and a criminal.

Player Mechanics

If a player witnesses a crime, then that NPC could be drawn with a particular color in order to make it more obvious how the player should react to that NPC. A big theme for this game is that everybody has the capability of doing the wrong thing, but it’s not obvious. NPCs should generally be homoginous, with people only sticking out if there is a good reason for the player character to notice them. You might dialog with a criminal, but not know they are a criminal, and you might ask an NPC if they’ve seen anything suspicious and that NPC could honestly answer them with a ‘no.’

Memories could also be used for automated travel between known locations (perhaps a ‘remember this location’ UI?).

NPC dialog. A player could go around asking NPCs if they’ve seen anything suspicious, and the NPCs could potentially transfer their memories to the player if it’s applicable, allowing for dialog to have a mechanical implication since memories have a direct affect on the interface (neutrally colored NPCs would become red if the NPC can remember the mugging they saw earlier that day).

Architecture

I’m not really sure how to do this, but this is my initial thought:

memories: {
  people: [],
  places: [],
  events: []
}

Example memories taking the form:

'Bob Schmo': {
  name: 'Bob Schmo',
  jobs: ['mugger'],
  relationship: ?
}

'home': {
  x: 34,
  y: 53,
  z: 0,
}

'work': {
  name: 'Plexico Enterprises',
  x: 100,
  y: 204,
  z: 7
}

'attacked': {
  entity: {Entity object}
  expires: 25
}

'saved': {
  entity: {Player object}
  expires: 100
}

Not really sure if that’s how I want to keep it, but it will at least serve for now…