Mob AI behavior

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Mob AI behavior

Post 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!
Last edited by AnonDuck on 07 Aug 2013, 17:08, edited 1 time in total.
Head of the TMW Illuminati
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: Mob AI behavior

Post by o11c »

I can imagine a flag to make the monster go after the weakest player (probably the healer).
Former programmer for the TMWA server.
melkior
Warrior
Warrior
Posts: 320
Joined: 28 Dec 2008, 15:57

Re: Mob AI behavior

Post 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.
User avatar
WildX
Source of Mana
Source of Mana
Posts: 2085
Joined: 07 Aug 2010, 14:13
Location: United Kingdom
Contact:

Re: Mob AI behavior

Post 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.

TMW Team member

User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Mob AI behavior

Post 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!
Head of the TMW Illuminati
User avatar
Wombat
TMW Adviser
TMW Adviser
Posts: 1532
Joined: 08 Aug 2008, 16:31

Re: Mob AI behavior

Post 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?
Current character is "Abolish".
User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Mob AI behavior

Post 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.
Head of the TMW Illuminati
User avatar
wushin
TMW Adviser
TMW Adviser
Posts: 1759
Joined: 18 Dec 2012, 05:56
Location: RiverBest, Brew City, Merica
Contact:

Re: Mob AI behavior

Post 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.
The secret to getting all the important stuff done is doing nothing.
Frost
TMW Adviser
TMW Adviser
Posts: 851
Joined: 09 Sep 2010, 06:20
Location: California, USA

Re: Mob AI behavior

Post 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.
You earn respect by how you live, not by what you demand.
-unknown
User avatar
Cassy
TMW Adviser
TMW Adviser
Posts: 791
Joined: 09 Mar 2013, 09:39
Location: ♥ Fluffyland ♥
Contact:

Re: Mob AI behavior

Post 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.
Main characters:
Lv.94 - Cassy - speedarcher on dark path, bunny-wannabe, would like to ride on a Mouboo once...
Lv.95 - Biqcassy - mage on light path, addicted to her Fluffy Hat, love-hates Fallens, really misses Confused Tree...
Lv.70 - Simca. - dreams of becoming a speedarcher on light path, still has a lot to learn...

Personal development overview | priorities | wiki to-do | wiki profile incl. other characters

[20:24:59] <Cassy> debug npc in crypts!
[20:25:02] <Cassy> just a joke...
[20:25:08] <wushin> DONT DO THAT
[20:25:10] <o11c> !slap Cassy
User avatar
ChefChelios
Novice
Novice
Posts: 210
Joined: 27 Jul 2010, 05:54
Location: ...schlaaaand!!

Re: Mob AI behavior

Post 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!
...und lachend stellte der Tod seine Sense beiseite und stieg auf den Mähdrescher, denn es war Krieg.
Image
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 10:37

Re: Mob AI behavior

Post 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.
You either live long enough to be a GM, or die a Troll Master
User avatar
Reid
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 1551
Joined: 15 May 2010, 21:39
Location: Artis
Contact:

Re: Mob AI behavior

Post 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?
"Time is an illusion. Lunchtime doubly so."
-- Ford Prefect
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Mob AI behavior

Post 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.
Image
User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Mob AI behavior

Post by AnonDuck »

These are all great ideas. I'll see what I can do without making a mess of things!
Head of the TMW Illuminati
Post Reply