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 ... 3 4 [5] 6 7 8

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

hops

  • Bay Watcher
  • Secretary of Antifa
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #60 on: October 23, 2012, 01:54:25 am »

If you guys could make an AI to play DF, I really wanna see an AI to play Minecraft.
Logged
she/her. (Pronouns vary over time.) The artist formerly known as Objective/Cinder.

One True Polycule with flame99 <3

Avatar by makowka

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 #61 on: October 23, 2012, 02:41:06 am »

We understand some of the better ways to do it, and these are actually going to be some of the primary modules.  from what we have discussed, the nets are going to be the score keepers, all answering to one master referee to see how the program did over all. 

These scorekeepers will score the programs performance against that of an actual human.  That is, for example in cartography it will score against what actual human players identify items as, on a consistency basis.  In an economic sense, it will track the value of


The primary goal of this project is that we want the machine to use no outside information with the exception of some coded basic gameplay, and commands to speed the learning process which will be removed from the training set after some arbitrary number of iterations.
Logged
And then there are crazy buggers like me...

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

Jelle

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #62 on: October 23, 2012, 02:58:39 am »

Why use neural nets at all, when there are far better ways to do it?

This is Dwarf Fortress isn't it? Hugely unnecesary needlessly complex constructions are the norm!
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #63 on: October 23, 2012, 12:42:16 pm »

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.

I just wanted to point out that you're confusing GA with NN.  The two techniques are often, but not always combined, in order to create a sort of learning system, but be assured that the two techniques are entirely different from each other.

GA needs a "score".  GA requires hundreds, if not thousands, if not millions of iterations.  GA usually, but not always requires stable scenarios.  GA frequently gets stuck in local maxima, but can be kicked out of it by running multiple GA at once and cross breeding them occasionally.

NN has none of those problems, but has its own set of problems.  For example, the need for a finite and preferably VERY LIMITED (like, a number you can count on your fingers) number of inputs / outputs.  So you couldn't really hook the NN directly into DF, which has an insane number of potential inputs-- you could say "each tile", but you'd also need inputs for each possible item/creature in a tile.  But forget that, you can't really do it.

So what you need is a rule based system that handles what are often called "tactics"... analyzing big-picture stuff, like your overall economy (the "wealth", "food", and "booze" numeric displays could be good inputs, for instance), number of invaders on the map (not their position, probably not even their type, although you could split off titans and demons I suppose) number of living/dead dwarves, that sort of thing, and then use the NN to output a STRATEGY.  Not tactics, but overall goals.  For instance, if your booze is low, and there are a moderate number of goblins on the map, a NN could be used to decide whether to focus on getting stills up now or to get weaponsmiths going.

The NN wouldn't say where to put anything, it wouldn't say how to do it, it would just suggest "Hey, maybe we aught to prioritize booze right now", or "Maybe we could stand to draft a few fellows."  Then, a rule based system would work out how to actually IMPLEMENT the strategy proposed by the NN.

Of course, an NN could certainly do this, but what some other posters are pointing out, is that NNs are hardly NECESSARY to do this.  You could have a much more simple IF/THEN chain that analyzes the same numbers and comes up with the same goals.  The thing about NNs though, is that they're really good at "fuzzy" situations-- such as my example of being low on booze AND goblins are invading.  Which do you focus on?  What if your booze is at 5, you have 50 dwarves, but there's a demon rush flooding your fort?  What if it's a hundred goblins instead of demons?  How do you weight in your existing military?

Basically, the NN combines multiple inputs and melts them together in such a way that, if you train it right, it'll make "smart" decisions.  You COULD do it with an IF/THEN chain (or a switch, or whatever) but the more factors to consider, the fuzzier the lines between good and bad decisions in somewhat different scenarios, the more an NN starts looking a lot simpler to implement than an IF/THEN chain.

And yet the IF/THEN chain is simpler to read and understand for human beings.  And that's the temptation and draw for it, because you could look at your numbers and understand exactly what it means in terms of strategy weighting.  Neurons are a little trickier to comprehend.  But if you know what you're doing with them, I think this may actually be EXACTLY the right place to use it.


But don't focus all your attention on the NN.  You DO need a good system for implementing the overall strategy as well.  You need something to tell the game where to dig rooms and where to put the still and so on and so forth.  The best implementation of this... or at least the quickest... might be to simply apply some cookie cutter designs.
Logged

sudgy

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #64 on: October 23, 2012, 12:44:46 pm »

In an economic sense, it will track the value of

Um...  What happened?
Logged

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #65 on: October 23, 2012, 01:44:15 pm »

the ai... pulled a lever

muzzz

  • Bay Watcher
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #66 on: October 23, 2012, 02:05:56 pm »

Basically, the NN combines multiple inputs and melts them together in such a way that, if you train it right, it'll make "smart" decisions.  You COULD do it with an IF/THEN chain (or a switch, or whatever) but the more factors to consider, the fuzzier the lines between good and bad decisions in somewhat different scenarios, the more an NN starts looking a lot simpler to implement than an IF/THEN chain.

That's going to be the real problem. There's a funny story I've heard a few times about a neural network that was successfully trained to distinguish between stock and in-the-field photos of military aircraft. Unfortunately, it was supposed to be an IFF.

Morale of the story: if you use artificial training sets instead of simulation, you risk training your NN to recognize unintended patterns.
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 #67 on: October 23, 2012, 03:48:30 pm »

In an economic sense, it will track the value of

Um...  What happened?

Copious amounts of mary jaunita
Logged
And then there are crazy buggers like me...

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

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #68 on: October 24, 2012, 01:08:42 am »

If you guys could make an AI to play DF, I really wanna see an AI to play Minecraft.
Herobrine.
But, sadly, he was removed in... wait, how many releases "removed Herobrine"?
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

sudgy

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

If you guys could make an AI to play DF, I really wanna see an AI to play Minecraft.
Herobrine.
But, sadly, he was removed in... wait, how many releases "removed Herobrine"?
He was removed in 1.6.6, 1.7, 1.7_01, 1.8, 1.0, 1.2, (maybe 1.2.5) and 1.3.1.
Logged

Valikdu

  • Bay Watcher
  • Ruin... has come to our family.
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #70 on: October 24, 2012, 12:29:32 pm »

An AI that would be able to play DF.
...
I think that's a bad idea, if only because you'll be terminated by Cameron.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: An AI to play dwarf fortress. Has this been done? ==UPDATE!==
« Reply #71 on: October 24, 2012, 12:38:26 pm »

Posting to watch, since this looks pretty interesting.  At first I assumed it was a graduate school research project, but I guess there isn't a lot of scientific merit to it so much as having fun.  :)

In any case, I'd also like to blindly echo the others in that a neural network may not be too useful to your application.  Even if you're just using it as a scoring mechanism, it would probably be pretty tricky to get much use out of training it.  If I was coding it I would probably just implement all of the modules as highly domain specific rule-based systems (which sounds like what you're planning), and I would then likely just manually tune any parameters to the algorithms.  Good luck applying it to other games in the general case though.

AI is one of my weakest subjects however, so I'll let Fieari continue on since he sounds very well versed in the subject.
Logged
Through pain, I find wisdom.

Joben

  • Bay Watcher
  • Elder Thing
    • View Profile
    • Lazy Lizard Gear
Re: A Neural Net To Play The Game. Has This Been Done?
« Reply #72 on: October 24, 2012, 10:43:10 pm »

Difficulty notwithstanding.  A team of researchers did it for civilization III, it can be done.

Really? Why? Doesn't Civilization III already play Civilization III? Admittedly the AI cheats like a cheating cheater trying to win a medal for cheating, but it does play pretty much the same game you do. Doesn't it?
Logged
Broken Arrow - A small stats tweak to fix unrealistically overpowered arrows and bolts.

My RTD games: Roll To Raptor (On hold), Dino Arena

misko27

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

Difficulty notwithstanding.  A team of researchers did it for civilization III, it can be done.

Really? Why? Doesn't Civilization III already play Civilization III? Admittedly the AI cheats like a cheating cheater trying to win a medal for cheating, but it does play pretty much the same game you do. Doesn't it?
As they point out on TvTropess, its a different game. They make up for artificial stupidity with the computer is a cheating bastard.

EDIT: Just looked down, appearantly Civilization has a entire section devoted to them. Well then.
« Last Edit: October 24, 2012, 10:56:03 pm by misko27 »
Logged
The Age of Man is over. It is the Fire's turn now

Jelle

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

Yeah CiV, or atleast the last two I remember well enough, is pretty big on the whole cheating bastard AI trope to compensate for its aritificial stupidity. That wqas probably my main gripe with the last installment, the AI was simply to stupid making it seem the computer opponent was playing a completely different game then you are by bending more game rules then it does not.

Slightly more on topic, I'm sure making an AI for a game like civilization is a lot more straightforward then in a game like DF, civ has a lot of decision making where you decide from a select amount of choices. It should be no problem for it to analyze every single possability in such a choice except maybe for example on where to place units on a map (wich the AI absolutely failed at in the latest civ) since the possabilities are far more numerous and require a more selective decision making process.
Logged
Pages: 1 ... 3 4 [5] 6 7 8