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 ... 8

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

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 #30 on: October 20, 2012, 12:12:09 am »

Also the way I understood it, the goal of dwarf fortress is to build the best, most defensible fortress you can, and last as long as you can.

So the AI's main goal, is simply 'Score better than I did Last Round'

at least, in a very over-simplified version of the universe.

We can teach it to look at the important areas of the screen (pause bar, announce bar, menu {probably not needed})

Complex....Yes, insanely.  Bad idea, quite possibly, almost as challenging to pull off as successfully 'beating' dwarf fortress....indubitably
Logged
And then there are crazy buggers like me...

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

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #31 on: October 20, 2012, 12:14:13 am »

I think no amount of guidance will get a neural net into this.

Even the faster learning alghoritm for simpler tasks requires hundreds of iterations.

That is, hundred times each and every decisions should be presented, along with the correct solution.

Now, this is going to hit a immediate problem: what are the decisions to be made? And then the bigger problem on what are the solutions to the decision problems?

And if you can't figure a derivable equatin that allow you to evaluate how the ai decision compare with your optimal solution, you can't even start the learning descent.

Probably limiting the ai rooms on surface, hard coding digging, and letting the net build surface walled rooms...

The problem with nnet is to get the preprocessing and postprocessing right, since you can't just throw the game world at them and expecting output in forms of game commands
Logged

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #32 on: October 20, 2012, 06:26:52 am »

While DF sounds like perfect application for an example of neutral network, I still think rule-based system would be much faster and simpler. For all of complexity of DF, it's still relatively simple in solution space, what's hard is coordinating and remembering what does what. I've seen far more complaints at managing many dwarves or FPS death, than in getting things to run, while newcomers are more likely to ask what does what :D

At the most basic, you can start a fortress with a bunch of wood, some ore ( coals are helpful, but woods will do fine ), a couple stones and a couple barrels of plump helmets and get away with it. From that to a fully functional fortress is very few steps in most areas and involves just forging a pick, digging, setting a farm, digging more while beds are being made and so on.

Now, in hostile areas, like some evil or savage spots, neutral network -might- be more useful, since there would be many compromises to survive and defend quickly and effectively. Or just figuring out a rule-based module to box things up and dig deep would work for most of them. For a dedicated embark, neutral network could be useful to 'predict' the next cloud o'doom, though!

ed: That's not to say it won't be interesting to see how much it messes up, just that it seems a bit complicated for DF :D
« Last Edit: October 20, 2012, 06:31:42 am by AutomataKittay »
Logged

ArPharazon

  • Bay Watcher
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #33 on: October 20, 2012, 11:23:28 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:

1. DF does not have any "score". To train an NN, you need to show it inputs and matched correct outputs, then it (supposedly) generalizes the output. What's your training set?

2. NNs, by their nature, function by trying many solutions over and over. How long does a non-trivial game of DF take? Yeah, that, times hundreds, maybe thousands (because the problem is so bad, maybe millions!).

3. Good luck when the NN inevitable gets stuck in the thousands of local minima that must certainly exist.

4. It will get too confused by different maps, so your only hope is to have it learn for only one particular map. Then, after years of work and years of crunching, it will build you a so-so, ugly looking (and probably full of the lamest, cheapest exploits as said previously) fort. But don't celebrate yet! The moment you run on even a slightly different map, you realize it overfitted to a ridiculous extent and it is worthless for all but that exact map.

5. How do you supply inputs? It will have to be a sequence of moves. How many "moves" are possible in DF? Yup, you're screwed. The memory cost of storing an input alone will be ridiculous, and the number of nodes needed to process it will be absurd. I mean, let's be clear - you're not reading ZIP codes here. 5 neurons in 2 layers just isn't gonna cut it.

6. And last, as I said, you'll need a training set, which means many different plays on the same exact map. Where will you get it? Right, tedious, tedious playing of the same map over and over and over... Add a year or two to dev time, and the expenses (in therapist bills).

Why would you even want to make an NN? They are glorified equation fitters for automating tasks and forecasting data. What's to automate about DF? What's to forecast? It's fairly clear how to play DF well after a point, people play it to pit their luck against their understanding of these winning strategies. Not to find new ones. As for automation, well, if playing DF is such a chore, you could, you know, not play it.
Logged

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #34 on: October 20, 2012, 12:18:36 pm »

I think that the topic had shifted from neural nets to AIs that could play Dwarf Fortress. But still, that was tremendously informative. You're not being "that guy" at all. One would have to be insane to refuse helpful information like that.  :)
Logged

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #35 on: October 20, 2012, 12:48:19 pm »

Why would you even want to make an NN? They are glorified equation fitters for automating tasks and forecasting data. What's to automate about DF? What's to forecast? It's fairly clear how to play DF well after a point, people play it to pit their luck against their understanding of these winning strategies. Not to find new ones. As for automation, well, if playing DF is such a chore, you could, you know, not play it.

Nitpicking a bit, there're forecasting invasion forces, local climates ( Useful if you relies on murky pools or in some evil areas ), timing of merchants and their supply. Those would be fortress-specific, but still useful if it's being ran over a long time once it's well-established, as I expects any AI being tested would preferably be kept on one fortress for quite a time.

That said, more basic statistical tools would be more than capable.

Also, I figure whomever's building an automation or full out AI for any games is doing it for challenge or to prove they can do it. Or just too bored for their own good :D
Logged

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 #36 on: October 20, 2012, 02:29:11 pm »

Quote
Also, I figure whomever's building an automation or full out AI for any games is doing it for challenge or to prove they can do it. Or just too bored for their own good :D

You got it!  We also intend to apply this ai to other RTS games, to see how it does.
Logged
And then there are crazy buggers like me...

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

sudgy

  • Bay Watcher
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #37 on: October 20, 2012, 02:40:02 pm »

2. NNs, by their nature, function by trying many solutions over and over. How long does a non-trivial game of DF take? Yeah, that, times hundreds, maybe thousands (because the problem is so bad, maybe millions!).
Why not just make it choose a few hundred random possibilities and see which of them is the best (and not have to think ahead through the entire game, just have it look a bit ahead to see if it's good)?  Humans don't think of every possible thing, they just think of a few random ones.  This would also make it more human-like.  (And if you wanted to make it learn, have it always think of something that has worked in the past, and a few other possibilities)

Also, While I like the idea, it would take a long time to make.  You'll have to wait until the game is finished, since by the time you finish it the next version of the game will be out.
Logged

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 #38 on: October 20, 2012, 03:08:41 pm »

Because the second part of this AI is to see if we can bring down the  entire Amazon Web Services Virtual Cloud by running a virtual beowulf to play DF
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: A Neural Net To Play The Game. Has This Been Done?
« Reply #39 on: October 20, 2012, 03:57:27 pm »

Quote
Also, I figure whomever's building an automation or full out AI for any games is doing it for challenge or to prove they can do it. Or just too bored for their own good :D

You got it!  We also intend to apply this ai to other RTS games, to see how it does.

How much could still apply? Could it even understand Starcraft or something?
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.

hops

  • Bay Watcher
  • Secretary of Antifa
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #40 on: October 20, 2012, 03:58:16 pm »

The problem is that it will take a long time to develop, and when you're done with it Dwarf Fortress would have gone full version already.
Logged
she/her. (Pronouns vary over time.) The artist formerly known as Objective/Cinder.

One True Polycule with flame99 <3

Avatar by makowka

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #41 on: October 20, 2012, 04:04:37 pm »

Quote
Also, I figure whomever's building an automation or full out AI for any games is doing it for challenge or to prove they can do it. Or just too bored for their own good :D

You got it!  We also intend to apply this ai to other RTS games, to see how it does.

How much could still apply? Could it even understand Starcraft or something?

I'm curious also, since nobody's developed a 'general purpose' AI for games in general, particularly with how huge variation there are between games, even if just in graphic display. Since from sound of it, someone's using screen-reading software for it. There're also that some RTS uses mouse clicks, while DF uses keyboard mostly.

Also, I think calling DF a RTS is a bit strange, though I suppose technically accurate?

Well, unless you're just developing an AI framework to be hooked into some kind of image tracker? That still leave having to work out mouse control and teaching it. Also didn't Blizzard mentioned that Starcraft AI is partially NN-based, or at least SC2 one is?
Logged

misko27

  • Bay Watcher
  • Lawful Neutral; Prophet of Pestilence
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #42 on: October 20, 2012, 04:08:22 pm »

Quote
Also, I figure whomever's building an automation or full out AI for any games is doing it for challenge or to prove they can do it. Or just too bored for their own good :D

You got it!  We also intend to apply this ai to other RTS games, to see how it does.

How much could still apply? Could it even understand Starcraft or something?

I'm curious also, since nobody's developed a 'general purpose' AI for games in general, particularly with how huge variation there are between games, even if just in graphic display. Since from sound of it, someone's using screen-reading software for it. There're also that some RTS uses mouse clicks, while DF uses keyboard mostly.

Also, I think calling DF a RTS is a bit strange, though I suppose technically accurate?

Well, unless you're just developing an AI framework to be hooked into some kind of image tracker? That still leave having to work out mouse control and teaching it. Also didn't Blizzard mentioned that Starcraft AI is partially NN-based, or at least SC2 one is?
Well, If you're think in terms of resource managment, it is most certainly a RTS. But, I don't know.

Ten socks says this guy ends up killing us all.
Logged
The Age of Man is over. It is the Fire's turn now

sudgy

  • Bay Watcher
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #43 on: October 20, 2012, 09:54:24 pm »

I'm curious also, since nobody's developed a 'general purpose' AI for games in general, particularly with how huge variation there are between games,

I've heard of a generic board game AI (in Zillions of Games (granted, a few things it was bad at, but it was mostly good)).  But a generic game AI would be way too hard.  You would at least have to input the goal of the game yourself before it played it.
Logged

King Mir

  • Bay Watcher
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #44 on: October 20, 2012, 11:41:24 pm »

Dwarf fortress is not a good game to build such a system for, because it has few metrics of success. It also has a very large amount of random challenges that are not caused by player action.
Pages: 1 2 [3] 4 5 ... 8