Enemy Behavior

Oct 18, 9:44 pm
#1
Ischaldirh's avatar
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Scientist
Location: Not California
Interests: (Astro)Physics, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,852
I just started a game of IVAN after a long break. During that break, I spent some time playing Crawl. So, when I encountered a bat, I was surprised when it just stood there and let me punch (at) it until (I finally managed to hit it and) it died. Which got me to thinking: Bats are not the only enemies that are typically faster than the PC. Would it be possible to code enemy AI that took advantage of this, in ways besides simply attacking repeatedly? For example, Crawl bats move ~3x as fast as the PC, in most cases, and they will attack once and then flit out of reach. When the player moves, they will step in, make an attack, and then retreat again. This makes them very annoying (if generally nonthreatening) opponents. Simply moving towards them does not work. Could IVAN bats behave similarly?

Taking it a step further, there are a lot of highly-mobile humanoid enemies, such as mistresses and angels. These enemies are dangerous already; if they employed that hit-and-run strategy the game would become much more tactically challenging. If there were enemies who threw weapons, AND were fast enough to stay out of reach... well, that would be downright devillish >: )
Oct 19, 4:14 am
#2
Joined: Apr 2, 2014
Location: North Tyris
Posts: 611
Ischaldirh wrote
Could IVAN bats behave similarly?

I actually just recently tried to replicate this behaviour in my dev branch. We'll see if it turns out OK.

But in general, I'd be for some improvements to enemy AI and them being more smart in combat. Of course, we need to make sure they're not so smart it becomes too hard for the player.

Some other improvements off the top of my head:
* When there's space, mobs should try to encircle the player and not stand in a line and wait for their turn to be murdered.
* Some A* pathfinding would be great.
* Once we have throwing mobs or ranged weapons, shoot-and-run mob would be nice, as you mentioned.
* Mobs picking up and using wands. Some already can use wands, but they won't pick them up, AFAIK. This needs to be carefully balanced, because wands are deadly and we don't want kobolds in UT1 blowing the player to smithereens.
* Mobs picking up potions and waiting to sip them when they're hurt. Now they just drink them when they find them.
Oct 22, 2:17 pm
#3
Joined: Dec 17, 2007
Occupation: Taking Names, Formerly Kicking Ass
Location: New Jersey
Posts: 896
I like the idea of tougher enemy AI. My only concern is that by adding in the new obstacle you have to add in a solution, which could lead us back toward equipment uniformity in the end game. Kind of like reflection in Nethack. If all late game monsters can zap you with wands , you would need some kind of ultra resistance item or it would be impossible. and then you would spend the whole game looking for the resistance item or you couldn't proceed.

I do like the idea of early game characters getting zapped to death with no hope of survival, that seems very in theme with the game. I just don't want to end game to be a drag because of it.
Oct 22, 2:22 pm
#4
Joined: Dec 17, 2007
Occupation: Taking Names, Formerly Kicking Ass
Location: New Jersey
Posts: 896
or make wands only spawn in chests/shops so that the only way monsters can get their hands on them is on a bones level or if you foolishly drop one to save on weight. That way the potential for tragedy is there, it just doesn't happen that often.

or give all but the most intelligent monsters a large percentage chance of accidentally zapping them selves. hilarious for offensive wands, scary for mirroring/cloning wands
Oct 22, 8:50 pm
#5
Ischaldirh's avatar
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Scientist
Location: Not California
Interests: (Astro)Physics, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,852
Batman? wrote
or give all but the most intelligent monsters

We could tie use of wands to intelligence in general. A sort of "you must be this smart to ride" mechanic - they won't even bother picking them up unless they have >10 INT, and their probability of actually zapping it when appropriate scales with INT. Perhaps stupid humanoids will even occasionally pick up a wand to use as a weapon. Which could be... scary. Dumb monsters might also use the wand unintelligently - zapping a wand of lightning on someone in a situation where it's going to come back and blast them, using wand of fireballs in melee combat, things like that.

You do have a good point, however about this sort of mechanic causing issues in the late game. Maybe we take it in baby steps, hm? Start with having monsters pick up potions but not use them immediately, and have them dipping their weapons in poison and throwing acid at players. That could ramp up the difficulty, but acid potions are pretty rare, and poisoned weapons are ... well, I have no idea how dangerous that would be, because we don't encounter it yet. But if it works how I expect, a poisoned weapon would be far more dangerous to an early-game, naked chump than a late-game plate-clad warrior. Gotta get through all that steel to deliver the poison...
Oct 22, 10:16 pm
#6
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,830
We could take things a step further by having self-learning AI. If a bear survives drinking poison, it'll avoid future bottles of poison. If a goblin waving a wand around survives it breaking in its hand, it tries zapping the next one it comes across.
Oct 23, 12:00 pm
#7
Joined: Apr 2, 2014
Location: North Tyris
Posts: 611
chaostrom wrote
We could take things a step further by having self-learning AI. If a bear survives drinking poison, it'll avoid future bottles of poison. If a goblin waving a wand around survives it breaking in its hand, it tries zapping the next one it comes across.

Machine intelligence for IVAN.

I agree that should we allow more mobs to use wands, we need to be very careful with balance. Tying wand use to Int sounds good. Maybe the higher a monster's Int, the more often can their AI use a wand?
Oct 23, 7:23 pm
#8
Ischaldirh's avatar
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Scientist
Location: Not California
Interests: (Astro)Physics, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,852
red_kangaroo wrote
Maybe the higher a monster's Int, the more often can their AI use a wand?

On reflection this doesn't really get around the lategame monsters issue, as later in the game monsters have more INT ... so they will use wands more often. Which is what we were hoping to balance around.
Oct 24, 11:17 am
#9
capristo's avatar
The Imperialist


Joined: Dec 2, 2007
Location: New Attnam
Interests: bananas
Posts: 2,160
Re: poisoned weapons, we have snakes and spiders already so I imagine a poisoned weapon would do about the same damage. Can be dangerous early on but definitely survivable. So I don't think that will be a problem.

Wands though... that is an interesting problem. Could we maybe do something with the danger level or panic status? Maybe only a panicked monster or a much weaker monster will use a wand out of desperation.

Just thinking about my own experience using wands - if I think I'm tough enough to melee a monster, I wouldn't want to "waste" a wand charge on them. That and I often forget that I can even use wands until I'm close to death and remember to check my inventory.

For some reason I love the image of beating up a kobold and he panicks and starts sprinting away. I'm chasing him, he rounds a corner and sees a wand on the floor and grabs it. I'm caught up in the moment and come careening around the corner only to get blasted with a giant fireball. Or I'm just about to descend upon him and finish him off when he teleports either himself or me away.

One major annoyance would be wands of cloning/mirroring being used up before you can even find them. If we do start letting monsters use wands then perhaps we should make scrolls of recharge more common.
Nov 1, 9:39 pm
#10
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,129
capristo wrote
Re: poisoned weapons, we have snakes and spiders already

It'd be cool to wield a snake.
Nov 1, 10:58 pm
#11
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,830
You can already wield a corpse of a snake, yes? Its blood is already poisonous, yes? How hard would it be to make it poison enemies when you smack them with it?
Nov 2, 12:05 pm
#12
Joined: Dec 17, 2007
Occupation: Taking Names, Formerly Kicking Ass
Location: New Jersey
Posts: 896
fejoa wrote
It'd be cool to wield a snake.

how about a rare magical instrument that lets you charm snakes to stiffen up so you can throw them like a spear.
Jump to