From f0eb8bc2a223bebce87a5643cf501558ef7bf126 Mon Sep 17 00:00:00 2001 From: ktyl Date: Sat, 17 Dec 2022 20:02:44 +0000 Subject: [PATCH] gpt game dialogue --- blogs/2022/12/17/gpt-game-dialogue.md | 58 +++++++++++++++++++++++++++ blogs/2022/12/17/merchant_items.png | 3 ++ blogs/2022/12/17/merchant_prompt.png | 3 ++ blogs/2022/12/17/sprite_prompt.png | 3 ++ blogs/2022/12/17/sprite_response.png | 3 ++ 5 files changed, 70 insertions(+) create mode 100644 blogs/2022/12/17/gpt-game-dialogue.md create mode 100644 blogs/2022/12/17/merchant_items.png create mode 100644 blogs/2022/12/17/merchant_prompt.png create mode 100644 blogs/2022/12/17/sprite_prompt.png create mode 100644 blogs/2022/12/17/sprite_response.png diff --git a/blogs/2022/12/17/gpt-game-dialogue.md b/blogs/2022/12/17/gpt-game-dialogue.md new file mode 100644 index 0000000..bbbbee4 --- /dev/null +++ b/blogs/2022/12/17/gpt-game-dialogue.md @@ -0,0 +1,58 @@ +# Game dialogue with ChatGPT + +[ChatGPT](https://chat.openai.com/chat) has become the latest AI application to enjoy viral popularity. +At time of writing it's a closed-source research tool developed by OpenAI, with the only access being via their web portal. +Users have to create an account to interact with the bot, and have no API access, though they no doubt have one internally. +I think given its capabilities, this is probably a good idea for now, but I'd like to outline the impact it can already have in game development, even in its fairly limited form. + +However, it can already be made immensely useful for content generation, without any kind of API access. +Generally, characters come in two flavours: main characters, whose motivations and actions shape the story; and generic NPCs, who exist to fill out the world for the player. + +For the story to carry the author's intent (which they might not necessarily care about), it would probably be best not to leave ChatGPT to generate a plotline on its own. +Its susceptibilty to bias is a problem - try generating men or women and count how often they're describing as petite, as having chiseled jaws or as wearing form-fitting dresses. +It can be coaxed out of this with enough description, but lots of manual intervention defeats any content generation technique. + +The other group of characters, though, I think represents ripe pickings. +Often in a game world, background dialogue quickly becomes stale, as lines are reused. +ChatGPT can already easily be used as a supporting writer to generate a huge amount of less-than-critical dialogue. +Take, for example, a merchant. + +![generating merchant dialogue](merchant_prompt.png) + +This psuedo-format is instantly combatible with a simple templating system. +It would be trivial to generate variations using perfectly traditional programming techniques. +This prompt took a minute to write, and includes specific about the character's context, as well as a slightly more than default personality. + +We've instantly generated 8 perfectly workable dialogue options for our character, from some basic and mostly templated information about their context. +However, we notice that our item choices weren't included in the output, though we described them. +So we ask: + +![merchant items](merchant_items.png) + +And, instantly, another 8 lines. +We now have, after a modicum of input, 16 possible lines for a background merchant character to respond with when interacted with. +With some templated prompt generation, this could be made even faster than the description given here. + +It's also capable of going beyond just lines dialogue. +[Ibralogue](https://github.com/Ibralogue/Ibralogue)'s developer taught it the syntax, had it generate an example and then taught it a new feature: + +![sprite prompt](sprite_prompt.png) + +![sprite response](sprite_response.png) + +All that's left is to copy the output and paste it into a text file for a game to use. + +--- + +This is barely even a scratch on what ChatGPT or systems like it are already capable of. +At present, the website gets overloaded, you can't save and reload conversations, and its content filtering is very much evolving problem. +However, even with those limitations it's an extraordinarily powerful tool, and this is just one very minor example of an application. + +That's it from me, but I'd love to read more discussion about use cases and the ethical issues at play. +If you have anything interesting, please [get in touch](mailto:me@ktyl.dev)! + + + + + + diff --git a/blogs/2022/12/17/merchant_items.png b/blogs/2022/12/17/merchant_items.png new file mode 100644 index 0000000..de056ea --- /dev/null +++ b/blogs/2022/12/17/merchant_items.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a67aeaee7cbfcda329564d4af3469944ab0808e13e5eaa38a211a9798dc5a221 +size 95806 diff --git a/blogs/2022/12/17/merchant_prompt.png b/blogs/2022/12/17/merchant_prompt.png new file mode 100644 index 0000000..aae5db8 --- /dev/null +++ b/blogs/2022/12/17/merchant_prompt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cb05cd3c157c5a98a579b08ad01932b18886389febc26fb38a0e5b3da1f5aaa +size 82699 diff --git a/blogs/2022/12/17/sprite_prompt.png b/blogs/2022/12/17/sprite_prompt.png new file mode 100644 index 0000000..b3eea7e --- /dev/null +++ b/blogs/2022/12/17/sprite_prompt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecf0170fed3d81e3a080f81ada2907f54998cdf86a050396c7bb554c18184a4b +size 27311 diff --git a/blogs/2022/12/17/sprite_response.png b/blogs/2022/12/17/sprite_response.png new file mode 100644 index 0000000..bd319c3 --- /dev/null +++ b/blogs/2022/12/17/sprite_response.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff10011c8a2c2c133bc425f8ab61865aa4890232efa6c0ee59caddd23cf75661 +size 112509