PDA

View Full Version : Monster AI



Tannis
03-13-2008, 09:07 PM
The monsters in JADE look like they'll be more fleshed out compared to ADOM, in that they will have inventories, goals, wield items, etc. I feel that there should be a corresponding increase in Monster AI.

The first issue is formations. Let's say you're in a cavernous level and come across 6 orcs. In most rpg video games that are turn based, the orcs will come out you from the same direction. Since they have te same speed, the closest one to you will reach you first, and you will slaughter then one by one. This is quite unrealistic: mobs, especially composed of cowardly creatures, would charge at you in a line, perpendicular to their motion of direction, so that the wall of monsters would wrap around you when they reached you so they could fight simultaneously. I hope that made sense.

The next issue in corridors. In every single fight in Adom where possible, I fall back into corridors to slaughter monsters one at a time. Now, I understand this working on rats or zombies. But on sentient creatures like orcs or what not, one would expect them to fall back, since a corridor negates their mob advantage.

The next issue is spell casters. Most spell casting monsters in ADOM just randomly blast spells at you. I think mages should be more sophisticated. Say a chaos wizard blasts fire at you, and your ring of fire resistance wards it off. Presumably the wizard would realize this, and try another spell. Basically, spellcasters should cycle spells randomly, and settle on the one the PC is most vulnerable to.

Any one have other AI thoughts?

puuro
03-13-2008, 10:43 PM
I like your thoughts. If i was a monster in ADOM i would try to surround my victim with my monster friends. But because of small size e.g. hurthling may look so easy to kill that you can do it alone. Maybe not if he has good shining equipment. But after that hurthling kills a couple of orcs they should change their tactics. It would be interesting if monsters judged you by what you look like. A troll wearing strong armour would cause much lower-level monsters to panic as they see you. A weak-looking player coming naked and all monsters come running to you competing who hits you first. Or play with you, trying to kill you with bare hands :).

Sven T Sexgore
03-16-2008, 12:19 AM
It would be interesting to have a behind the scenes 'threat rating' for the PC. How dangerous he appears to intelligent monsters. Things like character's size, str, equipment, etc would be factors in it though not necessarily in terms of their actual stats. A character with a huge sword that does 1d4 would still look more impressive than a character with a small 2d4 dagger. The rating could then influence tactics (single, mob, flee) for intelligent monsters. It would probably take far too much work to bother with but it would definitely be an interesting addition.

Dougy
03-16-2008, 01:06 AM
It does sound quite fun to have this, but I'm not sure if this is easy to program. Some thoughts:

Archer-type monsters should really stay back and keep shooting.
Monsters with knowledge of nearby traps could try to lure you onto one.
A little monster could try to get you to chase it, into an ambush.

ZeroTheBird
03-17-2008, 11:26 AM
If there is a mob is there a leader? if a group of wizards/fighters are attacking you there should be a leader. He is identical but he get a Prefix and a bonus to hit/dmg or something.

Grey
03-17-2008, 11:46 AM
Balanced groups with leaders/healers etc would be interesting. The healer would sit at the back keeping his guys at full health, the leader would be barking orders from the back (and the others would protect him more, though he'd actually be a tougher fight than the rest) with spellcasters sending negative status effects your way to add to the mix. There'd be a few tactics to dealing with them - killing the leader for instance would reduce their morale and co-ordination, making them dumber, less aggressive, and more likely to flee.

Eidre
03-18-2008, 01:40 AM
Balanced groups with leaders/healers etc would be interesting. The healer would sit at the back keeping his guys at full health, the leader would be barking orders from the back (and the others would protect him more, though he'd actually be a tougher fight than the rest) with spellcasters sending negative status effects your way to add to the mix. There'd be a few tactics to dealing with them - killing the leader for instance would reduce their morale and co-ordination, making them dumber, less aggressive, and more likely to flee.

Implementation thought (since TB is using a game timeline to organize actions)...have AI decisions take game time instead of being instantaneous (tied to a "thinking" game action or something which takes a certain amount of ticks depending on the intelligence of the monster and the complexity of the situation they're in). When new events or situations (new monster appears, taking damage, "fear" spell, etc) triggers an AI evaluation, they are temporarily 'confused' while they consider what to do (only for a very short time, it shouldn't dominate the game).

This would give a big advantage to groups with a leader, since they just get told what to do, so (assuming they're loyal) they don't have to spend any time deciding, saving them critical time in combat. By corollary, this will provide a justification for the leader to have better willpower (to overcome fear), intelligence (to decide quicker), and perception (to pick up on details to make good decisions for the group). They will also be able to order subordinates to do individually suicidal things for the good of the group (or leader), things which would make lone, leaderless creatures break morale and flee.

Another nice effect of this (in the beautiful pseudo-code in my brain, at least) is that the desired outcomes (leaderless groups are less effective, and groups with strong leaders are more effective, lone monsters are more cowardly and indecisive) are natural products of an over-arching system rather than needing specific 'buffs' granted by the leader...heck, making decisions take time might even work for players (impose short confusion periods tied to perception events, with time inversely proportional to intelligence and willpower, same as for monsters). This will give a reason for fighters to train up mental stats, especially those with high perception (who have lots of perception events)...heck, it even gives a decent 'debuff' for detection and telepathy effects, since the sudden influx of sensory information will overwhelm the reciver unless they are quick-thinking and strong-minded.

As an aside, why is the default for Leader creatures to make them stronger and tougher? This might make them able to beat their way up the corporate ladder, but it would have little bearing on their ability to actually *lead*. In real life, who is the better combat soldier: the lance corporal who spends his time practicing with shooting accurately and carrying heavy weights, or the captain who is spending his time with logistics, discipline, schedules, and other leadership functions? For that matter, why (in an 1800s type army organization) does the officer have a sword and a pistol (with multiple short-ranged shots) when the soldiers have long-range, slow-reloading rifles with long bayonets? Maybe to give the single, out-of-shape officer and some means to 'motivate' his own troops?

End rant. This is all smoke anyway since I don't know if it even fits in the codebase TB has developed, or if it would be worth the time and effort to code.

Plausible
03-18-2008, 10:27 AM
Good ideas!

It would also speak for NPC AI if some would engage in 'diplomacy': ask about the player's intentions ("fight you", "just passing", "looking for X"), surrender, ask for a bribe, ask to team up with the player (honestly or while secretly remaining hostile), barter.

And something more on this:


Monsters with knowledge of nearby traps could try to lure you onto one.
A little monster could try to get you to chase it, into an ambush.

Yes, it would be cool if monsters displayed some understanding of the state of the dungeon. If there are non-random parts in a level (say, a passage with only a single door which the player has to use), monsters could be aware of this in that "defend the passage" could be in their goal stack. The passage could come with a few monsters with a very high weight on the "defend the passage" goal, resulting in a guard squad.

Random and dynamic elements in the dungeon (e.g. traps sprung or not, ambushes...) sound harder to write AI for than fixed architectural features. Would be great though.

Ars
03-18-2008, 03:50 PM
What about this: If the enemy group has a leader, they govern their actions as a group, trying to attack the player in a line etc. - but if the leader is killed, they get a dumber AI, with worse morale and they don't care how the rest of the group is positioned.

And I think that in a fantasy game the leaders should definitely be the badasses, who are toughest to kill. This isn't about modern armies. If, say, Elrond and a common elf were compared, it's pretty clear which is the better warrior.

Qui
03-18-2008, 09:07 PM
Advanced AI would be nice, but there can be some problems with it and ways to exploit it.

Example:
PC enters a room. Monsters rush to attack. PC gets badly wounded and retreats into a corridor... What now? Should the monsters follow?
If they don't, the PC has a chance to rest, heal, and come back... so if there is a really tough group, the PC can go in, kill one monster, retreat, heal, come back...
On the other hand, if they follow, and the PC is well equipped and/or skilled in magic, the PC can lure them into a corridor, heal, and zap with some wand or spell when they're all lined up nicely.

There are many such scenarios to consider. I'd really like to see AI that would be hard to outsmart, but on the other hand I'd like to see JADE finished in this century ;) so maybe the idea is to don't waste much time on goblin mobs and such which in most cases will die quickly anyway and focus on AI for tougher monsters. For example, in ADoM balors on D:50 would greatly benefit from a little bit more brains ;).

There also is one problem to solve similar to fighting enemies one at a time in corridor: using stairs. When chased by a large group and no corridors in sight (or fighting against earth elementals or such), the PC can escape to the stair, wait for the first couple to reach him, go up/down the stairs with them, kill them, heal, go back, and take next few with him again... totally unrealistic, I hope it will be addressed. Obvious solution would be to allow monsters to use stairs.

Tian
03-18-2008, 10:02 PM
I think that only powerful monster should have a better AI, because minor monsters, like goblins or kobold, are just plain stupids... the only change they should have on their AI, is the fact that they become afraid of the PC once he?s powerful enough...