Monster AI

May 19, 2016, 3:51 am
#1
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,111
Serin-Delaunay wrote
That's the kind of thing safety maps are designed for (see here and here). Rather than pathfinding away from the player (as in those examples), it would pathfind away from a combination of hostile creatures and environmental dangers. Once the NPC is in a tile it judges to be safe, and isn't panicked, its normal AI can take over again.
The same code could also make magpies much more difficult to track down. If that's not how they already work.

I enjoyed reading the links. Yep, monster AI is fairly rudimentary in IVAN as it stands. Petrus standing around in a gas cloud is a recurring example that spurred the suggestion quoted above. Improving the AI is an area we can potentially get more gameplay bang for our coding buck. The code additions are often minimal, and are suitably self-contained.

Does anyone have more observations about AI behaviour that could potentially be improved upon, or AI that can be added to make improvements?

EDIT: AI improvements listed here:
* Banana growers getting stuck outside the shop
* Pets avoiding standing next to the player, get them to stand next to the player, or improve this for sci-talk purposes
* Monsters avoiding environmental dangers
* When an NPC is in StandIdleAI(), get them to move in response to hazards like gas clouds and return when the home square is safe
* Monsters using equipment, wands, throwables and rooting around in chests
* Social creatures, pack animals, simple group behaviour
* Ambushes
May 19, 2016, 7:18 am
#2
Joined: Apr 9, 2016
Occupation: Priestx of Sophos
Location: Standing on a big mine in GC1
Interests: the relation of queer crystal hyperfeminism and amphibious neutronium cybersocialist art
Posts: 258
In 0.50.5, the banana growers can still get stuck outside the shop window, which makes it easy to scitalk them.
Pets which are following the player won't try to stay next to the player, which makes scitalk more difficult the faster the pet is.
Pets which aren't following the player normally wander randomly, but past a certain number they form a clump which is difficult to break up (and fills the message buffer very quickly).
Monsters don't seem concerned by hazardous liquids on the floor. I haven't tested this, so it's possible that wise creatures avoid them, or that following the player ranks above pathing around environmental dangers.
Monsters use equipment, food, and drink from the floor, but not wands, scrolls, traps, throwables, chests, etc. That might be difficult to balance.
It's not clear what enemies can kick down locked doors, or what prompts them to do it.
May 19, 2016, 10:53 am
#3
Joined: Sep 22, 2008
Posts: 631
Social creatures would be a neat addition, instead of having every NPC act as an individual only. Even simple group behaviour similar to player pets for things like orc patrols or wolf packs could go a long way.
May 19, 2016, 11:15 am
#4
Joined: Apr 9, 2016
Occupation: Priestx of Sophos
Location: Standing on a big mine in GC1
Interests: the relation of queer crystal hyperfeminism and amphibious neutronium cybersocialist art
Posts: 258
Angband has (and variants inherit) a really evil social behaviour that hides in the corners of a room, and ambushes the player when they enter. That way they avoid being fought one at a time in chokepoints. When the player is low on health they become more aggressive.
It's not without problems - because of a combination of asymmetry in the line of sight code, telepathy, differences between LOS for vision and ranged attacks, and the fact that not all of the pack fits in the corners, the player can snipe a lot of the pack without retaliation before facing the "ambush".
With IVAN's more restrictive approach to ranged combat, that would be less of a problem.
May 19, 2016, 1:17 pm
#5
red_kangaroo's avatar
elder dark mage


Joined: Apr 2, 2014
Location: North Tyris
Posts: 575
Wolf packs would be very interesting addition, indeed. I was also thinking about Angband, reading this.

I really really like the way monsters use wands against you in CLIVAN. Especially the goblin warlocks, with their wands of door creation, acid rain and teleportation are deliciously aggravating.
May 20, 2016, 12:24 am
#6
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,825
There's already a wolf pack in IVAN. They're led by a werewolf and spawn in a special room.
May 20, 2016, 3:53 am
#7
Joined: Apr 9, 2016
Occupation: Priestx of Sophos
Location: Standing on a big mine in GC1
Interests: the relation of queer crystal hyperfeminism and amphibious neutronium cybersocialist art
Posts: 258
They don't behave as a pack, though.
May 20, 2016, 7:33 am
#8
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,825
Yes, I know. I was just pointing out that there's already an opportunity to implement better AI in-game.
May 20, 2016, 11:32 am
#9
capristo's avatar
The Imperialist


Joined: Dec 2, 2007
Location: New Attnam
Interests: bananas
Posts: 2,142
If we add wolf packs and such then I really want more "wilderness" exploring and fighting. That would be so awesome to be in the woods with a little campfire at night and suddenly surrounded by wolves
May 20, 2016, 6:35 pm
#10
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,111
JoKe wrote
Social creatures would be a neat addition, instead of having every NPC act as an individual only. Even simple group behaviour similar to player pets for things like orc patrols or wolf packs could go a long way.

This would be super cool, orc patrols could have pet dogs or wolves!


red_kangaroo wrote
I really really like the way monsters use wands against you in CLIVAN. Especially the goblin warlocks, with their wands of door creation, acid rain and teleportation are deliciously aggravating.

I remember coding this, it seemed to work okay. The main problems with what I wrote was that it was possibly inefficient, and that the warlocks would zap the wand or throw an item as often as they could, which was quite often too quick. Monsters that can zap or throw would need a "time since last zap" to make it fairer on the player. Plus the algorithm didn't check if there was a wall in the way, so the monster would just throw things at the wall while the player was behind it. That said, it could still be improved upon.
Jump to