Can Good AI Be Bad?


Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

User avatar

Abyss Ambulator

Posts: 1189

Joined: Friday, 28th January 2011, 21:45

Post Tuesday, 26th July 2011, 22:22

Re: Can Good AI Be Bad?

Whenever they are attacked by players in/over deep water, monsters will take a moment to equip intertubes and other floatation devices in order to float out and attack the player.
The best strategy most frequently overlooked by new players for surviving: not starting a fight to begin with.

Ziggurat Zagger

Posts: 3037

Joined: Sunday, 2nd January 2011, 02:06

Post Wednesday, 27th July 2011, 00:34

Re: Can Good AI Be Bad?

minmay wrote:It would have to be convoluted to actually work. With the behaviour you propose, the player can simply step out of the water to lure them back to it with no risk. If you make it so that monsters stay far away from deep water, then that makes deep water into an easy way to get monsters out of your LOS.

And yes, removing terrain that constrains monster movement is a reasonable idea if you think that constraining monster movement is unacceptable (and it appears that you do).


It wouldn't have to be all that convoluted. They couldn't immediately start running back to the player the moment the player stuck a toe into shallow water, but if instead of waiting just outside of LOS they relocated to another part of the level entirely and then returned to their normal wandering behavior it would not be feasible to lead them back to the water for another try, particularly if this would just provoke them to relocate again.

You might be able to reliably avoid fights with wandering brute monsters when you're trying to loot a water-themed treasure vault, but those brute monsters would still be alive to cause trouble elsewhere on the level. Presumably monsters actually chosen to guard such a vault would be chosen so that they wouldn't be inconvenienced by the terrain chosen for them.

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Wednesday, 27th July 2011, 00:48

Re: Can Good AI Be Bad?

Agreed, If it was quite a gradual process I think it could work.
The main thing for me is that I would hate to see deep water disappear as a tactical option. It's not like water is on every level, and only three races can make use of it (Kenku quite late on so as not to matter as much), plus you need to be ranged to take advantage of it so I don't think it needs to be 'removed' or nullified, I think it just needs monsters to act slightly more intelligently when faced with persistent assault.
2012 Winner of fewest proposed ideas implemented by devs.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Wednesday, 27th July 2011, 08:10

Re: Can Good AI Be Bad?

Bim wrote:The main thing for me is that I would hate to see deep water disappear as a tactical option.

With stealth, speed and evasion bonus in water, it's still a considerable advantage to merfolks, especially if the opponent is floundering. For Oc, grey drac and anyone with lev, it's still a reliable escape option against melee monsters.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Wednesday, 27th July 2011, 11:12

Re: Can Good AI Be Bad?

minmay wrote:And yes, removing terrain that constrains monster movement is a reasonable idea

Reasonable from a purely theoretical point of view. Think for a second of the amount of work needed to simply remove deep water and lava from the game. This isn't reasonable at all, I'd rather improve the monster AI.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Snake Sneak

Posts: 128

Joined: Friday, 13th May 2011, 12:06

Post Wednesday, 27th July 2011, 12:29

Re: Can Good AI Be Bad?

I think what is being proposed is something like

AI which says - if a monster is being attacked and cant damage the attacker with any available option,
1) Possibly shout
2) retreat until out of sight
3) Possibly (if inteligent) go look for a missile weapon, equip it and come back. If you haven't managed to do that in X turns then revert to normal where you are.
4) otherwise revert to normal behaviour once out of sight

that seems a sensible approach - and certainly better than some melee types standing on the shoreline angrily waving thier weapons until they get pelted to death. (unless they are berserk, when it might actually be appropriate...)
A troll caster is a hybrid

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Wednesday, 27th July 2011, 15:31

Re: Can Good AI Be Bad?

Why must monsters that can't kill a player (who can retreat to deep water, or where ever) attack that player? Can the monster just retreat out of LOS and only approach the player if the player can't return to deep water? I know it's not quite so simple. But I prefer monsters that in general do not act stupidly (by letting a player kill them without a chance to harm the player).

Here are three features requests for AI. My apologies for responding to stuff earlier on in the thread.

First, let the monster move to a random square that is closer than the current square. At present I can (ab)use beams to slay many monsters. This would be a nerf to conjurers.

Second, I spend a lot of time hiding behind a summons or hobgoblin to keep a cyclops from throwing large rocks at me. I'd love it if monsters with missiles approached in such a way that they were moving closer to the player but also, if possible, moving to a square (that is closer to a square) with a clear missile path to the player.

Third, I much approve the idea of randomizing behavior vis-a-vis clouds. If a monster is not guaranteed to charge/flee/etc when facing a dangerous cloud and dangerous missile or melee attacks, then the player's strategy must become more nuanced.

For the record, I love all the recent AI tweaks. I guess I like the "realism" the AI provides more than I dislike the new incentives for boring strategic behavior.

Ziggurat Zagger

Posts: 3037

Joined: Sunday, 2nd January 2011, 02:06

Post Wednesday, 27th July 2011, 16:06

Re: Can Good AI Be Bad?

RFHolloway wrote:I think what is being proposed is something like

AI which says - if a monster is being attacked and cant damage the attacker with any available option,
1) Possibly shout
2) retreat until out of sight
3) Possibly (if inteligent) go look for a missile weapon, equip it and come back. If you haven't managed to do that in X turns then revert to normal where you are.
4) otherwise revert to normal behaviour once out of sight

that seems a sensible approach - and certainly better than some melee types standing on the shoreline angrily waving thier weapons until they get pelted to death. (unless they are berserk, when it might actually be appropriate...)


I think they do have to go farther than simply breaking line-of-sight. Several good spells and all launcher ammunition reach all the way to the edge of LOS, so if they wait just outside of LOS you can simply juggle them at the edge of LOS until they die. Once they decide they can't win against you here because of the terrain, they should avoid the troublesome location entirely for a while.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Wednesday, 27th July 2011, 17:06

Re: Can Good AI Be Bad?

RFHolloway wrote:3) Possibly (if inteligent) go look for a missile weapon, equip it and come back. If you haven't managed to do that in X turns then revert to normal where you are.

This one is actually quite tricky. You could litter the shore with darts and stones to trick them into staying there. The monster would have to evaluate if it's worth its time to pick up a specific missile. I don't think it's worth it.

smock wrote:First, let the monster move to a random square that is closer than the current square. At present I can (ab)use beams to slay many monsters. This would be a nerf to conjurers.

Second, I spend a lot of time hiding behind a summons or hobgoblin to keep a cyclops from throwing large rocks at me. I'd love it if monsters with missiles approached in such a way that they were moving closer to the player but also, if possible, moving to a square (that is closer to a square) with a clear missile path to the player.

Third, I much approve the idea of randomizing behavior vis-a-vis clouds. If a monster is not guaranteed to charge/flee/etc when facing a dangerous cloud and dangerous missile or melee attacks, then the player's strategy must become more nuanced.

First: I think that's ok. You don't need more reasons to hang in corridors.
Second: This is one of the planned changes I already suggested above.
Third: Their behaviour regarding dangerous cloud is already randomized, but it's very simple. I'd like to add some true pathfinding to it to compare safest and shortest path and find the best compromised. With some randomization of course so that the monster don't always take the optimal path, but something reasonable. Animals can use it too, but will under-evaluate damage so they will be much more reckless, but not as crazy as to go through 5 clouds of conjured flames for example.

KoboldLord wrote:I think they do have to go farther than simply breaking line-of-sight. Several good spells and all launcher ammunition reach all the way to the edge of LOS, so if they wait just outside of LOS you can simply juggle them at the edge of LOS until they die. Once they decide they can't win against you here because of the terrain, they should avoid the troublesome location entirely for a while.

Yes, I thought a bit about it and I think the retreat behaviour would be better by removing the condition "if can reach, then maybe attack". Even if the chance is low, it would probably lead to stupid dances. Let's have the monster retreat for at least LOS range, plus a random amount of time, then go back to wandering.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
smock
User avatar

Snake Sneak

Posts: 128

Joined: Friday, 13th May 2011, 12:06

Post Thursday, 28th July 2011, 10:58

Re: Can Good AI Be Bad?

galehar wrote:
RFHolloway wrote:3) Possibly (if inteligent) go look for a missile weapon, equip it and come back. If you haven't managed to do that in X turns then revert to normal where you are.

This one is actually quite tricky. You could litter the shore with darts and stones to trick them into staying there. The monster would have to evaluate if it's worth its time to pick up a specific missile. I don't think it's worth it..


Good point - could do some chance based on the number of missiles (no of missiles /27 seems appropriate) - the monster could have some chance just to run away anyway. You could put a travel exclusion equivalent until they have some ranged weapon? Do monsters have multiple slots that they can switch between (at least ranged/melee/other (potion/wand))
A troll caster is a hybrid
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 28th July 2011, 12:15

Re: Can Good AI Be Bad?

RFHolloway wrote:Good point - could do some chance based on the number of missiles (no of missiles /27 seems appropriate) - the monster could have some chance just to run away anyway. You could put a travel exclusion equivalent until they have some ranged weapon? Do monsters have multiple slots that they can switch between (at least ranged/melee/other (potion/wand))

Yes, monsters have plenty of slots. Weapon, ranged weapon, 2 missile slots, armour, shield, wand, miscellaneous, potion, scroll and gold. You'd have to take into account the quality of the missile, not just the quantity. Implementing this logic is needed for allies anyway, so maybe it can be used for hostile monsters in this case too.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Ziggurat Zagger

Posts: 5832

Joined: Thursday, 10th February 2011, 18:30

Post Thursday, 28th July 2011, 15:04

Re: Can Good AI Be Bad?

I think I would like to see ranged characters with lots of ammo attack through clouds.

I recently encountered the centaur island (surrounded by water) and I had a flaming sling.
Every sling shot, steam and lose sight, but I kept targeting where the centaurs were and killed them all eventually.

Unfortunately, I ran out of ammo and I didn't have blink. :-/
"Be aware that a lot of people on this forum, such as mageykun and XuaXua, have a habit of making things up." - minmay a.k.a. duvessa
Did I make a lame complaint? Check for Bingo!
Totally gracious CSDC Season 2 Division 4 Champeen!

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Sunday, 11th September 2011, 00:11

Re: Can Good AI Be Bad?

galehar wrote:If a monster cannot attack you, cannot reach you and is taking damage from you, it will retreat. A behaviour similar to fleeing but which will stop on different conditions.

Retreat behavior is silly in 0.10-a0-641-g506fcf9. I came upon an Ogre with my low level berserker. There was open floor between me and the Ogre, and a corridor behind the Ogre. I decided I would throw darts at it as it closed on me, then berzerk when it came to melee range. But when the first dart hit, it decided to retreat, and I could just continue to throw darts. After it fled for three or four turns, it turned to attack again. Two more dart hits, and it retreated again. It kept walking around in circles out of melee range while I killed it with thirty darts and a dozen stones. It could have walked up to me and smashed me with two hits, but the new retreating AI caused it to die without threatening me.

Then again, in my last game, I hit Edmund with a javelin and he retreated. I confused this for fleeing, and figured I had almost killed him with a particularly lucky javelin toss. I attempted to chase him down and finish him off with melee, but it turned out he was at nearly full health and he killed me. The change in AI confused me enough to die rather stupidly.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Sunday, 11th September 2011, 00:52

Re: Can Good AI Be Bad?

Regarding ranged attackers AI: If we want to change it, one options is to have more fast monsters. (Not all ranged attackers, but for yaktaurs it would not hurt.) Another one is to give the AI ( which removes the old corners tactic) only to quick monsters. Still another one is to have ranged attackers wander off if you flee instead of following blindly.

Centaurs are very interesting monsters, especially since you can expect one by D:5. I really like how they're not as trivial to beat up anymore (that you can still trivialise them with Mephitic Cloud will be fixed). This may be less of a concern for later ranged attackers.

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Sunday, 11th September 2011, 09:11

Re: Can Good AI Be Bad?

dpeg wrote: I really like how they're not as trivial to beat up anymore (that you can still trivialise them with Mephitic Cloud will be fixed).


I think, Mephitic has its drawbacks: it's loud, takes a good chunk of MP and doesn't always work by the time centaurs start appearing (btw they now appear on D:2 in trunk sometimes, that's pretty much inevitable demise for a character without strong ranged attack, I believe it's a bit too rough even for OOD). Of course, later they become much less of a problem, but it's the same about almost every other monster: they're dangerous (or deadly if appear OOD) when you first see them, trivial later. If they're trivial by the time they appear or even out of depth (like goliath beetles, or are they some kind of gimmicky free xp kind of deal?), they need improvement. I think, centaurs are fine as they are now.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Sunday, 11th September 2011, 10:11

Re: Can Good AI Be Bad?

dpeg wrote:Regarding ranged attackers AI: If we want to change it, one options is to have more fast monsters. (Not all ranged attackers, but for yaktaurs it would not hurt.) Another one is to give the AI ( which removes the old corners tactic) only to quick monsters. Still another one is to have ranged attackers wander off if you flee instead of following blindly.

Centaurs are very interesting monsters, especially since you can expect one by D:5. I really like how they're not as trivial to beat up anymore (that you can still trivialise them with Mephitic Cloud will be fixed). This may be less of a concern for later ranged attackers.

Just some random thoughts here, no real thorough analysis or anything:

I'm a skeptic when it comes to improving AI, but I think if this is the route crawl is going to take, the improvements should be done in a way that strictly increase the number of choices the player has when fighting enemies. This should really be the "golden rule" for AI changes. If an AI change does not accomplish this (either by keeping the number of choices about the same, or decreasing them), then it is a bad AI change (an example: making centaurs kite the player). Thus, retreating around corridors should still be viable... but so should other methods of attack. Some people might think that retreating tactics are uninteresting, but I disagree - you might be forced to back into unexplored territory, or an area where a monster has wandered into. I can think of several times where my retreat has been cut off by a tough monster, and I find battles can get very interesting when this happens. In other words, I think it's good to encourage players to play in this manner.

Centaurs are indeed interesting - and because of this, I would hesitate to give other ranged attackers speed. I feel quite strongly that Yaktaurs should stay at speed 10, because this helps them be different from centaurs. The whole point of them is that they hit much harder, but are also slower. If yaktaur speeds were bumped (even if they were still slower then centaurs), I think they would just wind up being "greater centaurs" rather than a different type of enemy, as they are now. If a harder hitting, fast ranged enemy is desired, I would suggest adding a new class of centaur for deep levels, say a "centaur warlord" (keeps symmetry with orc enemies). They could lead bands of centaur warriors, or something.

A fast spellcaster enemy could be an interesting addition. There aren't many of these (aside from ones that cast haste). Spriggan air mages are one, but they are only found in a few vaults. The only other one I can think of are sphinxes, but these are more of a melee enemy that just happens to cast (very nasty) spells.

Aside from a few cases like this though, I don't think more fast enemies is really the best idea. The more fast enemies you add, the more haste becomes a must-have spell. If anything, I think the move should be to have fewer slow enemies (especially slow melee enemies, like slugs).

I think your idea of somewhat less aggressive ranged enemies is better than most other ideas about improving their AI (although I still have my doubts). I think, however, that this could be further improved by looking at how bands of enemies have a leader. Perhaps a pack of yaktaurs that has a captain could be a bit smarter than average (although not too smart!), but once you kill the captain the band disperses and their AI degrades to regular dumb monsters. The rationale for this would be that the leader is "issuing orders", keeping the group organized and efficient. Gameplay-wise, it should encourage the player to take out the leader first.

If you want to improve the mephitic cloud situation, allow confused ranged enemies to fire in random directions, like they can already with wands. This won't magically fix things, but it will be a step in the right direction and is pretty sensible.

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Sunday, 11th September 2011, 12:12

Re: Can Good AI Be Bad?

jejorda2 wrote:
galehar wrote:If a monster cannot attack you, cannot reach you and is taking damage from you, it will retreat. A behaviour similar to fleeing but which will stop on different conditions.

Retreat behavior is silly in 0.10-a0-641-g506fcf9. I came upon an Ogre

And it's not just Ogres. I got through a Bailey by throwing darts at a few orc knights while they walked in circles and waited to die. Poison needles destroyed a pack of death yaks while they failed to attack. If I had blink, a speedy character, or ranged weapon skill higher than 1, it would make sense for ranged trash to be somewhat effective. But lots of enemies are now doing unbelievably stupid things to let themselves be killed by +0 darts. With this AI, anything without a ranged attack (or animal intelligence) may as well be a plant.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Sunday, 11th September 2011, 19:44

Re: Can Good AI Be Bad?

jejorda2 wrote:
galehar wrote:If a monster cannot attack you, cannot reach you and is taking damage from you, it will retreat. A behaviour similar to fleeing but which will stop on different conditions.

Retreat behavior is silly in 0.10-a0-641-g506fcf9.

Yeah, sorry it was bugged. Should be better now.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
Previous

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 205 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.