# Game

## List Games (V1 Only)

### Lists the currently available games, and provides basic information about each one such as the owner and availability. <a href="#lists-the-currently-available-games-and-provides-basic-information-about-each-one-such-as-the-owner" id="lists-the-currently-available-games-and-provides-basic-information-about-each-one-such-as-the-owner"></a>

`POST` `https://api.rpggo.ai/open/game/gamelist`

**Request Body**

| Name     | Type   | Description                                                  |
| -------- | ------ | ------------------------------------------------------------ |
| category | String | the category of games, will return all the games by default. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "code": 0,
  "msg": "ok",
  "data": {
    "game_list": [
      {
        "id": 1,
        "name": "Midnight Manor, A Killer Among Us",
        "background": "background of game1",
        "intro": "In the midst of your presence in a castle, a murder unfolds...",
        "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg",
        "scenes": [
          {
            "id": 1,
            "name": "Midnight Scene1",
            "background": "A snowy night in 1903, in an old castle on the outskirts of London..."
            "intro": "scene1 intro",
            "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg"
          },
          {
            "id": 2,
            "name": "Midnight Scene2",
            "background": "A snowy night in 1903..."
            "intro": "scene2 intro",
            "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg"
          }
        ]
      },
      {
        "id": 2,
        "name": "Fatal Palette: The Enigma of the Vanishing Sunflowers",
        "background": "John's lifeless body lay just steps away from where Van Gogh's masterpiece once graced the wall...",
        "intro": "John's lifeless body lay just steps away...",
        "image": "",
        "scenes": [
          {
            "id": 27,
            "name": "scene1",
            "background": "the painting has disappeared without a trace...",
            "intro": "Was it a murder, or did he fall victim to natural causes...",
            "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg"
          }
        ]
      }
    ]
  }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}
{% endtabs %}

## Start a new game

## Start  a new game.

<mark style="color:green;">`POST`</mark> `https://api.rpggo.ai/open/game/startgame`&#x20;

#### Request Body

| Name                                          | Type   | Description                                                                                           |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| session\_id<mark style="color:red;">\*</mark> | String | game session's unique ID, which records the current game state and conversation history.              |
| game\_id<mark style="color:red;">\*</mark>    | String | game ID, obtainable through the /gamelist API.                                                        |
| scene\_id<mark style="color:red;">\*</mark>   | String | scene ID, obtainable through the /gamelist API.  Ensure that this scene is in the corresponding game. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "code": 0,
  "msg": "ok",
  "data": {
    "id": 22,
    "name": "Midnight Manor, A Killer Among Us",
    "background": "background of game22",
    "intro": "In the midst of your presence in a castle, a murder unfolds...",
    "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg",
    "scene": {
      "id": 27,
      "name": "home",
      "background": "the painting has disappeared without a trace...",
      "intro": "Was it a murder, or did he fall victim to natural causes...",
      "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg"
      "init_dialog": [
        {
          "npc_id": "1168130113938931712",
          "id": 124,
          "name": "Oswald",
          "message": "hi, I am Oswald.",
          "llm": false,
          "index": 0
        },
        {
          "npc_id": "1168129586136092682",
          "id": 123,
          "name": "Painter-Ceres",
          "message": "hi, I am Painter.",
          "llm": false,
          "index": 1
        }
      ],
      "npcs": [
        {
          "id": "1161661128770850867",
          "name": "Dungeon Master",
          "type": "dm"
        },
        {
          "id": "1168130113938931712",
          "name": "Oswald",
          "type": "npc"
        },
        {
          "id": "1168129586136092682",
          "name": "Painter-Ceres",
          "type": "npc"
        }
      ]
    }
  }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}
{% endtabs %}

## Change scene and continue the game

## Switch to the specified scene and continue a new game

<mark style="color:green;">`POST`</mark> `https://api.rpggo.ai/open/game/changescene` &#x20;

#### Request Body

| Name                                          | Type   | Description                                                                                                     |
| --------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| session\_id<mark style="color:red;">\*</mark> | String | current session ID, must be an ongoing game session id                                                          |
| game\_id<mark style="color:red;">\*</mark>    | String | current game ID, obtainable through the /gamelist API.                                                          |
| scene\_id<mark style="color:red;">\*</mark>   | String | specified scene ID, obtainable through the /gamelist API.  Ensure that this scene is in the corresponding game. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "code": 0,
  "msg": "ok",
  "data": {
    "id": 22,
    "name": "Midnight Manor, A Killer Among Us",
    "background": "background of game22",
    "intro": "In the midst of your presence in a castle, a murder unfolds...",
    "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg",
    "scene": {
      "id": 27,
      "name": "home",
      "background": "the painting has disappeared without a trace...",
      "intro": "Was it a murder, or did he fall victim to natural causes...",
      "image": "https://storage.googleapis.com/rpggo_images/website/logo.svg"
      "init_dialog": [
        {
          "npc_id": "1168130113938931712",
          "id": 124,
          "name": "Oswald",
          "message": "hi, I am Oswald.",
          "llm": false,
          "index": 0
        },
        {
          "npc_id": "1168129586136092682",
          "id": 123,
          "name": "Painter-Ceres",
          "message": "hi, I am Painter.",
          "llm": false,
          "index": 1
        }
      ],
      "npcs": [
        {
          "id": "1161661128770850867",
          "name": "Dungeon Master",
          "type": "dm"
        },
        {
          "id": "1168130113938931712",
          "name": "Oswald",
          "type": "npc"
        },
        {
          "id": "1168129586136092682",
          "name": "Painter-Ceres",
          "type": "npc"
        }
      ]
    }
  }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.rpggo.ai/dev-docs/player-api/api-overview/api-v1-deprecated/game.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
