Monster AI, esp. spells


Although the central place for this kind of discussion is on the CDO wiki, some may find it helpful to discuss potential requests and suggestions here first.

Mines Malingerer

Posts: 30

Joined: Wednesday, 5th February 2014, 19:07

Post Sunday, 10th September 2017, 15:51

Monster AI, esp. spells

I looked into how exactly monsters decide when to cast a spell, use an ability, or move / do something else on their turn (mostly focusing on spells). Since a lot of monster behavior relies on contingencies, I worked with the assumption that the monster was aware of their target, within LOS, and not addled by any AI-affecting statuses. (This is the most common way state you will fight a monster in, anyway.)

Once I explain my findings on this behavior, I will make some statements about the gameplay impact and propose changes where appropriate.

Investigation

Here are my findings from some source-delving, starting with spell handling and working up to a monster's turn. I will also summarize below.
1. _find_spell_prospect operates on a 'viable' (see 3) subset of the monster's spell table (found in mon-spell.h). Each spell is basically assigned a range with a size matching its frequency, starting from 0. (So, for example, if a monster had two spells with frequencies 20 and 40, the first would have the range 0-19 and the second would occupy 20-59.) These ranges are checked against a random number, 0-199. If the random number falls into a range, the corresponding spell is chosen. If it lies inside no range, no spell is chosen instead.
2. This is called from _choose_spell_to_cast. This spell can try _find_spell_prospect twice if a beam spell is attempted but fails - but this also makes an assert fail, so it probably doesn't happen often. (Note that on the second try there is a 1/2 chance of trying a self-enchantment instead, which always succeeds if tried. Maybe this is to avoid repeated beam targeting failures?)
3. This is called from handle_mon_spell, which also generates the 'viable' subset of the spell table by calling _find_usable_spells. This is another rabbit-hole, but basically most spells will pass through and hexes may pass through based on a heuristic for success (spell power vs. a guess of the target's MR).
4. This is called from _do_mon_spell.
5. This is called from handle_monster_move, where it has a 1/2 chance of being called first before a special ability (otherwise the ability can attempt to happen first instead and the spell is attempted only if that fails). After this, plenty of other stuff is attempted, such as ranged attacks, wand zapping, and so on. Probabilities on these are outside of scope, but if all these also fail then the monster will try a move/attack (depending on distance to the target).


To summarize, let's take a specific example. Here's the Tormentor's spell table:
  Code:
{  MST_TORMENTOR,
      {
       { SPELL_PAIN, 28, MON_SPELL_MAGICAL },
       { SPELL_SYMBOL_OF_TORMENT, 29, MON_SPELL_MAGICAL },
      }
    },


The numeric argument is frequency here. Based on a roll of 1d200-1, Pain will be chosen if the result is within [0,27] and Symbol of Torment will be chosen if the result is within [28,57]. Any result beyond that will cause no spell to be chosen (and the monster will do something else).

Basically, on any given turn, the Tormentor has a 28/200 chance of casting Pain, a 29/200 chance of casting Symbol of Torment, and a 143/200 chance of moving or attacking if near (assuming the Tormentor has nothing else to try, like zapping a wand). Note that Pain is considered a hex and so may be evaluated as not viable on any given turn, based on the target's MR. So in turns when Pain is considered unviable, its 28/200 chance would go away and move/attack/etc. would rise to 171/200.

Also important to note is that Tormentors are 'fast' (speed 13), so these 'turns' will be occurring more often than usual. Bad stuff like torment may 'feel' more frequent because of that (but really it's just that everything they do is more frequent).

To ensure that I wasn't entirely off with my interpretations, I also ran some trials on a Tormentor. Here are the results:
  Code:
t = Used Symbol of Torment
x = Moved/Attacked (note that Tormentors get two pain-branded attacks. Both are considered as just one mark, of course).
p = Used Pain

MR:0, Adjacent to enemy
pxxxxxttpxxpxxxtxxxxttxxpxxxxxx
n=31 | p=4,t=5,x=22 => p=12.9%,t=16.1%,x=71%

MR:++, Adjacent to enemy
xxppxpxxxtxxxxxppxxxxtxxtxxxpxxpxxpxxtxxxxxtxxttxxxppxtxx
n=57 | p=10,t=8,x=39 => p=17.5%,t=14%,x=68.4%

MR:++++, Adjacent to enemy
txxxxxxxtxxtxtxxxtttxxxxxxxxxxxtxxxxxxxxtt
n=42 | p=0,t=10,x=32 => p=0%,t=23.8%,x=76.2%
MR++++, Adjacent to enemy (again)
ptxxxxtxxxxxxxxxpxxxpxxxxxxxxxxxxxxxtxtxxxxxxxxxtxxxtpxtttx
n=59 | p=4,t=9,x=46 => p=6.7%,t=15.3%,x=77.9%

MR:++, Not adjacent to enemy (blinked away constantly)
xxpxxxxxpxxxxxptxxxxxxxxxxtxxxxxxtxxtxxxxxxxxxxxxxxxxxxxtptxttxpxxxtxxptxxpxxxpx
n=80 | p=8,t=10,x=62 => p=10%,t=12.5%,x=77.5%


Notes:
  • In the high-MR trials, Pain was very rarely casted, meaning it was not chosen as viable very often. In one of the trials, it seemed like Symbol of Torment got more frequent to compensate for Pain missing, but the code doesn't seem to support this behavior and I couldn't replicate it in further trials - so that's probably just an outlier.
  • I tested adjacent trials and a non-adjacent trial to see if monsters would use spells less when near in favor of melee attacking. It doesn't seem like this is so (i.e. move in has the same frequency as melee attack, so the frequency of spells isn't affected). I haven't investigated how ranged attacks behave yet though, so there might still be some truth to this (just not for spells).

Gameplay Impact

Basically, monsters will use their spells (and ostensibly abilities) completely at random, usually with just a fixed probability. This means that, in ten turns with a Tormentor, you might see it move or perform its attack ten times in a row, or torment you ten times in a row. In fact, there is nothing stopping every torment-capable monster in the game from tormenting you every single turn they get, and similarly there is nothing stopping them from never tormenting you once. (Note that I am just saying there's nothing stopping this - not that it's likely to happen.)

Compounding this, consider the usual way in which one fights a Tormentor, especially a melee specialist. If you don't have a decent ranged option, you will try to close the distance between the two of you to get rid of them. Assuming the Tormentor is on the edge of your LOS, there are usually 6 spaces between the two of you. If the Tormentor decides to only torment you, you can spend 60 aut moving in and get tormented 7-8 times for it (from which a 400+ HP robustx3 troll with rN+++ would be reduced to ~20 hp!). Alternatively, you can spend 2-3 turns moving in and the tormentor can move in 3-4 times, and you'll find yourself adjacent in 20-30 aut with no damage taken. What I'm getting at here is that an enemy choosing to move in when at range is doubly beneficial since they aren't doing anything damaging and it minimizes the amount of time spent not adjacent to the enemy. Characters who primarily attack at range just get the didn't-attack benefit of the monster moving in, but that's still beneficial.

This same sort of logic applies to spells like Malmutate and Damnation(?), probably Smiting, Lehudib's Crystal Spear, a maybe a Centaur's ranged attack, and basically any other dangerous spell, action, or ability in the game.

Suggestions For Improvement

A lot of things in Crawl are random, so it's not like changing how the AI works for spells/etc. would be the silver bullet that fixes everything. That said, I think its effects can be very prominent, especially with spells like Symbol of Torment or Lehudib's, every cast of which could entirely alter the player's favor to win the battle. When you consider that their frequency of occurrence is completely uncontrolled, you accept that the outcome of combat with these monsters is uncontrolled. The only smart thing to do in these situations is to use a panic button when the random chance gets to be too much, and reset the fight until things go your way. That the player has the ability to do that is another issue, but even if they didn't it this random behavior would still be a problem (since every nth fight with a tormentor could be unavoidably deadly). The problem here really arises due to an obvious power differential between 'move in' and 'you lose half your life' (or other bad stuff depending on the spell).

Anyway, I think a small change to the monster AI in this area would go a long way towards reducing frustration/tedium when fighting monsters wielding threatening spells. I can imagine several different solutions, but I'll stick with just one idea for now.

Proposal: Assign monster spells/abilities/powerful actions an 'energy' cost, like MP but for monster usage. Give monsters 'energy meters' (just internally, not asking to display another cluttery bar) that fill up rapidly over time (effectively whenever the monster moves or does something less dangerous). A spell/ability/powerful action can only be used when the monster has enough energy to use it. Near max energy, monsters can favor expending it more often (to avoid wasting it). Monster energy upon noticing you could start at 1/2 or some randomized number to avoid ability spam upon starting a fight.

Details: Monsters would mix moving with powerful things more often and at a controlled pace. Depending on how it's tweaked, a Tormentor's move list might look something like this:
tpxxxtxxtxpppxxxttxxtxxx
As opposed to this:
xxxxxxtppttxxtpxxxxxxtpxtt
To further illustrate how this energy system would work, here's a few turns for a Tormentor with some made-up energy costs:
Energy max: 100
Energy regen rate: +25/turn
Torment energy cost: 75
Pain energy cost: 40

1: Torment (Energy 100/100 => 25/100 => 50/100) (energy cost, then energy regen happens)
2: Pain (Energy 50/100 => 10/100 => 35/100)
3: Move (Energy 35/100 => 60/100) (Note that the Tormentor must move here...)
4: Move (Energy 60/100 => 85/100)
5: Torment (Energy 85/100 => 10/100 => 35/100) (Note that the Tormentor would favor using a power here to avoid energy overflow)


Well, these numbers seem to make pain/torment more common than it was before, but they can be tweaked to be closer to their original probabilities in frequency. The benefit here is that there is some close-to-guaranteed amount of energy that is expended for any given length of time (depending on how strongly overflow is avoided). Abilities still happen randomly, they just don't run off the rails to avoid the obvious power imbalance between always moving and always tormenting.

I hope that all made sense. Let's discuss.
limboring→optimal sanity = 0

For this message the author Veras has received thanks: 2
VeryAngryFelid, yesno

Vaults Vanquisher

Posts: 422

Joined: Thursday, 16th February 2017, 15:23

Post Sunday, 10th September 2017, 17:30

Re: Monster AI, esp. spells

I sometimes wonder what it would look like if someone hacked something like the *band "4GAI" into crawl and we had monsters that run away to call other monsters, try to surround you, and so on. It would be a totally different game. Perhaps with enough work and polish, it could even be a better game.

I don't think you've thought through what you're suggesting. The idea of constraining monster behavior with mp is extremely obvious. It is also extremely bad. The scenarios you suggest, like the tormentor who casts torment 7 times in a row, are already constrained by being highly unlikely. Monster behavior is randomized by design and it is fairly stupid by design. You suggest that tormentors, a speed 13 monster, shouldn't approach the player from the perspective of their own rational self-interest. Again, this is obvious. What they should do if they want to win a fight with a player that takes 10 auts to move is kite the player and cast torment when a double move is available. Wouldn't that be fun? [edit: There actually is a monster that does something like this, the red devil. This was introduced, the commit message says, as a "unique little quirk." It is unique in that it is the most annoying monster behavior in the game and should have been removed years ago.]

Weirdly, though, there are monsters who have this sort of constraint. Dragons cannot just breathe continually, they run out of "breath." I'm kind of amazed this mechanic exists, but it doesn't seem to make a lot of difference in gameplay, so whatever. As you mention, there's also a certain amount of intelligence in spell selection because of this MR business. In reality, tormentors just shouldn't have the pain spell, which is unlikely to land on most characters who run into tormentors. Crawl's design is inconsistent. While some monsters are made smarter by not casting spells that won't work, others are made dumber by sometimes casting spells that never do anything (so called "cantrips").

It would be great if some good ideas on monster AI would show up. There's a lot of potential there. But AI improvements are not going to look like additional constraints on unlikely behavior. New AI/behavior should make monsters behave in a very novel way with real gameplay impact that is as easy to grasp and explain as existing behavior. Monster mp or energy or ability cooldowns are not like that. For a while devs were trying this idea of spells that act on a few turns' delay similar the ironbrand convoker recall ability. It was different, but in a bad way and those monsters and behaviors have been removed. Crawl has a kind of pack AI which mostly has the effect of making monsters in packs easier to escape and easier to arrange free hits on. I saw a Patashu post a while back that suggested making packs of monsters track the player as a group rather than as individuals. Makes sense to me, but maybe it would actually suck. That's the only AI suggestion I've seen in a long time I thought would be worth trying.
*Lana Del Rey voice* , video games...

For this message the author watertreatmentRL has received thanks: 2
duvessa, yesno

Mines Malingerer

Posts: 30

Joined: Wednesday, 5th February 2014, 19:07

Post Sunday, 10th September 2017, 18:52

Re: Monster AI, esp. spells

I'm not actually trying to suggest we make the AI 'smarter'. Smart tormentors would kite you to death and use torment exclusively until your max hp is in the single digits, then try pain or attacking depending on your MR. This would be horrendous to play against, of course, and anything that even steps in that direction is probably not going to be a positive change.

My suggestion is aimed at making the AI more predictable (by trying to control the 'nastiness' per unit time of a monster's actions so their random behavior can't be gamed). They would remain just as stupid in deciding which actions they elect to take - but with an upper and lower bound on how dangerous their salvo ends up being (not at all: always moving, very: always tormenting)

To clarify here, 'energy' (maybe it's a bad name) is just a low-level description of how I would implement this mechanic which is ultimately geared towards managing the 'nastiness' of a monster's actions over time. It's not really similar to monster MP, or at least I would have to disqualify many of the other connotations MP brings with it to call it that (I should have been more clear about this in the original post - I brought up MP to get the idea of a bar with a max, min, and current value across but things like the slow refill rate, etc. weren't intended). And I was not insinuating that tormentors should be changed so that they don't approach the player to become more 'tricky', I was saying that it's bad for the player currently if they just randomly decide to do that.

Weirdly, though, there are monsters who have this sort of constraint. Dragons cannot just breathe continually, they run out of "breath." I'm kind of amazed this mechanic exists, but it doesn't seem to make a lot of difference in gameplay, so whatever

Since fire dragon breath can do up to 72 damage and their melee attack is weak in comparison, I actually think this is a good thing and similar to what I'm looking for with more moves. I don't really care about the flavor here, just the gameplay impact of them not using their strongest move at all times due to a lack of limitations.

There are plenty of problems with this idea though. I guess I'll list them off to expedite things.
  • Knowing exact energy costs could allow players to determine when a move can/can't be used. Obviously terrible and tedious - a solution might be to have the system apply somewhat weakly, with probability of use just fading over time instead of reaching 0.
  • Monsters low on energy might choose low-energy-cost abilities too often, to the point that they can never recoup enough energy to have a chance at using higher-cost ones.
  • It's another behavioral quirk of the AI that would have to be understood. Since I didn't even know how they chose to act before (other than having a general feel of it being random over years of playing), I'm not sure a tweak in how they choose to act would be overtly noticeable, especially if it's just geared towards reducing outlier situations like 10 moves or 10 torments.
Regardless of these I think some of the randomness in crawl should be addressed one way or another. Also feel free to bring up more issues that this might carry with it, I'm not sure this was everything.
limboring→optimal sanity = 0

Vaults Vanquisher

Posts: 422

Joined: Thursday, 16th February 2017, 15:23

Post Sunday, 10th September 2017, 19:48

Re: Monster AI, esp. spells

Well, "gaming random behavior" is the game. The tactics of the game will become more static if you place additional constraints on the monsters and there's a lot of reason to believe that the way monsters behave at present is, by and large, reasonably well balanced and doesn't produce unplayably erratic combat.

The outer reaches of extreme improbability are in there by design. Monsters are supposed to do surprising things sometimes.
*Lana Del Rey voice* , video games...

For this message the author watertreatmentRL has received thanks:
duvessa

Mines Malingerer

Posts: 30

Joined: Wednesday, 5th February 2014, 19:07

Post Sunday, 10th September 2017, 20:23

Re: Monster AI, esp. spells

Well, yes and no. Of course random chance has its place, it's part of why the game is endlessly replayable. But 'here's a 12% chance to instantly halve the player's hp, go wild' is not my idea of well-managed random chance, and I don't want it to be in there unregulated.

The problem isn't only there in extreme edge cases. A player may fight scores of torment-capable monsters throughout the game (lots of dice rolls makes one unlikely sequence more likely), and even the difference between two and zero torments can be enough to make a fight go poorly instead of well (even somewhat likely events can be bad). And again, the appropriate recourse in the bad situation isn't fun or surprising, it's usually going to involve resetting the fight and doing the same thing again hoping for a different result - or maybe breaking groups up into chunks with stairdancing, but that's another issue entirely.

This isn't just about the design of torment sucking though, I was trying to make an example and a wider argument for any powerful spell or ability. I'm hoping for control over how random the AI is, not whether it's random at all.

In a similar vein and to clarify my point, I would also suggest making damage rolls three or four times and averaging the results. I think in statistics terms, I want to reduce the standard deviation. I actually want a little more than that, in the form of a hard upper and lower bound on damage as well (it would be loose though - maybe 10% and 90%).

Looking at it this way, you can consider monster actions as a form of damage. High 'nastiness' sequences of actions would correlate with high damage and so on. I want the distribution of these actions to have that upper and lower bound, and maybe more of that normalization as well. I think the standard normal distribution given just by having events be random is close enough and easy enough to implement that most people don't see its side effects as a problem.
limboring→optimal sanity = 0

Crypt Cleanser

Posts: 665

Joined: Monday, 29th September 2014, 09:04

Post Monday, 11th September 2017, 01:30

Re: Monster AI, esp. spells

I agree that your proposed design would reduce the variation in monster spell casting frequency, but I'm not sure you've made a good case for why the current level of variation is too high.

For this message the author chequers has received thanks:
duvessa

Mines Malingerer

Posts: 30

Joined: Wednesday, 5th February 2014, 19:07

Post Monday, 11th September 2017, 02:03

Re: Monster AI, esp. spells

Hmm, the negatives as I see them were mostly outlined here:

Compounding this, consider the usual way in which one fights a Tormentor, especially a melee specialist. If you don't have a decent ranged option, you will try to close the distance between the two of you to get rid of them. Assuming the Tormentor is on the edge of your LOS, there are usually 6 spaces between the two of you. If the Tormentor decides to only torment you, you can spend 60 aut moving in and get tormented 7-8 times for it (from which a 400+ HP robustx3 troll with rN+++ would be reduced to ~20 hp!). Alternatively, you can spend 2-3 turns moving in and the tormentor can move in 3-4 times, and you'll find yourself adjacent in 20-30 aut with no damage taken. What I'm getting at here is that an enemy choosing to move in when at range is doubly beneficial since they aren't doing anything damaging and it minimizes the amount of time spent not adjacent to the enemy. Characters who primarily attack at range just get the didn't-attack benefit of the monster moving in, but that's still beneficial.


The difference between the two cases is massive, because the power differential between move in (which may even be beneficial to the player) and torment/other nuke spells/bad stuff is massive. A single fight with one monster can be deadly or trivial to the same character. Unmanaged random chance does little to help here. With even one unwanted additional cast of torment, and a fight can become dangerous enough to warrant escape. And since a fight like this can be trivial eventually, resetting means that it will eventually be trivial - just with some annoyance between. Note that my argument isn't intended only to reduce 'unfair' situations where bad stuff happens many times, but also to reduce trivial situations where only a monster's weakest option is used. I think as a player I'm a bit more aware of the former, but the latter can lead to an equally dissatisfying experience.
limboring→optimal sanity = 0

Vaults Vanquisher

Posts: 422

Joined: Thursday, 16th February 2017, 15:23

Post Monday, 11th September 2017, 02:45

Re: Monster AI, esp. spells

Another constraint you're not taking into account here is the time it takes for these freak events to unfold. If you're taking that many torments in a row, you generally do something about it. If you can only take two or three in an encounter with a given monster, you won't have to do anything about it most of the time because you know they can't do it again and they've got nothing else.
*Lana Del Rey voice* , video games...

Ziggurat Zagger

Posts: 3070

Joined: Friday, 8th May 2015, 17:51

Post Monday, 11th September 2017, 04:32

Re: Monster AI, esp. spells

chequers wrote:I agree that your proposed design would reduce the variation in monster spell casting frequency, but I'm not sure you've made a good case for why the current level of variation is too high.
Some monsters like ancient lich can kill full HP formicid with 2 casts of LCS, I believe we should reduce number of unavoidable deaths if we can do it without much harm done to gameplay
Underestimated: cleaving, Deep Elf, Formicid, Vehumet, EV
Overestimated: AC, GDS
Twin account of Sandman25

Ziggurat Zagger

Posts: 3070

Joined: Friday, 8th May 2015, 17:51

Post Monday, 11th September 2017, 04:41

Re: Monster AI, esp. spells

I like OP idea but I think it will better have a separate energy for every spell. Advantages: 1. We can customize some spells to be spammable and some non-spammable. 2. Monsters will cast several different spells more often which is more fun IMHO
Underestimated: cleaving, Deep Elf, Formicid, Vehumet, EV
Overestimated: AC, GDS
Twin account of Sandman25

Crypt Cleanser

Posts: 665

Joined: Monday, 29th September 2014, 09:04

Post Monday, 11th September 2017, 05:44

Re: Monster AI, esp. spells

I agree that the current system makes it very dangerous when monsters get double or triple casts of deadly spells. And I especially agree that there's nothing "good design" about being hit with two max damage LCS.

I would be interested in playing a patch that changes monster AI so that sequential use of the same spell (including "no spell") is less likely.

There might be a simpler way to implement the behaviour than needing to implement spell energy while getting almost the same mechanical effect. I am thinking of just attaching data to each monster listing the time it last used each of its spells, and having a chance to re-roll the d200 decision if you roll a spell that was used too recently (eg 90% chance to re-roll if you used the spell within 10 aut down to 0% after 50 aut).

For this message the author chequers has received thanks:
VeryAngryFelid

Ziggurat Zagger

Posts: 7705

Joined: Sunday, 5th May 2013, 08:25

Post Monday, 11th September 2017, 05:56

Re: Monster AI, esp. spells

chequers wrote:I agree that the current system makes it very dangerous when monsters get double or triple casts of deadly spells. And I especially agree that there's nothing "good design" about being hit with two max damage LCS.

I would be interested in playing a patch that changes monster AI so that sequential use of the same spell (including "no spell") is less likely.

There might be a simpler way to implement the behaviour than needing to implement spell energy while getting almost the same mechanical effect. I am thinking of just attaching data to each monster listing the time it last used each of its spells, and having a chance to re-roll the d200 decision if you roll a spell that was used too recently (eg 90% chance to re-roll if you used the spell within 10 aut down to 0% after 50 aut).
If players getting one- or two-shot by LCS is a problem, I think it would be better to simply reduce the damage of monster LCS (and similar spells) and increase their casting frequency. An LCS that gets cast four times as often but does one-fourth the damage would eliminate what (I assume) the complaint is about - excessive variance - without increasing complexity.

Being rewarded for remembering a monster's recent actions would be very bad IMO. Right now, if you see a screenshot (or load a saved game!) and see where the monsters are, you have almost ideal information about them - remembering previous actions might narrow down the possible HP values of an injured monster, or help you figure out how likely it is for new monsters to enter LOS, but overall the only highly relevant information is what monsters are around and where they are.
With these proposals, you'd want to remember what spells a monster has cast recently and when, which is giving the player a bunch more stuff to keep track of, without adding any tactical depth to make up for it.

For this message the author duvessa has received thanks: 4
chequers, nago, VeryAngryFelid, watertreatmentRL

Crypt Cleanser

Posts: 665

Joined: Monday, 29th September 2014, 09:04

Post Monday, 11th September 2017, 07:38

Re: Monster AI, esp. spells

I'm not completely convinced that monster spell frequency modifiers is "highly relevant information". It feels more like something which is theoretically useful to know, but not all that critical. It's basically as important as the (hidden) sputtercasting counters that certain monsters already use.
Like, if you are a few squares from Erolcha, does it make a difference to the advice you'd give to a player whether she cast banish last turn or not at all? The cast rate in these two worlds would be like 2% vs 10%.

Blades Runner

Posts: 539

Joined: Monday, 23rd March 2015, 05:29

Post Tuesday, 12th September 2017, 22:38

Re: Monster AI, esp. spells

I like the idea of improving monster AI in some ways but also I think something Crawl teaches is not to gamble... Events with a small % chance to kill you occur over and over again. One will eventually get you. So if something has a significant nonzero chance of killing you in a small number of turns, you should treat it as though it will definitely do that.

For this message the author yesno has received thanks: 2
Rast, VeryAngryFelid

Vestibule Violator

Posts: 1474

Joined: Tuesday, 13th March 2012, 02:48

Post Wednesday, 13th September 2017, 05:15

Re: Monster AI, esp. spells

yesno wrote:I like the idea of improving monster AI in some ways but also I think something Crawl teaches is not to gamble... Events with a small % chance to kill you occur over and over again. One will eventually get you. So if something has a significant nonzero chance of killing you in a small number of turns, you should treat it as though it will definitely do that.


Mmmm. You have to take into account how many fights you'll get into with similar or worse risk. If the monster has a 6% chance to kill you and you will have maybe two other fights like that that this game, it's an OK risk.

Unless you are on a five streak.

Fucking five streaks, I can never get past them. http://crawl.akrasiac.org/scoring/players/rast.html

Ziggurat Zagger

Posts: 3070

Joined: Friday, 8th May 2015, 17:51

Post Wednesday, 13th September 2017, 05:55

Re: Monster AI, esp. spells

It is hard to estimate how many fights like that you will have. 6% is too high for me, I think it can be useful to assume it is last fight and spend everything you have
Underestimated: cleaving, Deep Elf, Formicid, Vehumet, EV
Overestimated: AC, GDS
Twin account of Sandman25

Dungeon Dilettante

Posts: 4

Joined: Wednesday, 30th August 2017, 23:08

Post Wednesday, 13th September 2017, 18:37

Re: Monster AI, esp. spells

So, I'm not TOTALLY convinced this is a problem, but other games have adjusted RNG so that, a 10% chance of landing a critical hit leaves you extremely unlikely to land two critical hits in a row, but you're more likely than 10% to crit on subsequent hits so the end result is "10% of your hits are crits." We could conceivably change the RNG such that it discourages (or disallows) casting the same spell twice in a row, then increases the chances slightly in subsequent turns, so designing a monster that casts spells with 1/4 of its turns (or whatever) is still clear, but the AI should resist streaking. It's a more complicated system, but we could still allow for the possibility of streaks, while making it diminishingly likely for something to LCS you 4 turns in a row or whatever.

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

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