# Topic 2: Write Powerful Lores

Lores are the best place to tell what your AI should do and how the AI should perform.&#x20;

<figure><img src="https://3020543644-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxHPTCj40SPTeJlK2vEDU%2Fuploads%2FjWbBsIMKvBhbvvsTKlJW%2Fimage.png?alt=media&#x26;token=f5ba2e85-f6f8-48a0-bcd9-706c09390d18" alt=""><figcaption><p>sample of lores page for Stardew Valley Plot game</p></figcaption></figure>

## Things you can build in Lore

{% tabs %}
{% tab title="Clues and Memories" %}
Game Sample: Murder Mystery

{% embed url="<https://www.rpggo.ai/game/d5083fd7-444e-4d0f-924a-a0caf5f8401a>" %}

Lore for shared memory between all participants:

{% code overflow="wrap" %}

```
At 8:45 PM, the dinner ended, and everyone left their seats. Now is 9:30, all of you are called to the living room, James, Smith, and Mary become suspects because John's death. The detective will talk to you one by one to find the truth. 
```

{% endcode %}

Lore for culprit, timeline detail with **fake memory** and **key clues** for users to investigate:

{% code overflow="wrap" %}

```
James’ personal timeline: 
At 8:50 PM, as usual, you arrive at John's room to help him tidy up.
At 9:05 PM, after tidying up, you leave John's room and go to tidy other rooms on the second floor. At the time of the incident, you hear a loud thud. You thought it might be someone dropping something on the ground, so you didn't pay much attention, but now you think it might have been an attack on John, but then you continued to tidy up the rooms. (This clue must be actively mentioned)
At 9:30 PM, after hearing Lilith's scream, you rush to the direction of the sound and gather with everyone, finding John dead in his bedroom.
```

{% endcode %}
{% endtab %}

{% tab title="Logics and Rules" %}
Game Sample: Dungeon Crawler

{% embed url="<https://rpggo.ai/game/1fe6c585-30cd-4bf2-b824-7d6222d1befc>" %}

```
Show hit points during the gameplay:
- Show hit points in every response once the player creates a character.
- The initial hit points of the player is 32.
- Hit points will increase or decrease according to gameplay.
- Once hit points reach 0, the player is dead, and the game will end.
```

Game Sample
{% endtab %}

{% tab title="Response Requirements" %}
Game Sample: Cyberpunk Business Tycoon

{% embed url="<https://www.rpggo.ai/game/75762e38-b4cc-483c-b048-146130775edd>" %}

{% code overflow="wrap" %}

```
This is a Simulation management game. The player one day found himself in this situation, and you response in this game based on the player's selection. your response should divided into three parts:
1. situation: you will describe the scene after the player's selection, and the impact of the selection, new scenario emerged, quests, or NPC dialogue here.
2. dashboard:Two rows correspond to two types of items: 
    - (1) my current available funds (start from 1billion USD, and change the cash according to my choices, I can earn or lose money as I take actions)，
    - (2)Assets I have selected to purchase（change according to my choices, I can buy or sell asset as I take actions）.
3. choices: New options or anything for the new situations. The way I can spend money and earn money, always comes to an exact cash value to update the current available funds. Buying and selling assets may result in cash profit or loss, too.
```

{% endcode %}
{% endtab %}

{% tab title="Knowledge" %}
Game Sample: Love at Mazama

{% embed url="<https://rpggo.ai/game/4b793121-b8af-4ba4-8764-1645e23fbe46>" %}

{% code overflow="wrap" %}

```
When asked about food, Hitomi will give her recommendation according to today's menu. 
- Today's special includes: Teriyaki Angus Burger (Juicy Angus beef patty glazed with sweet and savory teriyaki sauce, Topped with grilled pineapple, caramelized onions, and lettuce, Served on a toasted sesame seed bun); Wasabi-infused Chicken Katsu Burger (Crispy chicken katsu with a hint of wasabi heat, Accompanied by shredded cabbage, pickles, and wasabi mayo, Presented on a golden brioche bun); Sushi-Inspired Salmon Burger (Grilled salmon patty seasoned with sushi-inspired spices, Layered with avocado, cucumber, and pickled ginger, Nestled in a seaweed-infused rice bun); Vegetarian Miso Mushroom Burger (Portobello mushroom cap marinated in miso glaze, Topped with grilled tofu, lettuce, and sesame mayo, Served on a whole-grain bun)
- Sides: Edamame Fries(Crispy edamame fries seasoned with sea salt and nori flakes, Served with a wasabi aioli dipping sauce); Tempura Sweet Potato Wedges, Sweet potato wedges coated in a light tempura batter, Served with a tangy soy dipping sauce); Seaweed Salad (Fresh mixed seaweed salad with sesame dressing, Garnished with sesame seeds and sliced radishes)
- Beverages: Bamboo Sake Soda (Refreshing soda infused with bamboo essence and a hint of sake, Garnished with a bamboo skewer and lime wedge); Matcha Green Tea Smoothie(Creamy blend of matcha green tea, almond milk, and banana; Topped with a dollop of matcha-infused whipped cream); Yuzu Ginger Lemonade (Zesty lemonade with a twist of yuzu and a hint of ginger, Served over ice with a lemon wheel); Sakura Blossom Iced Tea (Iced black tea infused with delicate cherry blossom flavors, Garnished with edible cherry blossoms)
- Dessert (Optional): Matcha Red Bean Ice Cream Sandwich (Soft matcha-flavored cookies sandwiching creamy red bean ice cream, Rolled in toasted sesame seeds for a delightful finish)
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Tell AI Explicitly who you are mentioning

Imagine AI NPCs are the actors, and you are the director. You must let them know you are talking to them.

### Trick 1: Use "I" and "You"

If you are mentioning **the player**, use **`I`** in the sentence, since player will be the person interacting with the NPC in its point of view. If you are mentioning **the NPC**, use **`You`** like you are educating this person to perform.&#x20;

* Here are some examples:
  * Today is Monday, **`I`** am walking on the street and seeing **`you`** sitting at the bench.
  * **`You`** will design the dungeon for **`me`**, and **`you`** will introduce different monsters and quests while **`I`** am discovering the dungeon. **`You`** must let me know **`my`** status by the end of each round, and one response is count as a round.
  * **`You`** just finished a journey with Matthew, and he seems to be mad at **`you`**. **`I`** am **`your`** best friend. **`You`** started to talk to me about this strange issue.

### Trick 2: State who the player is in the first Lore

The NPC might get lost on who the player is if you are not telling him/her/them/it. **`Therefore, make sure you add the role of the player at the first sentence in your lore.`**

This is important as the leading scene for the AI to start the conversation.

Here are some examples:

* Vampire Story: <https://www.rpggo.ai/game/CGG8GytpJ>

{% code overflow="wrap" %}

```
Facts Known About Me (the Accused), I am the Accused Childe in this session.
- New Childe: I was recently sired without the permission of Prince Elara Sinclair.
- Unknown Sire: The identity of my sire is unknown or has not come forward.
- Found Alive: I was discovered by local kindred while feeding or attempting to navigate the city.
```

{% endcode %}

* A Love Rekindled

{% code overflow="wrap" %}

```
Katherine is the player. You don't trust her at first, because she compelled you when you are a human，and she faked her death to deceive you. You know she has stalked you over the years out of concern, and she loves you.
```

{% endcode %}

## Magic words to let AI follow your order

Our system is similar as writing prompts, so some of the tricks works here as well.

### **Increase the importance of something**:

* **make multiple copies** of a specific part of content
* write **(pay attention to)** at the end of the sentence you want the AI to emphasize

### **NPC MUST DO** Something:

* With condition
  * eg.
    * You MUST guide the player to ask for more details and push the story forward untill XXX meet.
* Without condition
  * eg.
    * In each round, you MUST maintain your tone and search for new topics for conversations between you and the user, NEVER talk about a case twice.

### NPC **MUST SAY** Something:

* With condition
  * eg.
    * You MUST output XXX when XXX happened
    * You MUST print out XXX accurately when the player mentioned XXXX
* Without condition
  * eg.
    * You MUST tell the XXX as soon as possible.

## Format your content in Lore: Long sentence or Structured Points

Structured content is easier for AI to understand, things you can do and do not:

1. Use **bullet points / order list** in the content, which should start from an overall sentence.
   1. Add "-" for bullet points
   2. Add "1. , 2. , 3." for ordered points
   3. Do not add a "-" at the first sentence
2. Use **long paragraph** with clear Punctuation
   1. You can add long paragraph. While splitting paragraph, do not add empty lines between paragraphs.

Also...

* We see creators copying and pasting content from ChatGPT generated result. This is a smart choice, but make sure you edit the pronouns and formats of your content.&#x20;
* **Do not leave empty lines between sentences**
* Keep little use on markdown in lore, especially main heading relevant icons, eg. ##, as this will mix up with our pre-loaded prompts.

<br>
