> For the complete documentation index, see [llms.txt](https://developer.rpggo.ai/dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.rpggo.ai/dev-docs/player-api/api-overview/api-v1-deprecated/game.md).

# 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 %}
