Using the OpenAI API to generate video game dialog with live Text-to-Speech

Published a blogpost

Watching the recent progress in AI has been so fascinating that I wondered if it would be possible to use the OpenAI API to generate dialog for a video game.


I integrated the OpenAI API into my roguelike FPS game to generate randomized/emergent character dialog with live Text-to-Speech.


https://www.youtube.com/watch?v=gIANn545e2c


NPC dialog lines are generated on the fly, different every time, facilitated by a custom prompt for each line in our custom Unity dialog editor. Instead of writing the dialog directly, you tell the AI what kind of possibility space to write in, and give it some background on the character, the setting, and the particulars of what’s going on.


I'd like to explore these techniques in game engines further and with more interactivity. Very much looking forward to open source large language models becoming viable. Full post where I discuss the implications of this technique and possible future directions: https://doomlaser.com/openai-api-genera ... to-speech/