Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 47

Crafting Conversation Starters: Friends vs. Strangers

Recommended resources

Hello! Welcome back.

In our last lesson, we designed the blueprint for our entire social system by creating a formal JSON schema for conversation packs. We established a clear Pack -> Topic -> Interaction hierarchy that will keep our dialogue organized and mod-friendly.

Today, we're moving from blueprint to construction. We will use that schema to create the very first pieces of social content for our game. Our goal is to create two starter conversation packs, friends.json and strangers.json, populating them with distinct topics and interactions. This is a crucial step that brings our data-driven design to life and provides the raw material our game engine will use to generate dynamic social situations.


1. The Importance of Social Context

Before we start writing our JSON files, let's consider the design philosophy. In a deep life simulation, characters shouldn't have the same conversation options with a total stranger as they do with their best friend. The available interactions should change based on the social context. This is what makes relationships feel meaningful and earned.

To see how a major studio approaches this, let's draw some inspiration from the design of The Sims 3.

Modeling Individual Personalities in The Sims 3

This GDC talk by Richard Evans, the AI lead for The Sims 3, provides fantastic insight into how personality and social situations drive character behavior. It will give us a strong conceptual foundation for why we're building separate packs for 'Friends' and 'Strangers'.

Please watch the segment from 00:27:32 to 00:33:32. Focus on how a Sim's available actions change when they are a 'guest' in another Sim's house. Notice how the system discourages 'inappropriate' actions. This is the exact principle we are applying: the relationship between two characters defines what is appropriate to talk about.

As the video explains, a Sim's understanding of a social situation dynamically adds or removes potential actions. Our 'Strangers' and 'Friends' packs are the first step in modeling this. A 'Stranger' context will offer a limited set of "safe" topics, while a 'Friend' context will unlock deeper, more personal conversations.

The end goal is a UI that reflects this context, much like in this example from The Sims 4.

The Sims 4 Conversation UI Example
This image shows how a top-level category like 'Friendly...' can branch into more specific topics such as 'Interests...', 'Hobbies...', and 'Gossip...'. This is precisely the structure we are building with our JSON files.


2. Creating the "Strangers" Conversation Pack

Let's begin with the more restrictive scenario: two Sims who are acquaintances or strangers. Their conversations will be focused on introductions and safe, generic small talk.

For inspiration on what these interactions could be, we can look at extensive lists compiled by the community.

Interactions List: All Types of Sims 4 Socials In One Place!

This page from SnootySims provides a comprehensive list of social interactions from The Sims 4. It's a great resource for brainstorming the kinds of topics and specific interactions we can include in our packs.

Skim through the 'Friendly socials' section, particularly the sub-categories for 'Small Talk' and 'Uncategorized' (which contains introductions). These are perfect examples for a 'Strangers' pack. You don't need to read every single item, just get a feel for the types of interactions listed.

Now, create a new folder structure in your project's root: data/conversations/. Inside this folder, create a new file named strangers.json.

We will structure this file according to the conversation_pack_schema.json we created in the last lesson. Let's start with two simple topics: "Introductions" and "Small Talk".

Copy the following code into your strangers.json file.

{
  "id": "pack_strangers",
  "name": "Getting to Know You",
  "conditions": {
    "relationship_type": "Acquaintance"
  },
  "topics": [
    {
      "id": "topic_introduction",
      "name": "Introductions",
      "interactions": [
        {
          "id": "interaction_friendly_introduction",
          "prompt": "Friendly Introduction",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 5 }
          ]
        },
        {
          "id": "interaction_ask_name",
          "prompt": "Ask Name",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 2 }
          ]
        }
      ]
    },
    {
      "id": "topic_small_talk",
      "name": "Small Talk",
      "interactions": [
        {
          "id": "interaction_ask_about_day",
          "prompt": "Ask About Day",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 3 },
            { "type": "mood_change", "value": 1 }
          ]
        },
        {
          "id": "interaction_talk_about_weather",
          "prompt": "Talk About Weather",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 1 }
          ]
        }
      ]
    }
  ]
}

Analysis of the strangers.json file:

  • "id": "pack_strangers": A unique ID for our Rust code to identify this pack.
  • "name": "Getting to Know You": The user-facing name for this group of topics.
  • "conditions": { "relationship_type": "Acquaintance" }: This is the crucial filter. Our Rust engine will only make this pack available if the relationship between two characters is "Acquaintance".
  • topics: We've defined two simple topics, each with a couple of interactions and their corresponding outcomes on the friendship score.


3. Creating the "Friends" Conversation Pack

Now for the fun part. As a relationship develops, more personal and engaging topics should become available. The "Friends" pack will reflect this by including a wider variety of deeper topics.

Go back to the SnootySims interaction list and look at the more substantial "Friendly" sub-categories like "Deep Thoughts", "Hobbies", "Gossip", and "Stories". These represent the kinds of conversations friends have.

Create a second file in your data/conversations/ folder named friends.json.

This pack will be larger, demonstrating how the conversation system expands. We'll include some small talk but also add topics for sharing interests and having deeper conversations.

Copy the following code into your friends.json file.

{
  "id": "pack_friends",
  "name": "Friendly",
  "conditions": {
    "relationship_type": "Friend"
  },
  "topics": [
    {
      "id": "topic_catch_up",
      "name": "Catch Up",
      "interactions": [
        {
          "id": "interaction_ask_about_day",
          "prompt": "Ask About Day",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 5 },
            { "type": "mood_change", "value": 2 }
          ]
        },
        {
          "id": "interaction_share_good_news",
          "prompt": "Share Good News",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 8 },
            { "type": "mood_change", "value": 5 }
          ]
        }
      ]
    },
    {
      "id": "topic_share_interests",
      "name": "Share Interests",
      "interactions": [
        {
          "id": "interaction_discuss_hobbies",
          "prompt": "Discuss Hobbies",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 6 }
          ]
        },
        {
          "id": "interaction_talk_about_latest_book",
          "prompt": "Talk About Latest Book",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 4 }
          ]
        }
      ]
    },
    {
      "id": "topic_deep_conversation",
      "name": "Deep Conversation",
      "interactions": [
        {
          "id": "interaction_share_secret",
          "prompt": "Share Secret",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 15 },
            { "type": "relationship_change", "target": "romance", "value": 2 }
          ]
        },
        {
          "id": "interaction_give_relationship_advice",
          "prompt": "Give Relationship Advice",
          "outcomes": [
            { "type": "relationship_change", "target": "friendship", "value": 10 }
          ]
        }
      ]
    }
  ]
}

Analysis of the friends.json file:

  • "conditions": { "relationship_type": "Friend" }: This pack is specifically for characters who have achieved "Friend" status.
  • Richer Topics: Notice the topics are more personal ("Deep Conversation") and specific ("Share Interests") than the ones in the strangers pack.
  • Higher Impact Outcomes: Interactions like "Share Secret" have a much larger impact on the friendship score, reflecting the significance of such moments between friends.

You have now created the foundational content for your social system. Feel free to expand these files with more topics and interactions based on the inspiration from the resources or your own ideas!



Conclusion

Excellent work. You've successfully translated our abstract schema into concrete, game-ready data. By creating these two distinct packs, you've implemented the core design principle of context-aware social interaction.

Key Takeaways:

  • Content Creation: We created two starter conversation packs, strangers.json and friends.json, populating them with content that reflects their distinct social contexts.
  • Data-Driven Design in Practice: You saw how easy it is to add new topics and interactions by simply editing a JSON file. This demonstrates the power and flexibility of a data-driven approach for game content.
  • Contextual Filtering: The conditions field in each pack is the key to creating a dynamic social system that evolves as relationships change.

In our next lesson, we will move to the frontend. We'll build the conversation UI in Unity that can load this data from the Rust backend and present the correct packs, topics, and interactions to the player.