Page 1 of 2

Mob AI behavior

Posted: 07 Aug 2013, 16:47
by AnonDuck
I've always found the mob AI in TMW to be pretty dumb.

One of my little side projects involves tweaking the mob AI in the server. I've made a bit of progress in the 'aibehavior' branch, and hope to make a bit more when I have time. Eventually this will be merged with the testing branch, documented in wiki, and go live at some point in the future.

So far I've added a system where mob spawn definitions can include an optional AI behavior flag. There is currently only one flag: guard.

Guard causes mobs to stay within their spawn area. It is possible to lead them astray if a player aggros them, but they will always walk back to their spawn area in the end. This flag will be useful in maps such as the Hurnscald north mines and the graveyard to keep players from putting mobs "in jail" and reducing the difficulty of the maps below what the designers intended.

I have a few ideas for other behaviors, such as 'sticky'. Sticky would make a mob stay aggro at the first player to hit it. Wisps etc do this but it is a side-effect of their flocking behavior. Another flag I'm thinking of is 'random' which causes a mob to aggro at a random player out of those who are attacking it instead of the last one to hit. Flags will be combinable for interesting effects.


Comments/suggestions welcome!

Re: Mob AI behavior

Posted: 07 Aug 2013, 17:07
by o11c
I can imagine a flag to make the monster go after the weakest player (probably the healer).

Re: Mob AI behavior

Posted: 07 Aug 2013, 17:15
by melkior
o11c wrote:I can imagine a flag to make the monster go after the weakest player (probably the healer).
Or the one with the highest amount of HP/mana.

I'd like to see monsters that react to certain items - either being provoked from an otherwise non-aggressive state, or ignoring players with the item, but attacking everyone else.

I don't know if that's technically possible, but I think it would be interesting when writing new quests.

Re: Mob AI behavior

Posted: 07 Aug 2013, 17:26
by WildX
MadCamel wrote: Guard causes mobs to stay within their spawn area. It is possible to lead them astray if a player aggros them, but they will always walk back to their spawn area in the end. This flag will be useful in maps such as the Hurnscald north mines and the graveyard to keep players from putting mobs "in jail" and reducing the difficulty of the maps below what the designers intended.
Sometimes moving mobs around is just good strategy, especially in places like the graveyard. I'm afraid this would make the gameplay even more "target, hit and wait for the mob to die" than it already is.

Re: Mob AI behavior

Posted: 07 Aug 2013, 17:44
by AnonDuck
.:WildX:. wrote: Sometimes moving mobs around is just good strategy, especially in places like the graveyard. I'm afraid this would make the gameplay even more "target, hit and wait for the mob to die" than it already is.
You can move them around as much as you want. They just walk back home when they have nothing else to do. In testing it actually makes the gameplay seem more active!

Re: Mob AI behavior

Posted: 07 Aug 2013, 18:14
by Wombat
MadCamel wrote:
.:WildX:. wrote: Sometimes moving mobs around is just good strategy, especially in places like the graveyard. I'm afraid this would make the gameplay even more "target, hit and wait for the mob to die" than it already is.
You can move them around as much as you want. They just walk back home when they have nothing else to do. In testing it actually makes the gameplay seem more active!
I like the idea that a monster "gives up" and stops following, so we can actually run away from a monster that is too powerful rather than fighting it until it or the character dies in order to stay in the general area.

So like, while we could drag the jacko away in the graveyard now...in the fix I think it would mean we can make attempts to take over the area and if we fail we can run away without having to run all the way to the beginning.

So we can't cheat an area, but we can save ourselves from powerful monsters leaving their space too far and from people creating griefing swarms and dumping them on unsuspecting characters. Am I right about that?

Re: Mob AI behavior

Posted: 07 Aug 2013, 18:35
by AnonDuck
That is essentially correct. With guard the mob doesn't "give up" per-se, but if you leave it's aggro range it will start walking back to it's spawn point instead of hanging out where you left it.

Again this behavior and all future AI behaviors are entirely up to the mapper on a per-mob basis.

Re: Mob AI behavior

Posted: 07 Aug 2013, 18:36
by wushin
I can round up all most if not all of the terranite cave and park it in front of entrance. Same for Hurnscald mine. So I'm all for this improvement to unstick door mobs and other such stupid like kiting mobs like spiders away.

Re: Mob AI behavior

Posted: 07 Aug 2013, 18:54
by Frost
This sounds like an awesome feature that will add a lot of depth to gameplay!
Is there a server we can try this on?

Also, what about a "wandering monster" flag? This could either be something random, or set some map points that it walks to, in a sort of patrol.

Re: Mob AI behavior

Posted: 08 Aug 2013, 06:07
by Cassy
It's definitely an awesome feature and it was real fun to test :D

Please everyone take care of which mobs you decide to make wander back to their spawn area.
It might sound great to do so with the skulls in the gy but for gameplay this is really annoying.
The graveyard is a place where people level from lvl~50 (some earlier, some later) to lvl99, so they spend most of the time here (and with Yetis).
Archers would be annoyed as hell with all the skulls around because they hardly hit them even with DEX99.
Sure you can say now that they should just get help, but it's not like there's always help around.
Mid- (and also some high-)level warriors often can't be bothered to fight many often them as well.

Please keep in mind that luring mobs away is not just to make the map easier, but also, and I tend to say *mainly*, to make the gameplay more attractive.
Choose wise which mobs should return to their spawn area.

A few examples based on my personal opinion:
-> Skulls in graveyard returning to their home: no
-> Jack O in graveyard returning to its home: yes
-> Spiders in Terranite Cave: no
-> Terranites themselves: yes
-> Clovers Patches: yes

I was also thinking about the skulls in the Northern Mines.
I was thinking that two skulls there shouldn't hurt but it is so damn annoying when you need Iron Ore as beginner and the skulls enjoy hanging around with the Yellow Slimes (yeah I know there are also other places for hunting Yellow Slimes - but beginners don't).
On the other hand when you just leave them they should return to their tiny spawn area north of the slimes.

@MadCamel:
I guess the mobs with one single tile as spawn would be stuck in there then? Just asking cause it looked so weird :D
(Thinking about the two skulls in the Northern Mines, you could watch them being stuck in their spawn area from the place above where they won't hunt you)


Sorry for the long post ^.^
This is an awesome feature but I just needed to say all of this.

Re: Mob AI behavior

Posted: 08 Aug 2013, 08:38
by ChefChelios
MadCamel wrote:This flag will be useful in maps such as the Hurnscald north mines and the graveyard to keep players from putting mobs "in jail" and reducing the difficulty of the maps below what the designers intended.
we dont do it this reduce the difficulty of a map... we do it because these Monsters are just annoying!
why dont ya just reduce the ammount of skulls or change their stats a bit?

pulling mobs to other players or to the entrance of the map is more or less the last kind of fun that i have ingame...
many Players do accept a behavior like this from me as challenge and do fight the Monsters and enjoy it... and some dont xD

a bit off topic and to all devs:
its also annoying to get kicked from the Server just because of doing a dropparty!!! this is spam? seriously, are you kidding me!?
(and yes i know there is a feature at 4144s client to protect me from this Chocolate Cupcake but i want to drop fast and not slow like a snail!)
same with picking up items... i kill a squirrel and it drops several items and i get kicked just because i try to pick up the loot as fast as i can... grrrrrrrrr

sometimes i think it is the job of the devs to make this game more and more annoying!

Re: Mob AI behavior

Posted: 08 Aug 2013, 14:10
by pclouds
o11c wrote:I can imagine a flag to make the monster go after the weakest player (probably the healer).
It does not make sense for a monster to know which player is weak. Going after some items on the outfit (and even color) or weapons seems better, or the amount of carried items.

Re: Mob AI behavior

Posted: 08 Aug 2013, 17:23
by Reid
pclouds wrote:It does not make sense for a monster to know which player is weak.
Wrong, it makes sense, imagine that you're a mouboo, who would you attack first between a strong worrior with a warrior helmet full of blood and a jean pants and a noob freshly arrived from Tulimshar with a noob hat?

Re: Mob AI behavior

Posted: 08 Aug 2013, 17:28
by Jaxad0127
A flag that causes mobs to not aggro characters that are below a certain level would be nice. They'd still attack if the character starts it, but won't start the attack on their own.

Re: Mob AI behavior

Posted: 09 Aug 2013, 05:45
by AnonDuck
These are all great ideas. I'll see what I can do without making a mess of things!