Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Possibility of AI integration in DF?  (Read 4214 times)

Resmisal

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #15 on: February 09, 2023, 05:01:31 pm »

Believe me I'm both fascinated and in awe* of current progresses in AI sciences. While I've proposed the inclusion on an elaborate algorithm for believable fictionally generated religions (hah!) in my own thread... HOWEVER I want to cast my vote into the keep AI art to external services and mods camp. Precisely that we generate stories in our head/s is one main reason to waste invest so much time into a game of chronically drunk diminutives.

*: feeling of respect mixed with fear or wonder.

Edit: typo.
« Last Edit: February 09, 2023, 05:03:49 pm by Resmisal »
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #16 on: February 09, 2023, 08:33:01 pm »

Actually unintentional and intentional contradictions is exactly what Toady wants to be able to do with the conversation code in the future. We want villains and such to be able to lie and rumors that can be incorrect. If the AI can generate discrepancies when a rumor its referring to is flagged as "this is supposed to be a lie" that could be useful.
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

impala

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #17 on: February 10, 2023, 06:37:05 am »

I know the topic is controversial, but my own feeling is having ML in games can be introduced successfully only on a few fronts at the moment.
It might be ok to have the solution write poetry/book entries, but we should curate the things it creates, and then add those manually. It might save some work, yes, but as someone mentioned earlier, the text would need moderating.


Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #18 on: February 15, 2023, 08:36:28 pm »

I'd love to be able to read the in-game books, but I don't know if chat bots are the answer. I've seen good stuff from the suggested ChatGPT chatbot, but I don't like that it requires Internet access and a subscription.
Logged

EuchreJack

  • Bay Watcher
  • Lord of Norderland - Lv 20 SKOOKUM ROC
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #19 on: February 25, 2023, 05:26:18 pm »

In what way are we sure that what currently exists in DF isn't very much the same as what is currently be touted as "AI"?

jecowa

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #20 on: February 25, 2023, 11:48:34 pm »

There's already AI in Dwarf Fortress. I think OP was talking about adding Neural Network AI.
Logged

impala

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #21 on: March 03, 2023, 12:55:24 pm »

Ye, the term AI is quite loaded. If you're on the academic side of things, many earlier things that were called AI fell out of fashion, and are now called just by their names / algorithms. In gaming you end up naming any heuristic an AI.

In this case it is guaranteed that the AI in DF is procedural, randomly sampling from a pool of *known* prewritten strings (texts). With neural networks (called the modern AI in many circles) you'd have a machine learning solution that is rarely used in games.

Also note that adding the neural network to the client isn't feasible. If you'd want to have freshly generated texts, you'd need it on server-side, thus DF would for the first time require an internet. :p

The latest developments in LLMs are indicative of a direction that we *might* get a network that requires far less curation (was in a conference a few days ago on the topic, there were a lot of groups working on this).
« Last Edit: March 03, 2023, 12:58:35 pm by impala »
Logged

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #22 on: March 04, 2023, 12:35:38 pm »

Well put, Impala.  (Are you someone who studies machine learning and other such things?)

Some thoughts and a question, though... At some point, enemies are going to be able to dig during seiges, and it says in the dev notes that there will possibly be some capacity for enemies to learn from failed attacks.  Is there any heuristic/algorithm/whatever (I am not familiar with the lingo) that might be feasible to implement to this end? 

Just speculating here, but I could see there being a process that could run client side in paralell to the main simulation of the game that happens after a failed siege ends where an algorithm runs to find a better/different way to attack the fort again with whatever data it has of the fort's layout.  It could run a number of iterations of whatever optimization process the algorithm employs based on whatever relevant attributes of the enem, giving as output the next strategy for the attacker to use...  I hope I am making sense.  I guess this leads back to the previous question... Is this something that is at all feasible?
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #23 on: March 04, 2023, 04:56:31 pm »

At some point, enemies are going to be able to dig during seiges, and it says in the dev notes that there will possibly be some capacity for enemies to learn from failed attacks.  Is there any heuristic/algorithm/whatever (I am not familiar with the lingo) that might be feasible to implement to this end?

The plan is to increase pathing cost where invaders die.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #24 on: March 04, 2023, 05:16:11 pm »

Which you could theoretically get around by having them walk across a series of retracting bridges and then open the bridge, dropping them into a pit of magma. Goblins die in the magma, but don't learn not to walk across the bridges. Trap works indefinitely.

So that part even will have to be more complex than just pathing weights strictly on the tiles where an invader dies.

Is anybody even developing an AI that can learn and adapt to the safest route through a maze full of traps and enemies?
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

impala

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #25 on: March 07, 2023, 11:10:38 am »

Andeerz: yea, been on the topic for a decade.

I think what Bumber mentioned would be likely be the most dynamic and cost-efficient manner to start with. To handle all the special cases would then require additional work. This system could combine with the dwarves treating places as dangerous too, such as miners being afraid of sections with cave-ins and so on, eventually touching on the feeling of safety feature.

Reinforcement learning in general works on solving things like finding safest routes in trapped mazes, but the problem with using machine learning is the system won't "align" with our intentions too well, and odd behaviour will be way more common than not. As an example, a RL agent made to play tetris eventually figured out a sneaky tactic to "get a maximum reward": once it was about to lose, it hit the pause button, and stayed there forever. At least this way it didn't incur the heavy penalty from losing. And this took tens of thousands of iterations of training too. We wouldn't want the goblins finally learning from their mistakes a hundred sieges in. (yes, there are methods to speed this up, but usually that involves computationally expensive things. In certain cases, you'd need a high-end PC calculating the next move for up to a minute, which is too much to wait for in a game).

So overall, we're better off handling the AI ourselves with heuristics and algorithms that catch the essential features, instead of letting an ML solution figure something for us, at least at the moment. The machine doesn't really understand what's important for us and what's not. Even large language models (ChatGPT etc.) don't understand what the text "means", it just imitates what humans have written previously.

Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #26 on: March 07, 2023, 12:07:33 pm »

Even large language models (ChatGPT etc.) don't understand what the text "means", it just imitates what humans have written previously.

I don't know if that's true or not. I was impressed seeing AI try to convert English instructions into Minecraft commands.
Logged

impala

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #27 on: March 08, 2023, 07:16:46 pm »

Yes, the stuff on the video was impressive jecowa, but it isn't "understanding" what it is doing in the specific way I meant an AI needs to understand the tech we want for the storytelling components in DF. I'm not saying this kind of feature would be somehow unreachable and super intelligent, but it is still missing from the current implementations.

Currently ChatGPT is "understanding" things at the level of a Chinese room: there's a person in a sealed room with two slots in the wall. The person takes notes from one slot, and sees chinese text, which they don't understand. Still, there's a book from which they can translate the text to korean (which they ALSO don't understand), and they have to write the answer down and pass the note from the other slot. Basically, the person knows what to do, but doesn't really understand anything that's happening.
So to specifically help form an intuition to that video, ChatGPT is "comparing the given query to things written on stackoverflow.com", and it can dynamically modify the words to fit the query. Then it generates an answer to that query, and passes it on (it's not that simple of course, but this is thematically the correct way to start to understand it). It doesn't understand to be giddy that the player is now destroying the world. It doesn't understand to be cautious of the destructive nature of the player. It doesn't understand to consider these things from its own values, such as pacifism, because it doesn't have its own values.

For the features we've discussed here, the AI would have to understand what is thematically correct for the game, what is politically correct, and how would the proverbial dwarf think like when writing those texts. Of course, all of these could be possible to consider when querying ChatGPT. But it might require some non-trivial trickery (adding a context query behind the scenes would be one basic method) to get it right even at a 90% success rate.
Logged

DuniteOlivine

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #28 on: April 16, 2023, 05:15:49 pm »

There's lots of types of AI for games, but based on your example and context I assume you mean specifically a deep-learning chat bot. There are some huge barriers.

Data-set: The reason Chat-GPT talks so realistically is because it has a massive database of transcribed dialogue, novels, and articles to learn the patterns of. If you want to make an immersive Dwarf Fortress chat bot, you would need a separate Dwarf Fortress data-set for every part of generation except grammar. Just creating enough of that data alone is a head-ache, So Tarn gotta write a couple Dwarf Fortress novels at minimum. This is made extra difficult by Dwarf Fortress having generative per-world lore, instead of game lore, so you have to set up a sorta Mad-Libs style system for history, places, and things.

Integration: Even if you get a DF Chat Bot perfectly staying in character and in world, you need a separate AI interpreter to actually make things happen according to the chat. For example, if you only had a chat bot and a representative of the humans said "We are declaring war on your civilization!" no war would happen. So you need to train a separate AI to translate text back into gameplay.

Offline: Chat bots are not nearly as optimized as txt-to-image diffusion yet, and you need a very strong computer to run it. DF is also a CPU heavy game. So the only real solution is to stream the chat bot. Even if you could easily deal with the logistics of running that server, it would force anyone using the feature to play online which would inconvenience everyone.

That said, there are lots of ways AI can be improved in DF that do not involve machine learning models. Invader AI can be improved by trying to break into doors, setting up their own traps outside, and having various battle formations / siege weapons. We can add diplomacy meetings with the classic multiple choice scripted style. Let's not get over our head and just focus on perfecting AI in the realm of programming before we jump to machine learning.
« Last Edit: April 16, 2023, 05:17:56 pm by DuniteOlivine »
Logged

eerr

  • Bay Watcher
    • View Profile
Re: Possibility of AI integration in DF?
« Reply #29 on: April 24, 2023, 03:55:24 pm »

Tarn doesn't want to make a black box a critical piece of dwarf fortress architecture.

If something he gives to the ai breaks, who fixes it?

This game is his life's work, and he wants to understand how the parts work, and be free to modify it.
Logged
Pages: 1 [2]