Bay 12 Games Forum

Please login or register.

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

Author Topic: Context-Based AI -- Special moves and behaviours  (Read 1648 times)

Granite26

  • Bay Watcher
    • View Profile
Re: Context-Based AI -- Special moves and behaviours
« Reply #15 on: September 04, 2009, 04:24:07 pm »

The other fun part is, once a dwarf decides he's going into the 'work for the fort' context, his method of picking a job could actually be 'ask the manager to assign me a job'

Lesconrads

  • Bay Watcher
    • View Profile
Re: Context-Based AI -- Special moves and behaviours
« Reply #16 on: September 05, 2009, 02:46:18 am »

Even though I don't know how it is implemented now, nor what other methods exist: I like the effects this would have.
At the moment, we would have
"Urist McIsOnFire stops stop, drop and roll - going to the booze stockpile"...
it would be really nice if dorfs would get some kind of feeling for duty and urgency. There are many interesting things that one could do with that method.
Dwarfs with pack-animals could get into "haul stuff"-mode and look for Items nearby that have a similar destination etcetc. It also sounds really nice and modable.
Logged

Sunken

  • Bay Watcher
  • Wabewalker
    • View Profile
Re: Context-Based AI -- Special moves and behaviours
« Reply #17 on: September 05, 2009, 03:53:18 am »

This is a suggestion for some sort of hierarchical finite state machine, right?
It's a very interesting approach, though I foresee a lot of work with abstraction in order to evaluate the current context. Easier than in robotics, sure, but extracting a "situation" from DF is still hard! But it's a noble endeavour.

I think that the most psychologically plausible setup would use fuzzy logic and fuzzy control; that is, the creature can be in several states at once to a greater or lesser extent. That would allow "mixed" behaviour: dwarfs hauling stuff from A to B and simultaneously keeping away from a foe would tend to choose detours away from the foe, and so on. But a strict "current state" might be sufficient in many cases. It would probably lead to agents getting stuck in loops (see Asimov's I, Robot) sometimes and behaving unnaturally, but that can likely not be avoided in any case.
Logged
Alpha version? More like elf aversion!

Dellnak

  • Bay Watcher
    • View Profile
Re: Context-Based AI -- Special moves and behaviours
« Reply #18 on: September 05, 2009, 04:56:20 am »

I have thought that what if different individuals had somewhat different weights for actions, representing different personalities. Brave creatures would be less likely to retreat, lazy ones less likely to work when tired, etc. There is probably some kind of mechanic like this already (tags?), but the real beauty of the system would come from these being inherited and/or learned. Dwarves could fall in love with other dwarves whose personality matched theirs closely enough and their babies could inherit the parents' "personality", for example by using an average of the parents' weights with some random noise added. Thus if a father was really talented miner, the child would probably be too. Of course really crappy dwarves (measured somehow) might not be able to find any partner at all, resulting in their removal from the gene-pool. Using only evolution would be too slow to produce (say) actual upper and working class of dwarves, however.

I'm not sure how the weight learning should happen for live dwarves, though, because the value of current behavior is difficult to measure as it depends much on circumstances and other dwarves. As a simple example, when facing a seriously dangerous assault, it might be best for few super-brave patriotic dwarves to stay outside and slow the enemy while the others ran inside and readied the defenses. If all ran, the whole fortress might get killed, but if all stayed, it would result in an unnecessary amount of deaths, so the optimal combination for the fortress in this situations would be to have a couple of fearless dwarves with the rest being cowards enough to stay alive.

I'll post more about this when I have the time.
Logged

Bricks

  • Bay Watcher
  • Because you never need one brick.
    • View Profile
Re: Context-Based AI -- Special moves and behaviours
« Reply #19 on: September 05, 2009, 10:06:42 am »

Fun detail I found when working on a competitive swarming AI - you are better off all running in different directions than running away as a group.  Seems kind of obvious, but it was neat to see it actually work.  Dwarves scattering in all directions would be amazing.
Logged
EMPATHY - being able to feel other peoples' stuff.
Pages: 1 [2]