Bots Query Mode

Bases

Here the current subject is bots query mode specification. Query mode by keywords has been chosen. Each bot possesses a set of words, with which are associated answers.

Example 1. A bot whose name is Raoul and who is a baker

        Name -> My name is Raoul.
        Job  -> I am the baker.
      

Each bot will have to answer the following keywords:

Whereas the first two keywords are static, the following ones will be dynamic and will rely on bot memory. However, we have to nuance the staticity of the first two ones: a creature can lie or change job.

Example 2. Raoul is a baker who lives in North Midgaard

        >Raoul
        Bot: Raoul the baker is a vile enemy of mine.
             You can find it in the vicinity of North Midgaard.
        >Marcel
        Bot: I don't know that.
      

Keywords should also allow to move forward in a conversation:

Example 3. Keywords in conversation

        >Job
        Raoul: I am the baker.
        >baker
        Raoul: I cook breads, pies and cakes.
        >cakes
        Raoul: My cakes are the best in Midgaard.
      

But they can also be used as the thread of a quest:

Example 4. Keywords in a quest

         >treasure
         Old Pirate: I had a map but I sold it to an adventurer called Raoul.
         (...)
         >treasure
         Raoul: I have only half of the map. Robert has the other part.
         (...)
         >treasure
         Robert: I have the other part of the map.
      

Active Bots

Until now, we considered bots as completely passive, only answering players queries. But there is no reason and to the contrary bots should be more active in conversation.

They can propose discussion subjects (talk about the weather, local news), start a discussion with a passer-by (be it player or not), especially if the bot has something to sell.

Example 5. Meeting with a guard

A guard meet Janselmeer. He does not know who he is. So he is asking Janselmeer.

                A guard is approaching.
                Guard: What's your name, stranger?
        case 1: >Janselmeer
                Guard: I am watching you, Janselmeer.
        case 2: >Oumph
                Guard: I am watching you, Oumph.
      

Janselmeer can say his true name (1) or not (2). Both answers will be accepted by the guard. Janselmeer will be known until that moment under the name he gave (Janselmeer or Oumph) by this guard, and potentially by other people in town.

Now, let's take this example again but the guard already knows the name of Janselmeer.

Example 6. Meeting with a guard (2)

                A guard is approaching.
                Guard: What's your name, stranger?
        case 1: >Janselmeer
                Guard: I am watching you, Janselmeer.
        case 2: >Oumph
                Guard: You lie! I know that you are not Oumph.
                A guard attacks you.
      

Here, the guard waited 'Janselmeer' as an answer. Any other answer, for instance 'Oumph', can be interpreted as a lie by the guard.

This examples allows to touch two new aspects. First is the temporary addition of extra keywords. In the example above, it's Janselmeer which has been added.

Second is the more interesting integration of player answers into the bot memory. In the examples, the guard will remember that the name of the player is Janselmeer. Of course, nothing prevents lying but the example shows incurred risks in a simplified way.

It can happen that one does not wish to answer questions. In this case, a creature can use the keyword JOKER to mean it.

The lack of an answer (after a limited time) could be considered as a refusal to communicate too.

Players will generally use the second solution and bots the first one. If players have to use JOKER, it would be better to alias it as "..." (or something else) in the UI, that is more explicit.

Communication between bots

Let us apply what we previously defined to communication between 2 bots. Let us go over the guard example again.

Example 7. Meeting with a guard (3)

As seen by the player, it should give the following:

        Guard to Bot: What's your name, stranger?
        Bot to Guard: My name is Bot.
        Guard to Bot: I am watching you Bot.
      

As seen by a bot:

        Guard to Bot: Name
        Bot to Guard: Bot
        Guard to Bot: ""
      

The main difficulty to achieve this is that the guard does not know that he talks to a bot. The one whom the guard talks to should be able to understand whether it is a bot or a player.

In order to make sure he is understood, the guard must therefore speak to his interlocutor in a way understandable by players and non-players alike. Moreover, if there are other creatures who listen to the conversation, they will hence be able to understand too, whether they be bots or players.

The solution that the example suggests is to integrate into a message both the short version interpretable by bots (corresponding to keywords), as well as a long version for players.

Example 8. Meeting with a guard (4)

As seen by the game:

        Guard to Bot: ("Name", "What's your name, stranger?")
        Bot to Guard: ("Bot", "My name is Bot.")
        Guard to Bot: ("", "I am watching you Bot.")
      

When a bot or a player sends a message which can not be understood or which does not need an answer, the short version will be empty. No processing will then be done in order to interpret the message. On the other hand, it could be repeated.

Example 9. Meeting with a guard (5)

As seen by the game:

        Guard: Now you die, Raoul!
        Message ("", "Now you die, Raoul!")
      

Example 10. The grocer

        Grocer: Look at my beautiful waterskins! Buy them!
(a priori destined only to players, unless bots are uncannily clever)
        Message ("", "Look at my beautiful waterskins! Buy them!")
      

Application to user interface level

The player has two ways of sending messages:

Control codes

In order that the bots could understand one another better, we add return codes NONE, ANS, WRONG_ANS and BAD_ANS. These codes are not readable by players and cannot be used directly by players either (the 'answer' commands will allow to send a message with the control code ANS). So the codes using is reserved to bots.

NONE is the default control code. It does not mean anything. It is employed when no other control code is used.

The code ANS means that the message is an answer to a previous question.

WRONG_ANS is used to point out that the answer is regarded as wrong and deceitful. The interlocutor can therefore give another chance to say the truth (or rather what the bot considers as the truth), change topic of conversation or break the discussion with troublesome consequences (fight, reputation drop...).

Example 13. A guard is questioning a player

        A guard is approaching.
        Guard: What's your name, stranger?
        (name, "What's your name, stranger?", NONE)
        >Janselmeer
        ("Janselmeer", "Janselmeer", ANS)
        Guard: You lie! I know you are not Janselmeer.
        ("", "You lie! I know you are not Janselmeer.", WRONG_ANS)
        >Oumph
        ("Oumph", "Oumph", ANS)
        case 1:
          Guard: You lie! I know that you are not Oumph.
          ("", "You lie! I know that you are not Oumph.", WRONG_ANS)
          A guard attacks you.
        case 2:
          Guard: I'm watching you Oumph.
          ("", "I'm watching you Oumph.", NONE)
      

It is advisable to limit the number of possible tries... BAD_ANS marks that the answer is incorrect, inconsistent with the answer type which was expected.

Example 14. A guard is approaching

        A guard is approaching.
        Guard: What's your name, stranger?
        (name, "What's your name, stranger?", NONE)
        >43
       	("43", "43", ANS)
        Guard: "I said 'What's your name?'."
        ("", "I said 'What's your name?'.", BAD_ANS)
      

A BAD_ANS code generated by a bot is a serious error in the game code or in the bot code. An error log must be made for debugging and correction.

A BAD_ANS code generated by a player means a typo, a bad understanding of the question, a voluntary lie, a try at disturbing the bot, etc.

The coder is free to make its bot react as she thinks best (polite and understanding, nervous and aggressive, etc). So the bot can repeat its question or not.

Note

the bot cannot and should not know whether it speaks to another bot or to a player. This is the reason why the number of BAD_ANS answers must be limited, in order to prevent buggy bots to induce infinite loops...

Expression modifiers

An Expression Modifier is a context information going with the message. This information is relevant for the bot receiving the message and help him decide how to react.

For example, there are several ways to ask somebody its name:

Each time, only the expression modifier changed. Below are the same messages understood by bots:

POLITE, NEUTRAL and INSULTING are Expression Modifiers. Here is a list of expression MODIFIERS:

This list is not closed.

The following example explains how Expression Modifiers could be used. Janselmeer meets Robert the butcher (Raoul's brother) and asks him about Raoul the baker.

Example 15. Expression modifiers

	Janselmeer: (RAOUL, "Do you know RAOUL?", NONE, NEUTRAL)
        Robert:  ("", "I am not concerned with that RAOUL.", ANS, RUDE)
	Janselmeer: (RAOUL, "O MIGHTY ONE, may I beg you a little of your
                     knowledge about Raoul?", NONE, OBSEQUIOUS)
        Robert: ("", "RAOUL? This thing exists only in your sick mind.",
                 ANS, INSULTING)
	Janselmeer: (RAOUL, "Tell me something about Raoul or I'll kill you!",
                     NONE, THREATENING)
        Robert: ("", "I swear I don't know Raoul.", ANS, NEUTRAL)
        Janselmeer punches at Robert.
	Janselmeer: (RAOUL, "Tell me something about Raoul or I'll kill you!",
                     NONE, THREATENING)
        Robert: ("", "Raoul is the baker. He lives North of here. Please don 't
                 kill me!", ANS, POLITE)
      

There is no obligation using an Expression Modifier whether another. It is a pure matter of roleplay. Some people are used to be rude and some others are used to be polite only because it is their way. But of course creatures may not have the same reaction with the first than with the second. It depends on them. For example, a lord is normally used to be talked obsequiously and may be offended by someone that would act differently. So the choice of an expression modifier depends on both the personality of the character that is speaking and the expected reaction of the character that is listening.

Future extensions of bots language

The keywords system has been chosen on grounds of simplicity of implementation. Nevertheless, this should evolve and lead towards a true dialog with complete sentences (subject, verb, complement).

The first extension to keywords could be the use of interrogative pronouns and adverbs: what, who, where, why, how, how many, which, when.

Example 16. Pronouns

        >Who Raoul
        Bot: Raoul is the baker.
        >Where Raoul
        Bot: You can find it in the vicinity of North Midgaard.
        >What Raoul
        Bot: I've never heard of this.