Skip to content

A Unity project that uses ChatGPT to give NPCs personalities ๐Ÿค–๐Ÿ’ฌ

License

Notifications You must be signed in to change notification settings

p-v-z/DialogueDreamland

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Dialogue Dreamland ๐Ÿ’ฌ

Dialogue Dreamland is a Unity project that uses ChatGPT to give NPCs unique personalities in a WebGL build designed for browser use.


You will need your own ChatGPT API key to play ๐Ÿ—๏ธ

Image 1 Image 2 Image 3 Image 4


๐Ÿšง This project is a work in progress ๐Ÿšง

๐Ÿ“– Table of Contents

๐Ÿš€ Introduction

Welcome to Dialogue Dreamland, an immersive and innovative Unity project that harnesses the power of OpenAI's ChatGPT to breathe life into non-player characters (NPCs) in a WebGL build accessible right from your browser. By integrating state-of-the-art natural language processing technology, this project delivers engaging, interactive dialogues and unique NPC personalities, creating a dynamic and captivating gaming experience unlike any other. Dive into the world of Dialogue Dreamland and witness the fusion of artificial intelligence and game development come alive.

๐ŸŽฅ Showcase

This section highlights some of the key technical features and design choices that make Dialogue Dreamland a unique and engaging project.

ChatGPT Integration

Dialogue Dreamland uses ChatGPT to generate responses to player input. ChatGPT is a state-of-the-art natural language processing model that uses deep learning to generate human-like responses to text prompts.

WebGL Build

WebGL is a platform that allows you to create interactive 3D content for the web. The project uses WebGL to create a browser-based game that can be played right from your browser.

CI/CD Pipeline

This project makes use of game-ci, a GitHub Action that allows you to build your Unity project. The project is automatically built and deployed to GitHub Pages on every push to the main branch. See github/workflows/main.yml for more details.

Unity's JavaScript Interop for Emoji Handling

The project uses Unity's JavaScript Interop to handle UI issues with emojis, as it is much easier to handle emojis in HTML than with Unity. There is a UI built into the project that can be used to test in Editor (without the HTML UI), it is not used in the WebGL build.

AI-Generated Music

Dialogue Dreamland features AI-generated background music created by Soundraw.

Unity Packages

Tools

This project includes a submodule, ChatGPTWrapper, a fork of ChatGPT-Wrapper-For-Unity - which is a wrapper for the ChatGPT API that allows you to use it in Unity.

๐Ÿ’พ Installation

Prerequisites

Excluded Assetsโ—

Important: The following paid assets from the Unity Asset Store are not included in this repository, but are required to run the project. If you would like to use this project, you will need to purchase and import the assets into the following folder structure inside /DialogueDreamland/Assets/:

Setup

1. Clone the repository

You can clone the repository with the following command:

git clone https://github.com/p-v-z/DialogueDreamland.git

2. Import the excluded assets

Import the Excluded Assetsโ— using Unity's package manager, place the assets into the following folder structure /DialogueDreamland/Assets/DDAssets/. Import the plugins (Odin and DOTween) into /DialogueDreamland/Assets/Plugins/.

3. Install submodule

Clone ChatGPTWrapper (or a fork of it) into the /Assets/Scripts folder of the project.

You should now be able to open the project and run it in the Unity Editor. If you have any issues, please feel free to reach out.

๐Ÿ“… Upcoming Features

  • World UX
    • Fix colliders and layers so that camera doesn't clip through the floor or walls.
    • When you exit conversation, NPC should wave as it generates a 'goodbye' response.
      • Then the conversation should be summarized and stored somewhere, to be recalled next time you interact with the NPC
  • Build framework to define formulated base instructions to be given to bots, before and after
  • Add settings UI to modify gfx settings
  • Make AI more human-like
    • Make them move around every now and then, maybe have a sit on the bench animation

๐Ÿ’ก Future Ideas

  • Make dialogue trigger changes in the world. For example, and NPC can serve as a guard to a door, and if you convince them to let you through, the door will open.
  • Add a 'memory' system, where you can recall past conversations with NPCs.

๐Ÿค Contribution Guidelines

If you would like to contribute to this project, please feel free to fork the repository and submit a pull request. If you have any questions, please feel free to reach out.

๐Ÿ… Credits

At the core of this project sits ChatGPTWrapper, which is a fork of GraesonB's project - grattitude to them ๐Ÿ™.

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made by Petrie van Zyl