Gaming Non-Playing Character (NPC) Bot

This section describes the sample bots available showcasing how you can:

  • build LLM driven Natural Language Understanding (NLU) and Natural Language Generation (NLG) capabilities for non-playable characters in a game.

  • provide game-stage specific context to the Chat Engine at runtime and utilize that context to change the behavior of NPC’s.

There are two sample NPC bots provided as part of the NVIDIA ACE Agent release. Each bot corresponds to one unique character in the game, having a unique personality, and backstory. You can find the backstories for the two characters in the samples/jin/bot_config.yaml and samples/elara/bot_config.yaml files respectively. You can change this backstory, if needed, based on the character you are designing. The placeholders in this backstory denoted by {{ }} are populated by a custom plugin module at runtime.

We can deploy both the bots in a single Chat Engine instance and try them out together interactively. Follow the directory structure of samples/npc_bots to understand how to organize multiple bots in a single directory and launch them together. These bots use NVIDIA API Catalog’s mixtral-8x7b-instruct as the main model.

The Gaming NPC bot showcases the following ACE Agent features:

  • Deploying multiple bots at the same time

  • Custom LLM prompts for each character

  • Modifying the context of the bot using Chat Engine APIs

  • Chat Engine Server Architecture

    Attention

    Multi-bot deployment is not yet supported in the speech based pipeline. It will be supported in a future release.

Docker-based bot deployment

The NPC sample bot utilizes mixtral-8x7b-instruct-v0.1 from the NVIDIA API Catalog. This sample is present in the quickstart directory at ./samples/stock_bot.

  1. Set the API key for the NVIDIA API Catalog.

    export NVIDIA_API_KEY=...
    
  2. Prepare the environment for the Docker compose commands.

    export BOT_PATH=./samples/npc_bots/
    source deploy/docker/docker_init.sh
    
  3. Deploy the ACE Agent microservices. Deploy the Chat Engine, Plugin server, and NLP server containers.

    docker compose -f deploy/docker/docker-compose.yml up chat-bot -d
    
  4. Try out the bot using a web browser. You can deploy a sample frontend application with only textual chat support using the following command.

    docker compose -f deploy/docker/docker-compose.yml up frontend
    
  5. Interact with the bot using the URL http://<workstation IP>:9001/.

NPC bot sample conversation