GPTNPC
Engine: Unity
Solo Project
This project contains a collection of Unity extensions that utilise ChatGPT's API. There are four extensions in total:
GPT NPC Creator: This extension allows users to custom-make an NPC. Users can input an extensive amount of data about their NPC, including personality traits, Age, Name, Gender, Background, language, World settings, Creativity etc. After that, users can talk to their NPCs, which would be powered by ChatGPT.
Preset Dialogue Generator: This extension allows users to pre-generate dialogue (so that it does not have to be generated in real-time, which would slow down gameplay and increase API costs) from previously made custom NPCs. Users can select any custom NPC and write a prompt they would like the NPC to say. ChatGPT would then be used to generate dialogue as the selected custom NPC. It is also possible to generate these prompts for the entirety of the dialogue. This way, dialogue doesn't need to be written and can be done intuitively. I developed this extension to demonstrate how ChatGPT can prevent NPCs from repeating themselves. Users can instantly generate numerous different dialogue prompts from the same dialogue.
Ask GPT: This extension allows you to ask ChatGPT Unity-based questions in the editor.
Generate Script: This extension allows users to generate code from a prompt. Once generated, a script file will be created automatically and will be inserted into the selected game object.
I learned how to create Unity extensions and use APIs with the help of these extensions. Coding in the editor was entirely different, but it was a lot of fun as it required me to adapt and plan in new ways. I also faced challenges with web requests, as there were many ways the process of sending and receiving data could fail. Becase of this, I learned how to properly inform users about what went wrong and how they could troubleshoot the problem.
Video of extensions in use: