Jump to content
  • entries
    12
  • comments
    15
  • views
    9,786

Let's Talk Karma


zippy57

802 views

How Insane is Zippy?  

5 members have voted

  1. 1. On a scale of 1-10, where 1 is Very and 10 is also Very. (read the post first)

    • 1
      1
    • 2
      0
    • 3
      0
    • 4
      0
    • 5
      0
    • 6
      1
    • 7
      1
    • 8
      2
    • 9
      0
    • 10
      0

Karma is one of those things. You know, the ones that never quite work like they should but no one really knows how to make it do that. Fallout treats karma as a line. D&D treats it as a square. Mass Effect treats it as two different lines. BG2 treats it as a square and a line.

 

Here's my concept for the "perfect" karma system, intended to take advantage of the NVSE Extender's ability to essentially create an infinite number of variables on the fly. Unfortunately, the functions don't exist to create or read the data (I'll explain all this as I go), so for right now this is just a theoretical write-up and not something that actually works.

 

Disclaimer: This may never actually work.

 

THE CONCEPT

The problem with the pre-existing karma systems I mentioned is that they all are too... universal. For them to work they require an action to be specifically defined as "good" or "evil" or "neither". But morally-based values like good and evil don't work that way. Everybody has their own idea of these things. The purpose behind this system is to reflect this by A) giving every individual NPC their own version of your Karma scale and B) changing the basic purpose of the scale from "good->evil" to "like->dislike".

 

PART 1: FAMILIARITY

Before someone can remember what you've done, they have to remember that it's you who's done it. Every NPC has a value that reflects how well they recognize you. The more you talk to them, the more attention you draw to yourself around them, the stranger the clothing you wear (or don't wear), it all increases the likelihood that they remember you. At a certain point they'll always remember you, but if it doesn't go quite that high and you spend a long time away from them then their ability to recognize you will dwindle.

 

PART 2: OBSERVATION

For this to work an NPC has to have a "memory". If they see you steal something or shoot someone they need to remember that it happened. Nearly every major action the Player can take should be "remembered". The first step is actually seeing the action. NPCs should occasionally be allowed to "misinterpret" actions, but they generally have to see something actually happen to remember it. Next is determining who it is. It's probably you, but they aren't that genre-savvy.

 

Are you in broad daylight or sneaking in the shadows? Are you wearing a helmet that covers your face? Are you wearing the same garishly colored outfit you were when you talked to them an hour ago? Factors like this determine whether or not they actually remember it's you that performed that action.

 

PART 3: MULTIPLIERS

Here's where the scale of this concept becomes incredibly high. This section solves the basic problem of the standard karma system, which you'll recall is that everything is either "good" or "bad". In this system, every NPC has their own set opinion of every action. For example, Bob might think it's bad to steal no matter what while Fred may have no problem with you taking things from your enemies. Both NPCs are given a value that they assign to these actions, so while they both remember what you did, Fred doesn't really care while Bob dislikes you a bit more.

 

Factored into this is the time the actions were performed. Since Fred doesn't care, he'll probably forget you even did it eventually, while Bob might hold a grudge for the rest of his life. It all depends on the size of the multiplier and how well they recognize you.

 

PART 4: MODIFIERS

There are two basic types of modifiers in this system: Relationship Modifiers and Manual Modifiers. Relationship Modifiers deal with the tendency of people to bend their own moral "code" when it involves people they are "close" to. These should be sparingly used, and generally cover people who are family members, close friends, or in some sort of romantic relationship.

 

Manual Modifiers are essentially plot-related changes. If the player saves an NPC's life as part of the plot, for example, they are likely to like the Player more.

 

PART 5: CONVERSATION

People tend to talk. And they tend to talk about other people. When two NPCs talk, there is a chance they talk about you or something you've done. It all depends on how well they know you and how strongly they care about your actions. This is also the majority use of NPCs having relationship stats towards each other as well as the Player.

 

Let's say Bob and Fred are talking. You've been a jerk to Bob but incredibly polite to Fred and they both know you fairly well. Bob talks to Fred about how you punched him in the face. Since Fred feels he knows you well and none of your interactions with him suggest this behavior, he doesn't believe Bob. He might even record this as a "lie" from Bob and dislike him more in the future.

 

PART 6: IMPLEMENTATION

The result of this is that instead of checking a general karma value, you instead check the Target NPCs Karma value.

 

Also, it is possible to expand this system to cover multiple other things. For example, a personality system similar to that of DA2 where the style of the player's responses is saved. This allows the Player to work "undercover" more accurately; they will have to not only match the personality of whoever they are pretending to be, but must also keep consistent lest they be discovered.

 

Additionally, with the introduction of a series of Loyalty values, this could replace the vanilla faction system and instead determine hostility based on like/dislike and "orders" from other NPCs. For example, Bob, Joe, Fred, and George are all NCR soldiers in the NCR faction. Joe is a close friend to the player. The system would allow a simple SetEnemy command to be set on the NCR faction. But the system then checks every NPC going hostile to the Player. It finds that Joe is a close friend and is more loyal to the Player than to his commanding officer and allies, and so while the others go hostile to the Player, Joe switches sides and fights against them, or maybe he doesn't want to kill his fellow soldiers either so he just runs away or stays back. Or say the Player continually harrases George but is nice to everyone else. George snaps and goes hostile, but because everyone else in the faction likes the Player they attack George instead. Unfortunately, this system would be incredibly complex to code and would likely break every scripted combat sequence in the game.

 

THE REALITY

Unfortunately, this is quite far-reaching and can't be implemented since the functions don't exist. Let's look at how it might work assuming some new functions were added to NVSE and/or the Extender. Specifically we need functions to A) build a string that can be used in an NX_Set or NX_Get command, B) search all NX variable names with a string and return the number of variables containing that string, C) expand on B and return the number of variables whose value contains a string or number provided, D) treat a series of similarly-named variables in numeric sequence as a list and allow the addition to and removal from these lists via automatic variable numbering based on the sequence as well as being able to return the list number of an item.

 

Psuedocoding is simplified to save me time.

 

PART 1: FAMILIARITY

This requires Function A. Bob meets the Player.

set string to BuildString "Karma:Familiarity::" + PlayerREFset string2 to BuildString "Karma:LastSeen::" + PlayerREFBob.NX_Set string (Bob.NX_Get string + 10)Bob.NX_Set string2 GameSecondsPassed

Actual values TBD.

 

PART 2: OBSERVATION

This requires Functions A and D. When an NPC sees an action they store it. Each action is a separate action and is stored with the game time it occurred and the person who did it as three different variables. This is important for Part 5 so NPCs can differentiate between events (more on that there). Function A is needed to build the basic Set command passed to it by Function D. Each action is a list of actions. A list would look like this:

Bob Karma:Observation::ActionWho1 PlayerBob Karma:Observation::ActionWhen1 240240Bob Karma:Observation::ActionWhat1 TheftBob Karma:Observation::ActionWho2 PlayerBob Karma:Observation::ActionWhen2 240257Bob Karma:Observation::ActionWhat2 AssaultBob Karma:Observation::ActionWho3 FredBob Karma:Observation::ActionWhen3 240265Bob Karma:Observation::ActionWhat3 Theft

Function D treats ActionWho, ActionWhen, and ActionWhat as lists and appends to them information passed by the general script monitoring Player and NPC actions.

 

The other major issue with this is the lack of being able to actually check these things. In reality, we will be reliant on the hardcoded karma system by checking the values that the engine sends to the player's Karma AV. This means that we can only look for theft or killing actors, and we also can't use this system on NPC relation to other NPCs since NPC karma isn't a dynamic value.

 

Suggestions on how to accurately determine more specific actions, such as stealing from certain NPCs or factions, trespassing, etc., are very welcome!

 

This works by setting the KarmaMod globals so that they are all different. Then we set the Karma AV itself to 0 and wait for it to change. When it does we read the variable, copy, and set the AV back to 0. We use the value it was to determine what happened, then run sneaking, distance, Familiarity, etc. checks to determine if the NPC has identified the Player, and finally create a string with Function A and use Function D to add it to the "list".

 

PART 3: MULTIPLIERS

A concept best left to the game designers themselves, it falls on whoever implements this mod to figure out how the individual NPCs base their moral values. However, a solution has to be implemented regardless for mods that don't specifically support the new system, so this solution will probably handle all but the most major vanilla NPCs.

 

First some rules, namely that no system but the karma system itself should be modifying its values. To prevent mods from overwriting already existing multipliers and to allow the Player to configure them at will (more on that further down), all requests from other plugins to set or modify the karma values should be a request to the karma plugin itself rather than a flat-out NX_Set. To deal with this, every NPC with set multipliers (that is, every NPC that is specifically ddefined or has never loaded into the game) has a variable Karma:Multipliers:SetAs that records this. A completely un-set NPC has a value of 0. If the auto system sets them, the value is 1. A specifically-defined NPC is 2. A player override is 3. Higher values are allowed to overwrite lower values, but lower or identical values can not overwrite higher values with the exception of player-set values which can overwrite anything.

 

The auto system works by first cross-checking the NPC's factions and Karma AV against a list of vanilla factions and Karma ranges. The Karma ranges exist to identify faction "outliers", a Legion member working undercover as an NCR officer probably doesn't have the same Karma score as your average NCR member. If their faction and karma match up, the system takes a list of "base" values for that faction, applies a random number between -10 and +10 to each multiplier, and writes them. If the faction and karma don't match, or the NPC is not a member of any vanilla factions, their Karma value is used as the template instead. This will be equation-based so that Karma values edited with FNVEdit to not match one of the five basic types (i.e. setting an NPC's Karma to 750 instead of 900 or 500) is still properly reflected. The player will have the option to disable faction/karma cross-checking and edit the base numbers used in the Karma template equations.

 

The player will, via the MCM menu, be able to spawn in their inventory a series of Misc. Item tokens. These tokens, when placed in any container other than the Player, will allow the Player to overwrite both the auto-set system and any specifically-defined settings to alter the NPC to a "personality" of their choosing. The presets involved are TBD. When the Player first spawns one of these tokens, they will be warned that they could possibly de-rail plotlines by proceeding. For example, if the Player gives a Preset Token "Psychotic Killer" to Bryce from Agent, whenever Bryce does a Karma check his reaction will be counter to the moral values he is shown to have in other dialogue.

 

PART 4: MODIFIERS

While a separate section in terms of overall concept, Modifiers will be set in the same way as Multipliers. Manual modifiers represent a modification independent of other settings and should only be increased or decreased, never directly set, and only by scripted events. There will be tokens that can do this but as a debug feature only, accessible only via the console.

 

PART 5: CONVERSATION

The first issue is determining when NPCs talk to each other. Since FNV doesn't have mudcrabs random in-game NPC conversations this has to be faked heavily. Persistent NPCs can randomly talk to other Persistent NPCs who are in the same cell while the Player isn't in said cell. Non-persistent NPCs are trickier. It will probably work by giving each NPC a list of people they might "talk to" and when they are free to talk, then at those times checking to see if the other NPC is also free to "talk". If a schedule of that sort isn't defined, every NPC in a cell may just quickly "talk" to each other a random number of times when the Player enters the cell that they're in.

 

The second issue is that since we can't detect NPC actions (and they don't do anything that interesting most of the time anyway) we can't really set NPC opinions about each other. So Bob can only dislike Fred unless we specifically specify that he dislikes Fred. An alternative possibility is generating a like/dislike based on the difference between their various multipliers and modifiers.

 

PART 6: IMPLEMENTATION

When the Player starts dialogue, Karma logging stops. In its place, the system quickly gets the conversation target, checks the actions they've seen, puts the multipliers together, adds the modifier, and then sets that to the Karma score so that the Karma checks it.

 

That's the only way I can see to do it at this time, and it has a slew of issues. For one, Karma checks in-game are done on the good/evil scale, not the like/dislike scale, which means someone who would "like" you for being evil is checking for a low number for "evil", whereas the number that would be available would be high because they should "like" you. It also means that by the time the equation runs the first line of the dialogue has already been chosen, so if an NPC starts a conversation with a Karma check you'll always get the Neutral Karma response. Fixing these issues would require a thorough re-working of quite a bit of vanilla dialogue conditions and structure.

 

THE VERDICT

I personally think it's a good concept. I also think it's undoable, since the functions to run it don't exist and if they did I don't think anyone is looking forward to going through every line in the game to change Karma checks or even to balance the multipliers and modifiers in the first place. Also, only being able to check two things is fairly limiting on the system.

 

THE QUESTION

On a scale of 1 to 10, with 1 being Very and 10 also being Very, how insane am I to have sat and wrote down this huge write-up on something that seems largely unfeasible?

 

POSTSCRIPT

I really hate whoever created that emoticon with sunglasses right now.

0 Comments


Recommended Comments

There are no comments to display.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use