Tech demo of quantitatively relating people to verbs using Collections by Dannii Willis

I just wanted to share a somewhat short implementation of verb importance/inclination I came up with making use of Collections by Dannii Willis. Pretty much what the point of this demo is to show an idea similar to Chris Crawford’s design idea of Verb Importance, which globally tracks the importance of verbs so as to keep the story interesting (having fate step in when the average verb importance goes too low). This implementation focuses on verb importance per person instead of globally which I think also helps with AI planning, so you can get more variance between characters in what actions they choose, since different NPCs will have different relationships to verbs.

How this is done is quite simple, maps are assigned to every person which contains every action name and a real number representing how much the character likes (positive numbers) or dislikes (negative numbers) the action, with 0 representing neutrality. This is then made use of as an example of how it might be implemented to show a character who will only do actions they at least feel neutral about when the player asks them. This could very easily be applied to NPC planning where they choose actions they consider the verb inclination of the actions they are considering when they choose an action to perform.

Additionally this example also shows the use of Perceived verb inclination where characters also have another map which maps each person to every action name by a real number. This represents how much the character thinks that another character likes an action. In this demo this is only used to ask a character what actions they think another character likes but could also be used in planning as a modifier to select the action that the actor thinks the direct object of the action would like.

Like with the other demo I’ve shared it’s nothing crazy, I’m not sure if someone else has already done something similar. But I mainly wanted to share to hopefully demonstrate one sort of design approach I found interesting and maybe others can make use of this. This approach is also very helpful in modeling other sorts of personality aspects, a very similar example which I probably won’t share since it’s too similar is using this technique to model the friendship and perceived friendship of people.

Code
Lab is a room. Here is a person called Gwen. Here is a person called Bob.

Every person has a collection reference called verb inclination map.

Every person has a collection reference called perceived verb inclination map.

When play begins:
	repeat with p1 running through persons:
		now the verb inclination map of p1 is a new map;
		now the perceived verb inclination map of p1 is a new map;
		repeat with p2 running through persons:
			set key p2 of perceived verb inclination map of p1 to a new map;
			repeat with v1 running through action names:
				set the verb inclination of p1 to v1 to 0;
				set the perceived verb inclination of p1 of p2 to v1 to 0;
	set the verb inclination of Gwen to the jumping action to -0.5;
	set the verb inclination of Gwen to the Waving hands action to 0.5;
	set the perceived verb inclination of Gwen of Bob to the Waving hands action to 0.9.
					
Part - Verb Inclination

To set the verb inclination of (p1 - a person) to (v1 - an action name) to (# - a real number):
	  (verb inclination map of p1) => v1 = #.

To increase the verb inclination of (p1 - a person) to (v1 - an action name) by (# - a real number):
  (verb inclination map of p1) => v1 = the verb inclination of p1 to v1 plus #. 

To decrease the verb inclination of (p1 - a person) to (v1 - an action name) by (# - a real number):
  (verb inclination map of p1) => v1 = the verb inclination of p1 to v1 minus #. 

To decide what real number is the verb inclination of (p1 - a person) to (v1 - an action name):
  decide on (verb inclination map of p1) => v1 as a real number.

Part - Perceived Verb Inclination

To set the perceived verb inclination of (p1 - a person) of (p2 - a person) to (v1 - an action name) to (# - a real number):
	  (perceived verb inclination map of p1 => p2) => v1 = #.

To increase the perceived verb inclination of (p1 - a person) of (p2 - a person) to (v1 - an action name) by (# - a real number):
  (perceived verb inclination map of p1 => p2) => v1 = the perceived verb inclination of p1 of p2 to v1 plus #. 

To decrease the perceived verb inclination of (p1 - a person) of (p2 - a person) to (v1 - an action name) by (# - a real number):
  (perceived verb inclination map of p1 => p2) => v1 = the perceived verb inclination of p1 of p2 to v1 minus #. 

To decide what real number is the perceived verb inclination of (p1 - a person) of (p2 - a person) to (v1 - an action name):
  decide on (perceived verb inclination map of p1 => p2) => v1 as a real number.

Part - Verbs for testing

Before an actor doing something when the actor is not the player:
	let v1 be the action name part of the current action;
	if the verb inclination of the actor to the action name part of the current action > 0:
		say "[The actor] says, sure, I like [v1].";
		continue the action;
	otherwise if the verb inclination of the actor to the action name part of the current action is 0:
		say "[The actor] says, I feel neutral about [v1], but I guess I'll do it for you.";
		continue the action;
	otherwise if the verb inclination of the actor to the action name part of the current action < 0:
		say "[The actor] says, no,  I don't like [v1].";
		stop the action.

Asking it about the action inclination of is an action applying to two things.

Understand "Ask [someone] about the verb inclination of [someone]" as asking it about the action inclination of.

Carry out asking someone(called the person asked) about the action inclination of someone(called the person asked about):
	let x be a list of action names;
	repeat with a running through action names:
		if the perceived verb inclination of person asked of person asked about to a > 0:
			add a to x;
	say "[The person asked] says, I think [The person asked about] likes [x]"

Persuasion rule for asking people to try doing something:
	rule succeeds.

Test me with "Gwen, wave/Gwen, look/Gwen, jump/Ask Gwen about the verb inclination of Bob".

[Note on the code you need to Include Collections by Dannii Willis for it to work, Include statements don’t work for me on Borogove so I just copy paste it in and didn’t want to needlessly include that with the code I’ve written so you will need to either use the include statement or paste in Collections yourself.]

5 Likes