Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Would you use this if we ever get a releasable version?

Yes
No

Pages: 1 2 3 [4] 5 6 ... 8

Author Topic: An AI to play dwarf fortress. Has this been done? ==UPDATE!==  (Read 15156 times)

HiEv

  • Bay Watcher
  • Denizen of Counter-Earth
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #45 on: October 21, 2012, 03:07:31 am »

Sorry to be that guy, but what a terribly ill-posed question. You really have to not "get" NNs to ask something like this. Here are the problems with it:

Thank you, ArPharazon, for saying exactly what I've been thinking every time I see this thread title, but have been too lazy to put into words.

Using neural networks alone to create an AI to play Dwarf Fortress is a terrible, terrible choice.

If you wanted a self-teaching AI, you'd be far better off with a heuristics learning algorithm like Eurisko than attempting to use neural networks.

If I was going to do it, I wouldn't bother with a full learning AI, I'd just create a set of stages that I'd want the fortress to go through using modular designs, and then implement rules that would help the AI reach the next stage while attempting to avoid various problems.  Ultimately it would reach some predefined "stable" stage, and then it would simply work to maintain that stage.

Attempting to make a learning AI would take far too long to implement due to the size, complexity, and speed of Dwarf Fortress.
Logged
The difference between intelligence and stupidity is that intelligence has its limits.

ZimminyCricket

  • Bay Watcher
  • Just a crazy guy who does crazy things.
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #46 on: October 21, 2012, 03:47:12 am »



Thank you, ArPharazon, for saying exactly what I've been thinking every time I see this thread title, but have been too lazy to put into words.

Using neural networks alone to create an AI to play Dwarf Fortress is a terrible, terrible choice.

If you wanted a self-teaching AI, you'd be far better off with a heuristics learning algorithm like Eurisko than attempting to use neural networks.

If I was going to do it, I wouldn't bother with a full learning AI, I'd just create a set of stages that I'd want the fortress to go through using modular designs, and then implement rules that would help the AI reach the next stage while attempting to avoid various problems.  Ultimately it would reach some predefined "stable" stage, and then it would simply work to maintain that stage.


You are quite correct sir, Please see the first post in this series.  I am explaining things a little more clearly now. 

That goes to everyone else too, check the first post!


ZimminyCricket
« Last Edit: October 21, 2012, 04:09:41 am by ZimminyCricket »
Logged
And then there are crazy buggers like me...

Coding an AI to try and surmount the insurmountable odds of failure.

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #47 on: October 21, 2012, 09:50:34 pm »

What is a neural network, anyways?
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

misko27

  • Bay Watcher
  • Lawful Neutral; Prophet of Pestilence
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #48 on: October 21, 2012, 10:56:14 pm »

oH SHIT.

Someone get a bunker ready! Flee my fellow forumites! flee from this man who would create the IRAI (Insane rouge AI) that will kill us all!
Logged
The Age of Man is over. It is the Fire's turn now

HiEv

  • Bay Watcher
  • Denizen of Counter-Earth
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #49 on: October 21, 2012, 11:26:48 pm »

What is a neural network, anyways?

In brief, the classic computer neural network is one or more input "neurons", connected to some number of "hidden" neurons, which are usually connected to one or more output neurons (there may be more than one hidden layer of neurons, but this requires much more complicated algorithms).  The inputs and outputs are simple True/False or single numbers for each input/output.  The neural network is then "trained" by presenting it a large variety of inputs that represent various situations, and then strengthening or weakening the connections between the neurons so that the correct output is given.  A well trained neural network should then be able to give correct outputs for inputs it has never seen before, but this is highly dependent on the diversity and accuracy of the training, the ability of the problem to be broken down this way, and even the initial setup of the neural network.

Basically, it's a very touchy and difficult to set up method that only makes sense to use in some uncommon situations.

For details see the Neural network Wikipedia entry.  The type of neural network I described above is also called a Multilayer perceptron, if you want to read the details on that.  For details on training a neural network, see Backpropagation.

I can understand being enamored of the idea of a technique which can make a program learn something itself, but a Dwarf Fortress AI is not a good area for its use due to the difficulty in obtaining a training set diverse enough, with simple enough inputs and outputs, and with clear enough "right" and "wrong" answers for its use.

As far as combat goes, it seems a combination of a neural network to determine the best overall make up of combat dwarves, scored against combined strength, skills, and levels.   We will have a combat ANN event that is triggered when there is either an 'announcement' or 'mega-announcement' that decides the amount of force required to protect against the current threat again from the historical encounters.

This cannot work with a neural network.  First of all, the "best overall make up of combat dwarves" is dependent on your definition of "best".  If, for example, "best" means "highest odds to defeat the opponent", then the answer is always "use every dwarf you have."  Furthermore, there is no way to describe the makeup of your military dwarves and their opponents to a neural network in anything but the simplest of terms.  Finally, even if you could somehow describe it through the neural network's inputs and outputs, there is no way to train it to learn the "best" way for all of the various types, sizes, and combinations of units (your own and the enemies) in a time period that is shorter than your lifespan.

It makes far more sense to make an expert system for something like this, where there are "rules of thumb" for squad makeup and size versus various types of units determine the minimum squad requirements to safely attack.  Those "rules of thumb" can be tweaked as necessary when they don't work, but should give you an adequate method for determining if you can deal with a threat or threats in a reasonable amount of programming time.

Note: I'm not saying neural nets are universally terrible, but I'm hard pressed to think of a situation in DF where some other technique wouldn't be better.
Logged
The difference between intelligence and stupidity is that intelligence has its limits.

ZimminyCricket

  • Bay Watcher
  • Just a crazy guy who does crazy things.
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #50 on: October 22, 2012, 12:09:58 am »

oH SHIT.

Someone get a bunker ready! Flee my fellow forumites! flee from this man who would create the IRAI (Insane rouge AI) that will kill us all!

Acutally, we're calling it DAVE (Dwarven Assassination Through Virtual Emulation).
Logged
And then there are crazy buggers like me...

Coding an AI to try and surmount the insurmountable odds of failure.

hops

  • Bay Watcher
  • Secretary of Antifa
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #51 on: October 22, 2012, 02:11:45 am »

oH SHIT.

Someone get a bunker ready! Flee my fellow forumites! flee from this man who would create the IRAI (Insane rouge AI) that will kill us all!

Acutally, we're calling it DAVE (Dwarven Assassination Through Virtual Emulation).
you should call it DAVE STRIDER

*get gassed to death by anti-homestuck gases*
Logged
she/her. (Pronouns vary over time.) The artist formerly known as Objective/Cinder.

One True Polycule with flame99 <3

Avatar by makowka

Jelle

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #52 on: October 22, 2012, 06:00:01 am »

Can't imagine you can get an AI to play a mostly sandbox oriented game.
It'll have to work towards a goal, the only real goal in DF fort mode is to avoid every dwarf dying wich is relatively trivial if the goal is to do this as effectively as possible.
Creating things for the sake of being creative in DF's sandbox environment, not something I see an AI doing. 'course I'd hugely pleasantly surprised if this were to actually happen.
Logged

Leatra

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #53 on: October 22, 2012, 07:05:31 am »

You guys are going to create a super AI which will become the end of humankind.

LET'S DO IT!
Logged

Talvieno

  • Bay Watcher
  • Hello, Death. How's life?
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #54 on: October 22, 2012, 07:49:24 am »

I've always been a hardcore fan of AI. I think what you're doing is possible, but it'll need a lot of hardcoding - especially in the area of fortress design. My suggestion would be to keep the fortress itself simple - perhaps a vertical underground tower with large rooms and staircases at the sides. It would be easy to expand, and the AI ought to be able to designate the rooms as the types they choose - a square room works just as easily as a stockpile as a dining room, for instance. As to defense (bridges, moats, minecart shotguns), good luck with that.

Creating things for the sake of being creative in DF's sandbox environment, not something I see an AI doing.
Agreed. Strongly agreed.

As to a goal for it to work to, I don't think it really needs a "goal". "Bigger and better" ought to be good enough - simply to increase its defenses as much as possible. Bigger army, bigger fortress. I don't think it could ever be creative enough to flood an entrance hallway with magma of its own accord, for instance, though you ought to be able to hardcode magma pump stacks pretty easily.
Logged
Quote from: Mr Frog
Talvieno ... seems to be able to smash out novella-length tales on demand

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #55 on: October 22, 2012, 08:04:07 am »

Creating things for the sake of being creative in DF's sandbox environment, not something I see an AI doing.
Agreed. Strongly agreed.

As to a goal for it to work to, I don't think it really needs a "goal". "Bigger and better" ought to be good enough - simply to increase its defenses as much as possible. Bigger army, bigger fortress. I don't think it could ever be creative enough to flood an entrance hallway with magma of its own accord, for instance, though you ought to be able to hardcode magma pump stacks pretty easily.

Maybe a goblin invasion factory, manfacturing as much wealth as it can out of local and imported resource and mighty army of trap and dwarves to splatter them. Though wasn't invasion recently linked to their population so you could extinct them?
Logged

GoombaGeek

  • Bay Watcher
  • Horrors! Crundles in the caverns!
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #56 on: October 22, 2012, 08:13:03 am »

oH SHIT.

Someone get a bunker ready! Flee my fellow forumites! flee from this man who would create the IRAI (Insane rouge AI) that will kill us all!

Acutally, we're calling it DAVE (Dwarven Assassination Through Virtual Emulation).
you should call it DAVE STRIDER

*get gassed to death by anti-homestuck gases*
what kind of anti-homestuck gases

like liquid nitrogen

because homestuck is uncool

AWWWWW YEAH 8)
Logged
My wooden badge was delicious.

muzzz

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #57 on: October 22, 2012, 10:42:33 am »

Note: I'm not saying neural nets are universally terrible, but I'm hard pressed to think of a situation in DF where some other technique wouldn't be better.

This.

But I'm getting the sense that this project isn't about being practical as much as it is about using neural nets as much as possible.

EDIT: This paper might be of interest.
« Last Edit: October 22, 2012, 12:46:40 pm by muzzz »
Logged

ZimminyCricket

  • Bay Watcher
  • Just a crazy guy who does crazy things.
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #58 on: October 22, 2012, 03:33:52 pm »


But I'm getting the sense that this project isn't about being practical as much as it is about using neural nets as much as possible.

Again, as I said in the update to the first post, we're not going with a neural net to run everything, just to generate scores and help the machine learn to play better.

Different modules will of course do different things, and in some points may be pure neural nets, but I expect that there will be a lot of game logic tests as well.

Check the first post for updates!  =)

Zimminy
Logged
And then there are crazy buggers like me...

Coding an AI to try and surmount the insurmountable odds of failure.

HiEv

  • Bay Watcher
  • Denizen of Counter-Earth
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #59 on: October 23, 2012, 01:38:44 am »

Let me boil down the question for you:

Why use neural nets at all, when there are far better ways to do it?
Logged
The difference between intelligence and stupidity is that intelligence has its limits.
Pages: 1 2 3 [4] 5 6 ... 8