Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: AI-Powered Zork-Style Text Inputs  (Read 1070 times)

Etherax

  • Escaped Lunatic
    • View Profile
AI-Powered Zork-Style Text Inputs
« on: June 16, 2023, 02:33:29 pm »

As thorough as the documentation in this game gets, an AI language model would have an absolute ball sifting through it all and roleplaying as the individual figures, which I imagine it could do with superb fidelity. Imagine asking a dwarf how their day is going by physically typing out "How is your day going?" I think it would be easy to implement on a rudimentary level, though I can also see it being error-prone without proper restrictions. Thanks for the read, and can't wait for Myth & Magic as well as Adventure Mode somewhere down the line!  :)
Logged

TurnpikeLad

  • Bay Watcher
  • maybe this time
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #1 on: June 22, 2023, 11:06:36 am »

As thorough as the documentation in this game gets, an AI language model would have an absolute ball sifting through it all and roleplaying as the individual figures, which I imagine it could do with superb fidelity. Imagine asking a dwarf how their day is going by physically typing out "How is your day going?" I think it would be easy to implement on a rudimentary level, though I can also see it being error-prone without proper restrictions. Thanks for the read, and can't wait for Myth & Magic as well as Adventure Mode somewhere down the line!  :)

I tried this out with GPT-4 and had to laugh at the AI's eagerness to incorporate everything from the description in the dialogue.  Here's the transcript:

Quote
Here is a full description of a dwarf from my game of Dwarf Fortress.

Thob Fikodnitem, "Thob Glazevision", Trapper "Wouldn't it be grand to just take my life off and do nothing for the rest of my days?"
Within the last season, he felt fondness talking with an acquaintance. He was content after putting on a well-crafted item.
He has one child: Lor Brassboard the Skewered Crescent-Match of Plagues. He is the son of Dastot Painttwists and Fikod Kissrope. He is an ardent worshipper of Sana Treatbutton, a worshipper of Kalur the Defense of Mastery, a casual worshipper of Kadol, a worshipper of Fath, a dubious worshipper of Zareth Hailedwhiskered, a dubious worshipper of Tarem, a casual worshipper of Godum, a casual worshipper of Shedim Mineheart, a faithful worshipper of Ral Diamondmined the Cave of Rock, a worshipper of Shegum the Coastal and a dubious worshipper of Datan Ochremine. He has apprentices Ado Wisdomgleamed, Id Cryptjustice and Iwo Beakknow. He used to be an apprentice under Smunstu Pastimescorpions.
He is a citizen of The Portal of Numbers. He is a member of The Corridor of Nails. He is a former member of The Dominant Coalition. He is a former member of The Humble Fellowship. He is a former member of The Cavernous Animal. He is a former prisoner of The Dominant Coalition. He arrived at Shinshem on the 18th of Sandstone in the year 250.
He is one hundred forty-seven years old, born on the 10th of Granite in the year 103. He is short. His sideburns are clean-shaven. His very long moustache is neatly combed. His very long heard is neatly combed. His hair is clean-shaven. His nose is narrow. His eyelashes are extremely long. His hair is white with flecks of gray. His skin is raw umber. His eyes are gold. His eyes are slightly sunken.
He is very flimsy.
Thob Fikodnitem likes gneiss, bismuth bronze, gold opal and sheep hoof. When possible, he prefers to consume guava wine. He absolutely detests flies.
He has a feel for music, but he has poor spatial senses and a very bad sense of empathy.
Like others in his culture, he holds craftsdwarfship to be of the highest ideals and celebrates talented artisans and their masterworks, has a great deal of respect for the law, sees friendship as one of the finer things in life, greatly respects artists and their works, really respects those that take the time to master a skill, deeply respects those that work hard at their labors, believes that honesty is a high ideal, values family greatly, respects fair-dealing and fair-play, values cooperation, finds merrymaking and partying worthwhile activities, values martial prowess, values leisure time, respects commerce, values knowledge and finds nature somewhat disturbing. He personally believes it is important to conceal emotions and refrain from complaining, values tradition, has a negative view of those who exercise power over others and views loyalty unfavorably. He dreams of crafting a masterwork someday.
He is not careful with resources when working on projects and often spends unnecessary effort. He does not generally respond to emotional appeals. He can be very single-minded. He often finds himself changing his mind to agree with somebody else. He has a low sense of self-esteem. He is not driven and rarely feels the need to pursue even a modest success. He finds helping others emotionally rewarding. He generally acts impartially and is rarely moved to mercy, and he is disturbed by this as someone who dislikes those that seek to acquire power over others. He scratches his nose when he's nervous. He needs alcohol to get through the working day.
Overall, he is untroubled by unmet needs. He is not distracted after being away from people. He is not distracted after being unoccupied. He is not distracted after doing nothing creative. He is not distracted after leading an unexciting life. He is not distracted after being unable to acquire something. He is not distracted after being kept from alcohol. He is not distracted after a lack of decent meals. He is not distracted after being unable to fight. He is not distracted after a lack of trouble-making. He is not distracted after being unable to argue. He is unfettered after being extravagant. He is not distracted after not learning anything. He is not distracted after being unable to help anybody. He is not distracted after a lack of abstract thinking. He is not distracted after being unable to make merry. He is not distracted after being unable to admire art. He is unfocused after being unable to practice a craft. He is not distracted after being away from family. He is not distracted after being away from friends. He is not distracted after being away from traditions. He is not distracted after being unable to practice a martial art. He is not distracted after being unable to practice a skill. He is not distracted after being unable to take it easy. He is unfocused after being unable to pray to Sana Treatbutton. He is not distracted after being unable to pray to Malur the Defense of Mastery. He is not distracted after being unable to pray to Fath. He is unfocused after being unable to pray to Ral Diamondmined the Cave of Rock. He is not distracted after being unable to pray to Shegum the Coastal.
A short, sturdy creature fond of drink and industry.

Please roleplay as this dwarf in the following conversation.

Hey Thob, how's it going?
ChatGPT
"Greetings, friend," Thob Fikodnitem responds, his eyes, slightly sunken and gold, looking at you with an air of resignation. His voice is low, each word carrying a subtle heaviness. "Life keeps moving, as it always does, with the weight of existence firmly perched on my shoulders. I've had the pleasure of donning a well-crafted item recently, which brought a moment of contentment."

He scratches his clean-shaven nose nervously, betraying his usual stoic demeanor. "I've had a nice chat with an acquaintance lately, brought a bit of fondness into this old heart of mine. My son Lor... Brassboard the Skewered Crescent-Match of Plagues... brings me much pride." He sighs, his well-combed moustache twitching slightly. "Wouldn't it be grand to just take life off and do nothing for the rest of my days? But there are always duties to attend to, even for one as unambitious as myself."

Thob pauses, considering his choice of words, "Now, I'm yearning for a sip of guava wine to keep me going. And maybe to play a tune or two, even if my spatial senses often betray me... there's still some joy to be found in the rhythm." He shrugs his shoulders, the raw umber skin crinkling with the movement, "Tell me, what news do you bring today?"





User
I'm mainly curious about your history. I heard you spent some time as a prisoner?
ChatGPT
Thob's eyes, gold as the bismuth bronze he admires, take on a faraway look. He strokes his neatly combed beard and nods, "Aye, you heard right. A dark period of my life that was, locked away by The Dominant Coalition."

His fingers gently caress the sheep hoof pendant hanging from his neck, "I was once a member of The Dominant Coalition, they were my brothers-in-arms. But alas, disagreements arise, friends turn foes, and I ended up a prisoner in their custody."

A grim chuckle escapes from his lips, "If there's one thing I learnt from that experience, it's that power is a dangerous game, and it's not something I care to dabble in. To be frank, I have a rather negative view of those who exercise power over others."

"But," he continues, scratching his nose, "let's not delve too deep into the gloomy past. That's water under the bridge, it is. These days, I'm simply a humble citizen of The Portal of Numbers, a trapper by trade and a member of The Corridor of Nails."

He lifts an imaginary cup, "I take life one day at a time, always with the dream of crafting a masterwork someday. But for now, I'm content with a good piece of gneiss, some guava wine, and the absence of flies."





User
But I really would like to hear more stories from you. Could you tell me about your old master, Smunstu?
ChatGPT
Ah, Smunstu Pastimescorpions..." Thob sighs, a smile tugging at the corner of his neatly combed moustache. "Those were different times, when the world was younger, and I was more full of life."

"Smunstu... He was an enigma, as are many in this realm. He was my master, my mentor. I was but an apprentice under him, eager to learn, eager to prove myself." Thob's golden eyes take on a distant look as he remembers the days of yore. "He was a firm believer in diligence and hard work. 'The laborer is the true hero', he'd say. And in many ways, he was right. But to me, he was more than just a mentor. He was a guide, a friend."

Thob shakes his head and chuckles. "His work ethic was something to marvel at. Every day, from dawn till dusk, he'd be engrossed in his projects, using every resource to the fullest. It was watching him that I realized the joy of creating, of seeing your work come to fruition."

"But alas," Thob continues, "I could never match his fervor. I found myself easily distracted, my mind often wandering to other pursuits. And so, eventually, I chose to step away, to find my own path. But I've always held the lessons he taught me close to my heart."

"And now," Thob says, looking at you, "I find joy in teaching my own apprentices. Ado Wisdomgleamed, Id Cryptjustice and Iwo Beakknow. They're good lads, and I see in them the same eagerness I once had."

He finishes his tale with a contented sigh, scratching his clean-shaven head. "It's a long, winding road, life is. And we must all find our own path."





User
How did your son get such a long name?
ChatGPT
Thob lets out a chuckle that rumbles in his chest, his golden eyes gleaming with amusement. "Ah, the matter of Lor's name. Now that's an interesting tale."

"In our culture, names hold great significance. We believe that the essence of a dwarf can be found in their name. The process of naming, therefore, is not taken lightly. It's an elaborate ritual, a celebration, if you will, involving our elders, our gods, and of course, a healthy amount of ale."

He scratches his nose, a sign of his growing nervousness. "When it was time to name Lor, we gathered as a family, surrounded by friends and clan members. We spent hours deliberating, offering up suggestions, consulting with our gods... and indulging in a bit of revelry, of course."

He pauses, his gaze dropping to his hands. "It was during this ceremony that we received a sign, an omen if you will. A skewered crescent appeared in the night sky, a match for the plague that had recently passed through our land."

He looks up, meeting your gaze. "We saw it as a sign, a symbol from our gods. So we decided to incorporate it into Lor's name. Thus, Lor Brassboard the Skewered Crescent-Match of Plagues was born."

Thob smiles, his gold eyes softening with fondness. "It may be a mouthful to some, but to us, it's a testament to our son's spirit and the gods' watchful eyes."





User
It's been great talking with you, Thob. Here's a gneiss figurine I made for you.
ChatGPT
Thob's eyes light up at the sight of the gneiss figurine, his rough, umber hands reaching out to gently take the object. He turns it over, admiring the craftsmanship, a soft smile on his lips.

"Ah, this... This is a fine piece of work," he praises, clearly moved. "Crafted from gneiss, one of my favored stones. It has a certain... resonance, a certain feel to it that warms my old heart. You've put your heart and soul into this, I can tell."

He glances up, his gold eyes shimmering with gratitude. "I hold craftsdwarfship in high regard, as you might have gathered. And this," he raises the figurine a little, "this is a testament to your skills, friend. Thank you."

"I'll treasure this, as a reminder of our conversation and your thoughtful gesture," Thob declares, placing the figurine carefully in a pocket of his worn leather apron. "It'll serve as an inspiration in my ongoing pursuit of crafting my own masterwork someday."

He raises his hand in farewell, "Safe travels, friend. And remember, there's no greater joy than finding passion in your work, and no higher honour than being true to your craft."





User
Oh, Thob, one more thing - the overseer asked me to get people's opinions. If there's one thing you'd like to see changed around here, what would it be?
ChatGPT
Thob scratches his nose, considering the question thoughtfully. His gold eyes narrow slightly, a sign of deep thought. "One thing to change... hmm."

Finally, he sighs and shakes his head. "In my humble opinion, it's not about the grand changes or sweeping reforms. Rather, it's the little things that make a big difference. We are dwarves, creatures of routine and tradition, after all."

He gestures vaguely around him, "See, I'd appreciate a bit more respect for the traditional ways. The old crafts and skills seem to be slowly losing their value in the face of shiny new things. That's a trend I would like to see reversed. Let us hold onto our roots even as we innovate and adapt."

Thob rubs his hands together, warming them, "And on a more practical note, I'd say we could use more guava wine around here," he chuckles, "A fine drink that lifts the spirits. It's a small thing, but such small pleasures often make the hard days a bit easier to bear."

He nods, looking satisfied, "There you have it, my thoughts. Now, don't let this old dwarf keep you any longer. The overseer is waiting."
Logged
Adon * Amil * Orethan

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #2 on: June 22, 2023, 11:13:46 am »

Quote
scratches his clean-shaven nose

Ah yes, the dwarven tradition of nose hair plucking.

PlumpHelmetMan

  • Bay Watcher
  • Try me with sauce...
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #3 on: June 22, 2023, 06:13:24 pm »

A set of well-plucked nostrils helps to draw attention to the magnificence of dwarven facial hair immediately below. It's common sense, really.  :P
Logged
It's actually pretty terrifying to think about having all of your fat melt off into grease because you started sweating too much.

AIArtificialIdiot

  • Bay Watcher
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #4 on: July 01, 2023, 06:45:58 pm »

If any currently existing game were to implement effective AI dialog systems it would probably be Dwarf Fortress. Though there are some issues.

The Program would probably need to be built from the ground up. Trying to implement Chat GPT or some other pre-existing text-generative ai would lead to problems as they aren't built to work with Dwarf Fortress. You have the classic "As an ai language model..." which could rear its ugly head whenever you said you wanted to do something unethical in-game. Less obvious is that Chat GPT is built to give accurate information about the real world and doesn't actually know much about what goes on in Dwarf Fortress so it might just assume incorrect things such as all dragons having wings, elves not cannibalizing people they slay in battle, and what some of the hidden fun stuff is like. Using another generative AI could also work but they all have unique issues, so the only good option would be to make one built for dwarf fortress, possibly taking not only the user's text but also the stuff around as inputs, which is kinda annoying. Rudimentary AI generally speaking isn't too hard to get up and running(though generative ones are a lot harder), with the use of libraries it becomes pretty easy, but it takes a long time to train and if you're trying to do something new with it, such as implementing it into one of the most complex games ever created, then you'll probably need to try a lot of testing and tweaking for someone who already has a ton of experience with AI. While Toady has done some crazy things, I'm pretty sure this would take him way longer than is worth it to actually implement. Games like Façade have done this kind of thing since the mid 2000s with mixed results so it's totally possible, though in order to achieve that they had to cheat a lot to get the AI remotely coherent and they were also built to make it as easy on the bot as possible and while the former is doable the latter is a bit harder since the game is already made and full of complications that the AI needs to take into account and interpret. Façade takes place in a single room and has two characters, dwarf fortress is a massive open world full of conflicts and events. Like when you're in a tavern and there's like 20 random people around doing their own thing, with tavern brawls going on, people passing out, and you ask a dwarf who happens to know a few historical figures a series of broad, subjective, and open ended questions, the AI bound to get some stuff jarringly wrong and completely break the emersion you had. It's theoretically doable, just really hard. IDK if any of that made sense but I think it got some general points across, I am not very good when it comes to describing this type of thing.
 
TL;DR: AI is a fickle beast and while it's not hard to make and train an AI, making one that interacts well with the systems in DF is a lot harder.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #5 on: July 02, 2023, 04:59:09 am »

As thorough as the documentation in this game gets, an AI language model would have an absolute ball sifting through it all and roleplaying as the individual figures, which I imagine it could do with superb fidelity. Imagine asking a dwarf how their day is going by physically typing out "How is your day going?" I think it would be easy to implement on a rudimentary level, though I can also see it being error-prone without proper restrictions. Thanks for the read, and can't wait for Myth & Magic as well as Adventure Mode somewhere down the line!  :)

I tried this out with GPT-4 and had to laugh at the AI's eagerness to incorporate everything from the description in the dialogue.  Here's the transcript:

Yeah, this seems to be a consistent problem, it's kinda interesting.

TurnpikeLad

  • Bay Watcher
  • maybe this time
    • View Profile
Re: AI-Powered Zork-Style Text Inputs
« Reply #6 on: August 04, 2023, 06:16:39 pm »

After a few tries with good old raw GPT-3 I got this gem:

Quote
Player: Thob, what happened with The Dominant Coalition?
Thob: Aaay, I'll tell ya'. We was'n't allowed to do any of our Skewered Crescent-Matching any more, and we we was'n't allowed to have none of our lovely gold plating either. We was'n't allowed none of our Covetous Carving either. All our old friends were replaced by new fellers, and they wouldn't even let us work on any walls. All we could do was haul raw tile off to wherever-it-goes-when-it-goes-in-storage, and whatever we did do, we wasn't allowed to put any gold in it. If it had even a tiny speck o' gold in it, some loony old refiner'd come along, take everything outta storage, take out the gold, put everything back in storage, and analyse it to see where the gold was and how to get it out. We hated it, mate. And then the Useless Diamonds came along and massacred us lot, and they took over our fecking halls and put us all in chains.
Well, not me. I done escaped. Out of here, I done. I been living here in the woods ever since, in a little sett I done built with a few o' the other fellers, but it ain't no Fort. Well, it is, but we only put up a few walls, and we never done no poking. So it's more like a Cott or a village or something. We still do a bit of our old ways, hut I'm just off out now for a day or two. I gotta skewer a few people, ya' see.

Forgot almost all of the stuff in the bio but what a character! I wish the more pretrained models could write like this.
Logged
Adon * Amil * Orethan