Fifty times fifty times fifty Ways to Leave Your Lover

Okay not THAT many.

I need help thinking a problem through. I’ve come up with a couple preliminary solutions but I want to make sure I’m doing this in a flexible manner.

What I’d like is something like what you see in Bronze. (I’m going to be vague here to avoid spoilers.) Once you’ve reached a certain point in the game, you’re able to hear the thoughts of another character as you visit rooms in the castle.

I’d like to be able to provide an NPC’s thoughts as the player progresses through an area – but the real catch here is that the way the player solves puzzles and interacts with her environment affects the NPC’s disposition, and therefore affects what the NPC will say in many if not all situations.

I think I’d also like to be able to have the player “poke” the NPC to evoke their response – though there will be moments when the NPC volunteers information without the player’s prompting.

One of my solutions so far provides two new values, mood (encouraging, flirtatious, suspicious) and passion (idly, nominally, effulgently). (The idea here is that a player can behave in a way to make the NPC suspicious, but there are certain kinds of behavior that are more suspicious than others.)

Then I create two verbs: one for getting general information (“What are you thinking?”) and another for getting specific info (“What do you think about THIS?”) So call them something like “poking” and “poking about [something]”.

Then I create two tables.

Table of General Reactions location passion mood response Test Room idly encouraging "blah" Test Room nominally encouraging "--" Test Room effulgently encouraging "--" Test Room idly flirtatious "--" Test Room nominally flirtatious "--" Test Room effulgently flirtatious "--" Test Room idly suspicious "--" Test Room nominally suspicious "--" Test Room effulgently suspicious "--" Another Room (and so on)

And then a Table of Specific Reactions for each item or concept the player can ‘poke about’.

However, this seems really unwieldy. Also, I can’t figure out the proper syntax for sorting through the tables to make sure that, when the player pokes, we’re choosing the right row for the NPC’s current mood & disposition for the right location.

Are tables even the best solution here? I feel like they probably are but maybe I’m missing something obvious. Anyway… any suggestions?

EDIT: I should add that there will only ever be 1 NPC whose thoughts will be communicated to the player.

Bronze’s source is online, IIRC, so that might be a place to look.

I’m not sure I fully understand the problem, to be honest, so I’m going to reiterate a bit and you can tell me where I went wrong.

  1. The player needs to be able to check the general status of the NPC. I’d use a to say phrase here:

to say NPC-status: if the NPC is furious: say "I am furious!"; etc.

  1. The player needs to be able to ask the NPC’s position on certain things. I’d say this varies a lot - a relation might work, if how the NPC feels about different things is varying constantly. A simple way to do it would be to write a topic table, where the responses vary a bit depending on the NPC:

Table of Responses topic response black "That's an [if NPC is furious]appropriate [otherwise]awfully dark [end if]color."

  1. The NPC will say things in preset areas at preset times. If these are the same things as hir status or responses, it’s easy enough. Otherwise, it’s a bit tougher - as you note, the permutations are what’ll get you. If the things zhe says are based solely on hir emotional status, I think say statements are your friend again.

To say Test-Room-response: if NPC is furious: if NPC is suspicious: say "I am suspicious and furious!"; etc.

If the NPC is responding to puzzle solving: you might be able to cut way down on this stuff with making puzzles scenes, and then have them end in different ways.

To say Test-Room-response: if Taking Out the Trash ended badly: say "'You can't even be trusted to take out the garbage?'";

You might be able to get away with writing a sort of outline phrase and then inserting appropriate modifiers or verbs at specific times:

say "'I [if NPC is not suspicious]love[otherwise]am going to kill you[end if], Dave.' HAL[if NPC is furious]'s red eye bores into you[otherwise] murmurs calmly[end if]."

These short substitutions can save time, although they’re essentially the same thing as above.

If you decide you have to do the nested say phrases, you can set up a template ahead of time with all the permutations and fill it in as you go, which is helpful.

It’s possible to do this with a set of tables; if you have a complete set of room/passion/mood filled in, you can check that you’re on the right row something like this:

repeat through the Table of General Reactions: if the location entry is the location and the passion entry is the passion of NPC and mood entry is the mood of NPC: [this is the right row] say "[response entry][paragraph break]"

This isn’t how I’d do it myself, however. If your writing approach is like mine, odds are good that you won’t actually have unique text for every passion/mood combination for every item and room in the game. Sooner or later, you may find yourself wanting to consolidate, with some default reactions and then a couple of specialized ones.

Using text substitutions as gravel suggests might be useful if the text you’ve got in mind is short and the variations are easy to understand; for long passages or for very complex conditions it can get hard to parse.

So my inclination would be to rely on rulebooks instead, which are great for combining defaults and specialized reactions, and do the sorting for you. YMMV, but here’s what I’d do:

[code]Living Room is a room. It contains a silver beanbag chair, a coffee table, and an art book. The description of the art book is “It’s a collection of Rothko plates. You don’t really get this stuff but it makes you feel good to have it out on the table.”

Maya is a woman in the living room. Maya can be happy, suspicious, or jealous. Maya is happy.

Reporting emotions about something is an activity.

Rule for reporting emotions about something:
say “‘I don’t care about that.’”

Rule for reporting emotions about something (called target) when Maya is jealous:
say “‘What, is [target] a gift from your ex too?’”

Rule for reporting emotions about the silver beanbag chair:
say “‘It’s a little over the top, isn’t it?’”

Rule for reporting emotions about the art book:
say “‘Yeah, I know that was a gift from your ex.’”

Rule for reporting emotions about the art book when Maya is suspicious:
say “‘I don’t know why you’re so obsessed with that thing. You don’t even like art! I bet it’s because your ex gave it to you.’”

Rule for reporting emotions about the art book when Maya is jealous:
say “‘I swear, if we have one more conversation about your ex’s [’]cosmopolitan tastes,[‘] I’m going to leave you.’”

After doing something other than poking about with the art book:
if Maya is suspicious, now Maya is jealous;
if Maya is happy, now Maya is suspicious;
continue the action.

Understand “poke about [something]” as poking about. Poking about is an action applying to one thing.

Report poking about something:
carry out the reporting emotions about activity with the noun.

Test me with “poke about art book / poke about beanbag chair / poke about table / x art book / poke about art book / get art book / poke about art book / poke about table”.[/code]

My suggestion here is to have a single poking about action, and re-direct the nounless one to it:Understand "poke" or "poke about" as poking about. Rule for supplying a missing noun while poking about: change the noun to nothing in particular. There is an object called nothing in particular.This gives benefits down the road, for example, when using constructions like “when we have poked about the art book” or “when we have poked”. (Or perhaps you’d change the noun to the location, whichever.)

To extend Em’s example, if those adjectives are on the same person, I think your rules can combine adjectives like “when Maya is idly suspicious” which would save typing. I think.

I recommend one table, the first column being of type “object” rather than the more specific room and thing. You can stick both rooms and things into an object column. Again, makes the code neater. But yeah, I am fond of the table, possibly in conjunction with the rulebook idea – say, the first rule checks the table for a super-specific response, then the other rules try various combinations. Finally a last rule that says something regardless. And I don’t see the need for making a separate activity/rulebook for it. The Report Poking About rulebook should suffice. Off the top of my head, with copy-pasta for dessert:[code]
First report poking about:
repeat through the Table of General Reactions:
if the subject entry is the noun and the passion entry is the passion of NPC and mood entry is the mood of NPC:
say “[response entry][paragraph break]” instead. [ remember the “instead”! ]

Last report poking about:
say “‘I don’t care about that.’” instead.

Report poking about the art book when Maya is suspicious:
say “‘I don’t know why you’re so obsessed with that thing. You don’t even like art! I bet it’s because your ex gave it to you.’” instead.

[…and so on…]
[/code]

Perhaps an Every Turn rule that fires if Poking About hadn’t happened recently. I’m unsure if “Every turn when we have not poked about for 10 turns: try NPC poking about a random thing in the location.” would work, but if it did it should suffice. (If it doesn’t work, it’s probably cause of the “not”. In which case, use a variable that increases by one every turn.)