Suggestions for Monster AI

Suggestions for new features for inclusion in RTC. Note that all the suggestions that have already been implemented have been moved to the RTC Archive forum.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Suggestions for Monster AI

Post by George Gilbert »

These suggestions / comments were sent to me by Lunever in a PM, but the answers aren't secret and might be interesting for others so I'm replying here!
I assume, many monsters do have a visual sense, reacting upon sight. If still out of direct line of sight to the party: Do they also see flying missiles and similar and will they investigate them if so? Do see the party only, or do they see the light spread by the party too (that'd be cool, it would create an etire new ninja-like combat tactic approach, sneaking up to monsters in the dark. Maybe that could even increase ninja damage)? Can monsters glow in that they do not only have body parts, that don't darken in low-light conditions like the other body parts, as some parts of the screamer grafics are supposed to, but in that they spreaed light by themselves, visible to the party if wandering about in low-light conditions?
Interesting idea, but monsters don't currently have any concept of light / dark. The assumption being that they can all see in the dark because they live there. Monsters can only sense where the party is and only then when they're within a given radius (which is already configurable on a per monster type basis).
If monsters with visual senses approach an invisible party, will they always ignore it, or do they react to the parties actions?
Always ignore it.
Can custom monsters possibly use the invisibility spell themselves (OMG - invisible gigglers...)


Yep, they can already do this :twisted:
Is it possible to have light sensitive monsters that will avoid certain light levels (imagine a floorpad triggering spectre that will only appear in the dark or a fairy that only shows up in twighlight).
Again, interesting idea, but not currently possible.
Would a monster with visual senses follow a trace of magic footprints (THAT'D BE COOL!!!)
!
I know that monsters will respect a fake wall until the party passes through. Does party passing through generally disable a specific fake wall for all monsters or do monsters individually memorize whether a wall is fake or real? If the latter is the case, will they only be enabled if they see or otherwise sense the party passing through? Would they also disbelieve the illusion if they saw another monster or missile passing through?
No, the map of the dungeon that monsters use to navigate is held globally, not per monster. This is purely a practical measure to keep down memory usage. A fake wall is only marked as an open tile when the party passes through it (and not when a missile / spell does).
Can they be made to hesitate a slight moment before passing a fake wall, as player characters also often do?
Not easily
I assume, that there are monsters with tremorsense, sensing the parties movements, as worms are supposed to do. If such a monster moves into perception range to a still standing party, will they ignore it and pass by harmlessly? Would they feel an item dropped or a wall or door being knocked or triggered (or even bashed)?
Not applicable because that isn't implemented! (but again, it's an interesting idea for the future).
Do monsters with or without whatever senses always sense a party on the adjacent tile (lets say like by smell or warmth or something)? Or can a threatening monster pass harmlessly by the party in the right conditions?
Monsters will always detect a party on the adjacent tile.
I assume that there is an accustic sense. Does it react to the parties footsteps? If so, is there a difference left between having accustic senses only or accustic senses AND tremorsense? MOST IMPORTANT: Does a monster hear an item hitting the floor and/or dropping to the ground, or a door operated or a floorpad triggered or a teleporter buzzing or a wall or door being knocked (or even bashed)? If it heard such a sound, would it investigate it? It'd be so cool to lure monsters by throwing stones, especially while invisible. Would a monster hear a warcry or horn blow from a distance? If so, how would it react? Would it have to make a saving throw vs. fear? If it succeeded at the save, would it come to investigate?
Not applicable because that isn't implemented! (but again, it's an interesting idea for the future).
Would it be possible to have monsters be able to trace the party by investigating left behind items?
Monsters currently ignore items and only go after the party.
Do the different senses have individual range?


Currently there's only the one sense so yes! In the grand scheme of things, then if there were multiple senses then they would be individually configurable.
Would it be possible to create custom monsters that are able to climb stairs without having to emulate that poorly by teleporters?
Why are teleporters "poor"? Internally, that's all stairs are (a special case teleporter), so I'm not sure what the problem is with the current implementation.
Does the engine allow for custom monsters that are able to backstep or sidestep? Humanoids caught under a closing door should strike and backstep, not do a circular jig.
Not currently, but a good idea for the future.
Can monsters have an intelligence flag or byte to determine, whether they can backstep, sidestep or do tricky manoevres (see below)?


Seems reasonable (when there's parts of the AI to turn on / off).
Currently all monsters quickly close in and only attack when adjacent to the party, no matter whether they attack by close combat or by spells. Can monsters with ranged attacks first shoot from afar and then randomly decide whether to shoot again or to close in?
It's always random, but tilted by the relative recovery time between movement and attacking for each monster. The monsters in DM move faster than they recover from attacks, so they nearly always (remember, it's random) move rather than attack. For custom monsters, this could be pushed to be the other way around or more balanced.
Can monsters attack with physical missile, like let's say enemy archers?
Yes, that's already possible - just give them an attack method that creates arrows (or whatever else you fancy).
Can smart monsters jump out from behind a corner, fire their spells or missiles and then duck back again behind the corner, as player characters often do?
Not yet, but again an interesting idea. Having said that though, in earlier versions of RTC, when monsters were more intelligent and waited to ambush the party everyone complained that they were too clever, so I'd be reluctant to add too much extra AI in...
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Ah, how could they complain about more intelligent monsters? I mean, an improved AI is way more intersting to spice things up than just increasing their stats to overexxagerated values.

Since I can't fight toe-to-toe with the setting I'm currently testing, I have lured almost every monster since the worm level into a spot where it is completely helpless (which sometimes has been more difficult than this may sound). Once there, it's become a boring game of patience. Pump in 1000 or 2000 Mana (and sleep in between) and/or move-strike-move some 300 times (these figures are NOT exaggerated), the latter because monsters have such a high resilience at high level, that even my strongest tank with a good weapon only inflicts 1-6 points of damage, with 3 points being average at best (maybe not only incoming damage, but also outgoing damage, that is monsters' resilience/armour should also be rescaled). I would love to see the difficulty improve in a more interesting way, that is by improving monster AI.

But since there seem to be players who wouldn't like that - hey, here comes the intelligence flag/byte: Tricky manoevres could be restricted to smart monsters, monsters being not smart by default, but may be made smart by a config option as default or by a dungeon.txt override or be adapted to being smarter by the automatic (or manual) difficulty increase, and of course custom monsters may be smart.

BTW: Monsters do have health like player characters do, but they don't naturally heal like PCs, which should stay that way for the dungeons designed by FTL. But is it possible to create custom monsters with a variable regeneration rate (default=0)?

Speaking of believable humanoid custom foes: Is it possible to assign a Mana value to a custom monster instead of having it cast an infinite number of spells? Would it be possible to set a regeneration rate for them (again default=0, or better make all monsters have Mana by default but have a very high regeneration rate also by default)?

Can enemy archers have a limited amount of ammunition? This may not only be realistic, but may also prevent a dungeon and its performance to be flooded by arrows. Can the arrows used be deducted from the number of arrows the enemy archer would leave behind upon dying? In case of an infinite number of arrows, can they be made not to remain as items after impact like incoming spells (again in order to prevent the dungeon to be flooded by arrows, but a finite number of arrows would be more important; of course in case of infinite arrows shots performed should not be deducted from the number of arrow items the foe is leaving behind upon death)?

I imagine designing a group of Drow that will jump out behind a corner, shoot a couple of fireballs, ducking back behind the corner, jumping out again to shoot a couple of crossbow bolts and then join the fray with their scimitars. But maybe they would flee blinding white light...
Parting is all we know from Heaven, and all we need of hell.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Lunever wrote:BTW: Monsters do have health like player characters do, but they don't naturally heal like PCs, which should stay that way for the dungeons designed by FTL. But is it possible to create custom monsters with a variable regeneration rate (default=0)?
They can already do this - just assign them a heal attack method.
Can enemy archers have a limited amount of ammunition? This may not only be realistic, but may also prevent a dungeon and its performance to be flooded by arrows. Can the arrows used be deducted from the number of arrows the enemy archer would leave behind upon dying? In case of an infinite number of arrows, can they be made not to remain as items after impact like incoming spells (again in order to prevent the dungeon to be flooded by arrows, but a finite number of arrows would be more important; of course in case of infinite arrows shots performed should not be deducted from the number of arrow items the foe is leaving behind upon death)?
That can already be done too - just create a cloned arrow with a finite lifetime and have the monster attack with the new arrow.
User avatar
Sophia
Concise and Honest
Posts: 4249
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Floorpad triggering monsters that only came out in the dark, or such things, would be quite doable with pure dungeon mechanics if only we had a way to query numerical values and take action based upon them. Hmm... what an idea. ;)

Following footprints would not actually be that hard, assuming the footprints left behind were each assigned a unique, increasing id number. The monster, upon noticing a footprint, would simply scan the adjacent squares for a higher footprint number. It'd lead it right to the party. Ooh, how evil.

For "senses," it could be interesting to have a list of object types the monster considered to be an obstacle. Then a monster could use "sight" by being blocked by walls and doors. Perhaps a smell-based monster would not be fooled by walls and doors, but clouds would be considered an obstacle! (A big smelly ven cloud hides traces of things beyond...)

As for ammunition... another option would be to assign a monster a number of "charges." Charge-using attack methods employed by the monster would use up one of these charges. Once the monster was out of charges, it could have an optional CONVERT_OUTOFAMMO or the like, or otherwise, just keep using its non-charge-using attack methods. :)
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

If that footsteps idea should be implemented some day: Would it be possible for dungeon designers to have an unwitting party be hit by a footstep spell? Could tiles have an integrated (non-magical) footstep capability with custom grafics (with a limited duration too), so you can design things like a dessert, where the party leaves footprints, and giant bug generators that spawn monsters who will follow the parties trace?


Albeit some of my ideas might allow for a couple of interesting puzzles, most are pretty difficult to implement, even if that would be intended. So I would like emphasize, that the one new idea I would really really really like to have implemented is to enable monsters to perceive missile items dropping to the floor and investigate them if they can't perceive the party. It'd be so cool to lure monsters around by throwing stones!
Parting is all we know from Heaven, and all we need of hell.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Lunever wrote:Would it be possible for dungeon designers to have an unwitting party be hit by a footstep spell? Could tiles have an integrated (non-magical) footstep capability with custom grafics (with a limited duration too), so you can design things like a dessert, where the party leaves footprint?
You can do all of this already in the current version.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Hey cool, didn't know that.

I will leave the rest of all those suggestions, you may or may not dig some out again some day for some future version, but I will keep bumping the backstep and the falling-missiles issue, ok?
Parting is all we know from Heaven, and all we need of hell.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Liek the idea of monster senses, didn't tealise RTC didn't have this, hadn't noitced yet - smell, sight , sound...dunno about 'tremor' sense being seperate from sound, maybe just a general party awareness

For the monsters following items, you could do this with dungeon mechanics assuming there wee a small tweak in the engine. You have the cloned monster who can be duped have the attack that has a convert_local on for, say, rocks or whatever, that converts those items to rocks, no change, but also if that conversion happens then implements a teleport monster...so the creature will move to find the source it looks like. You can't limit the teleport to one square yet, that I have found (1st change) and the teleport action would be from the monster tile, you couldn't have it direction to the rock tile . So the monster would randomly act, it would appear, either jumping for a closer look onto the tile, or rushing in a random direction. Better if it went onto the tile of the item. The teleport limited to one would fail if the party were actually standing on the tile with the item, of course

back to senses - i liek the idea of monster vulnerability, especially the light sensitivity. You could also have two types of action that would affect smell (attract/repulse) and two types of hearing (attract/damage) Maybe invisibility doesn't affect those with 'smell' and 'hearing'...unles you could also assign vaiants that block those senses too.. (no sound,. no smell)

The sidestep as in DM i keep asking about, as this was very pelasing to the eye to see monsters manouver liek this, and also didn't allow monsters to get caught as long

Improved AI - good if it is percentage changece and assignable - but RTC games became a little unplayable in the way yo described when you would not be able to move into a creature at the start of the game without taking damage, so you would basically spend ages lettign them fall back, fall back...makes for less interestign game as of course it limits tactics not oncreases them
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Yes, but to fine-tune improved AI inbto a balanced and playable state it'd be necessary to implement it in the first place. I'd be happy to test improved AI and help making it playable.
Parting is all we know from Heaven, and all we need of hell.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

From the creature description of the encyclopaedia:

Sight range: Number of tiles between creature and party needed to see the player. This value is modified by the light value.

Awareness: Number of tiles between creature and party needed to "turn" towards the player, perhaps to shoot a projectile.

Spell range: Number of tiles between creature and party needed to execute an attack (casting spells and/or melee).


Does RTC use these same values?

Esp. if the remark about the light modifier is true: From this point if view it can make sense at times to turn off the light with a drakness spell and walk about with just the minimum light level radiated by the Illumulett.
Parting is all we know from Heaven, and all we need of hell.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Addition to the last post above: According to the encyclopaedia Mummies, skeletons, ghosts, couatls, water elementals, black flames dragons and Lord Chaos/Grey/Librasulus even have the special ability "Can see in Darkness", while ghosts, black flames and Lord Chaos/Grey/Librasulus can see invisible.

Does RTC do the same? If not, it should.
Parting is all we know from Heaven, and all we need of hell.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Does RTC do the same? If not, it should.
Please bear in mind that RTC is RTC and DM is DM. Although they're remarkably similar, they are different. In particular, I started writing RTC well before any of these details about how the internals of DM were known and so uses a completely different set of stats to determine monster behaviour. Specifically, you can't just map the values used by DM onto RTC because they use completely different algorithms to achieve the same effects.

In particular, my aim for RTC was for it to *play* like DM did, not be identical (if you want something identical, then get an emulator out and play DM!). So, if the only way you can spot a difference between the two is to carefully examine the internals of DM (or reference someone who has) and then compare them with the values editable in the RTC editor then it's not really a good reason to do it.

Having said that, if something makes a clear measurable difference to gameplay, then its probably worth doing. However I don't think any of these monster stats do (specifically, I'm not aware of anyone whatsoever that play the game differently because of these stats even with knowledge of the existence of these stats and certainly not without).

So, in summary, those stats sound like alot of work for no material benefit. Of course, that's not to say that some other similar change (possibly making the effects stronger so its more noticable) isn't worth doing and therefore something I'll consider...
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

George: Well, having just read your post about suggestion criteria, of course it is very clear that you will only implement features that your time allows you to implement. Of course as a programmer it is entirely up to you how you develop RTC. I know that some of these suggestions are complex. But maybe one or another will be judged doable by you.

All I really want to ask for is that you don't entirely ditch AI developement because some players some time long ago didn't want to take a further step of evolving DM. Currently many archmaster monster have been killed by me with mere boring patience, without having had a possibility to fight back, because the AI didn't let them - they just use their ranged attacks not at range; not over an empty tile, not over a pit, not through a portcullis, and not through a monster teleporter. And without their occassional random extra attack known from FTL-DM they can't even defend when around stairs (which is actually a good thing currently, because otherwise archmaster DM wouldn have been unsovable due to the multiple instant death attacks).
Implement whatever you deem doable, but please never entirely stop improving the AI.
Parting is all we know from Heaven, and all we need of hell.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Lunever wrote:George: Well, having just read your post about suggestion criteria, of course it is very clear that you will only implement features that your time allows you to implement.
I don't think that's a contravertial statement, more of the blindingly obvious (i.e. I won't do something I don't have time for!).

To be perfectly clear though, just because something takes a long time, doesn't mean it won't get done; to take a recent example, opening up all the "convert-to" and "actions" took the best part of a year for me to sort out, but I did them as they give a huge amount of flexibility to the engine to allow all sorts of things to happen. Another example is the MP3 / PNG support which took about a month to get working properly, but again it gives a huge benefit.

On the flip side, something like giving lots of different senses to monsters is also alot of work but results in no material benefit to players or dungeon designers. 99.9% of all DM players hunt down monsters and kill everything in the dungeon straight away - DM isn't a "stealth" game where you try and sneak past monsters.

I would go even so far as to say that if I gave all the monsters a perfect pre-cognitive ability to detect the party at infinite range on their level, no-body would notice when playing DM (I can be quite confident of this because this is what several early versions of RTC had - about 3 years worth - and no-one spotted it).

So, all I'm saying is that those particular suggestions for AI improvements aren't worth it. Of course other improvements probably are, so feel free to keep suggesting...
Lunever wrote:All I really want to ask for is that you don't entirely ditch AI developement because some players some time long ago didn't want to take a further step of evolving DM. Currently many archmaster monster have been killed by me with mere boring patience, without having had a possibility to fight back, because the AI didn't let them - they just use their ranged attacks not at range; not over an empty tile, not over a pit, not through a portcullis, and not through a monster teleporter. And without their occassional random extra attack known from FTL-DM they can't even defend when around stairs (which is actually a good thing currently, because otherwise archmaster DM wouldn have been unsovable due to the multiple instant death attacks).
Implement whatever you deem doable, but please never entirely stop improving the AI.
I agree with you here, but there's a whole world of difference between giving monsters extra senses and AI (i.e. the intelligence to use them). In fact the suggestions you give are all concerned with close quarters combat (so the monster has already detected the party and ready to attack), and this is indeed something that needs looking at, because the monsters are a bit dumb here. Things like the back-step from doors are great ideas here - keep them coming...
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

I noticed that a monster with a ranged attack is unable to attack a single character on the "wrong" lane. If you have for example a single character on the right back position, and a single swamp slime in front of you on the left side, it will stand there and shoot hundreds of poison bolts past your character.
The AI should recognize this an let the monster do a half-sidestep.
Parting is all we know from Heaven, and all we need of hell.
Tonari
Craftsman
Posts: 146
Joined: Sun Jul 23, 2006 1:32 pm
Location: Japan

Post by Tonari »

The idea of Lunever is interesting.
To take aim when the party is single, the monster of DMJava moves.
I think that the monster should take aim also in RTC.
Please forgive poor English.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Also, I just made a battle in the CSB demon chamber whilst being invisible. The invisibility handling has been much improved, yet while it now does seem to work quite well on a first glance, I noticed 2 oddities:

-Lord Chaos seemed to be affected by invisibility, at least he pretty ignored me when 2 tiles away. If I remember correctly he should be immune to invisibility.

-Monsters in general seem to be able now to notice the party not only when attacked, but also when the party is simply at a range of 1 tile. I think they should do the latter also only if attacked from that tile. And if shot at from an invisible party they should shoot back at where the shot came from rather than just proceeding toward there.
Parting is all we know from Heaven, and all we need of hell.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Lunever wrote:-Lord Chaos seemed to be affected by invisibility, at least he pretty ignored me when 2 tiles away. If I remember correctly he should be immune to invisibility.
Fixed for V0.45
Lunever wrote:-Monsters in general seem to be able now to notice the party not only when attacked, but also when the party is simply at a range of 1 tile. I think they should do the latter also only if attacked from that tile. And if shot at from an invisible party they should shoot back at where the shot came from rather than just proceeding toward there.
Yes, this is the same for the party as it is for monsters (i.e. you can see invisible monsters at a range of 1 tile).
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

I think it'd be better to handle this completely differently, like improved invisibility in DnD. They party (or monster) should be completely invisible and be ignored by its oppenents except for the following:
- If the party performs an action like casting a spell, using a weapon or throwing an item it should become visible for a short moment and then become invisible again. Monsters should then proceed toward the alst party position known to them .
- If monsters try to enter a tile occupied by an invisible party they should see the party, until it moves away.
Parting is all we know from Heaven, and all we need of hell.
User avatar
Kain
Apprentice
Posts: 50
Joined: Wed Mar 14, 2007 4:42 am

Post by Kain »

Lunever wrote:I noticed that a monster with a ranged attack is unable to attack a single character on the "wrong" lane. If you have for example a single character on the right back position, and a single swamp slime in front of you on the left side, it will stand there and shoot hundreds of poison bolts past your character.
The AI should recognize this an let the monster do a half-sidestep.
Seconded. I just noticed this today as I used the strategy to take care of swamp slimes which would otherwise kill me with one bolt. I even took a nap to regen mana while the slimer kept blasting past me.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

if this is fixed it is important to make a a half-sidestep though and not a turn-halfstep-turn, or such a single character can still delude the monster by constantly shifting position (by mouse) while attacking with spells (by keyboard).
Parting is all we know from Heaven, and all we need of hell.
Post Reply