Integrate AI Characters with MetaHuman Avatars in Unreal Engine 5 - Convai

By
Convai Team
May 27, 2024

Introduction

In the rapidly evolving landscape of game development, the integration of AI characters with MetaHuman avatars in Unreal Engine 5 offers a groundbreaking approach to creating immersive and interactive experiences. This blog post will guide you through the process of integrating AI functionalities with MetaHuman characters using the Convai plugin (Read more about it on Convai Docs). Whether you're a game developer, designer, or virtual world builder, this tutorial will provide you with the knowledge and tools needed to create realistic AI NPC.

Check out the video tutorial below to integrate your AI Characters with MetaHuman Avatars in Unreal Engine 5:

Why Use MetaHuman Avatars?

MetaHuman avatars provide an unprecedented level of detail and realism in character design. Developed by Epic Games (Read documentation), MetaHumans are highly realistic digital humans that can be used in Unreal Engine projects. Here are some key benefits of using MetaHuman avatars in game development (Convai avatar agnostic and supports a wide variety of avatar types and custom avatars too):

Benefits of MetaHuman Avatars

1. High Fidelity and Realism: MetaHumans offer photorealistic characters with detailed textures, realistic hair, and facial features, enhancing the visual appeal of your game.

2. Customization: The MetaHuman Creator allows for extensive customization, enabling developers to create unique characters that fit their game's aesthetic.

3. Animation and Performance: MetaHumans come with pre-built animations and can easily integrate with motion capture data, making it easier to bring characters to life.

Adding AI Capabilities with Convai

Integrating AI capabilities with MetaHuman avatars takes your characters to the next level. Convai, a powerful plugin for Unreal Engine 5, allows you to add AI functionalities to MetaHuman characters, enabling them to perceive their surroundings, perform complex actions, and engage in human-like conversations. Check out Convai’s AI capabilities in action.

Setting Up Convai Plugin

To begin, you'll need to download and install the Convai plugin from the Unreal Marketplace. Here’s how to get started:

1. Download the Plugin: Go to the Unreal Marketplace, search for "Convai," and install the plugin.

2. Enable the Plugin: Open your Unreal Engine project, go to Edit > Plugins, search for Convai, and enable it. Restart your project to apply the changes.

Adding MetaHuman Characters

Once the Convai plugin is set up, you can add MetaHuman characters to your project:

1. Open Quixel Bridge: Go to Window > Quixel Bridge and select a MetaHuman character.

2. Add the Character: Download and add the character to your project. You’ll find the character under the Content folder in the MetaHumans directory.

Applying Animations and Lip Sync

Adding animations and lip sync capabilities to your MetaHuman character is crucial for creating a lifelike experience:

1. Body Animations: In the character’s blueprint, select the body component and choose a Convai pre-made animation class for the body.

2. Face Animations: Repeat the process for the face component, selecting the appropriate animation class for facial expressions.

3. Lip Sync: Add the Convai face sync component to handle lip sync during conversations.

Creating AI Personalities

AI personalities define how your characters behave and interact. Convai allows you to create detailed backstories and personalities for your characters:

1. Create a Convai Account: Sign up on the Convai website and create a free account.

2. Generate API Key: Copy your API key from your account settings.

3. Setup in Unreal Engine: Paste the API key in Unreal Engine under Edit > Project Settings > Convai.

4. Create Characters: Use the Convai interface to create new characters, define their backstory, and select a voice.

Enabling Actions and Scene Perception

Convai-powered AI characters can perform actions and perceive their environment:

1. Action Commands: Characters can follow, move, and interact with objects based on predefined actions.

2. Scene Perception: Use the details panel to add objects to the character’s perception list, allowing them to recognize and interact with items in the scene.

Example Scenario

Let's walk through an example scenario where an AI character named Kyle, an undercover agent, interacts with the environment:

1. Adding Objects: Use the eyedropper tool to add objects like an axe or a tree stump to the character’s perception list.

2.Testing Interactions: Engage with the character by asking about objects or giving commands like following you or performing tasks.

Check out Convai and Nvidia’s ramen shop demo from CES2024 which showcases actions and scene perception for real time conversation with AI NPCs:

Conclusion

Integrating AI characters with MetaHuman avatars in Unreal Engine 5 using the Convai plugin unlocks a new dimension of immersive gameplay. The combination of realistic visuals and intelligent behaviors creates a compelling experience for players.

By following this guide, you’ll be well-equipped to integrate AI characters with MetaHuman avatars, enhancing your game development projects and creating engaging virtual worlds. For more detailed tutorials and support, join the Convai community on Discord or visit the official website. Also stay on the lookout for our blogs to keep up with the latest tips and tricks, tutorials and feature drops!

Feel free to reach out to the Convai team by writing to support@convai.com for any queries or support. Happy developing!

Frequently Asked Questions

Q: What are the system requirements for using MetaHuman avatars in Unreal Engine 5?

A: MetaHuman avatars require a powerful system with a high-end GPU, ample RAM, and a recent version of Unreal Engine 5. Read more here.

Q: Can I use custom voices for my AI characters in Convai?

A: Yes, Convai supports various voice options, including custom voices from providers like 11 Labs, GCP, and Azure.

Q: How do I handle performance optimization when using AI characters and MetaHumans?

A: Optimize performance by managing LODs (Level of Details), using efficient animations, and leveraging Unreal Engine’s built-in optimization tools.

Q: Can AI characters interact with each other using Convai?

A: Absolutely, AI characters can engage in conversations and perform collaborative actions, enhancing the depth of interactions in your game.