Page 1 of 2

Monsters teams and behaviours and antimonsters superposition

Posted: 28 Jun 2008, 17:37
by Lecter
I saw that the game already implement some monsters behaviours, but I would liketo see more advanced behaviours like wolves attacking fluffies.
Monster teams could also make stuff like battles, imagine being stuck between 2 warring factions, that would be insteresting.

I also find a bit illogical that 12 monsters can stand on the same tile...

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 28 Jun 2008, 19:24
by Crush
The new server software already has monsters blocking each others paths and monsters can damage each other but they don't do so intentionally but only when another monster gets in the way.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 28 Jun 2008, 19:49
by Lecter
That doesnt complete this feature.

May I suggest creating an property to monsters
Behaviour, behaviour is an object that consist of a set of actions that a monster do depending on conditions and priorities. Like for an orc_shaman if there is an injured monster of one of the following types: orc_warrior, orc_archer, orc_shaman without being healed(when it heal the monser get status healing) his priority would be healing this one over attacking an enemy.

You could do diferent type of predators that would have different attack priorities.
Having a behaviour type is a way to emulate monster teams and groups.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 29 Jun 2008, 16:19
by Gonzalo
I have seen this on Lineage 2, and it adds some nice interaction to the game.
They took it one step ahead also, and some monsters would heal or otherwise help players also, if they're "allied" with them.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 29 Jun 2008, 16:25
by Crush
Lecter wrote:May I suggest creating an property to monsters
Behaviour, behaviour is an object that consist of a set of actions that a monster do depending on conditions and priorities. Like for an orc_shaman if there is an injured monster of one of the following types: orc_warrior, orc_archer, orc_shaman without being healed(when it heal the monser get status healing) his priority would be healing this one over attacking an enemy.

You could do diferent type of predators that would have different attack priorities.
Having a behaviour type is a way to emulate monster teams and groups.
http://wiki.themanaworld.org/index.php/Monster_Database

Just to make sure you know what you are talking about.

I think this could be implemented by adding a bunch of <friend>MonsterID</friend> and <enemy>MonsterID</enemy> tags. Any damage dealt to "friend" monsters near the monster is cosidered the same as damage dealt to the monster directly and thus causes aggro. Any "enemy" monsters are treated like player characters.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 29 Jun 2008, 17:50
by Rotonen
This is quite needed and the solution proposed here seems to be simple enough while still covering all we need from this.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 29 Jun 2008, 19:04
by Lecter
k, so we cant make a script cause it would take time loading, I though of a script based,

I though that instead of doing a list of aggressive = false, coward = false ,...
we could simply do basicBehaviour= aggressive1, or aggressive2, those being short list of characteristics,

then a short common script of behaviour can analyse this for all monsters
like
object behaviour aggressive1
if condition do condition
else if ...else if... (doing a list of conditions/actions with priorities) with around 5 behaviour objects you can do all monsters, and it wouldnt be long to load if its 5 for all, perhaps add some for bosses, its inspire of FFxii gambit system, but here u get like 5 pre made behaviours.

Monsters allied to each other could identify themselves through behaviour type making it quickly to standadize all monsters behaviours between them.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 29 Jun 2008, 22:34
by Crush
I would rather prefer the current solution of defining the behavior individually for each monster because it allows a much higher grade of variation.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 30 Jun 2008, 00:19
by Lecter
The current code I saw was about 4 lines... with 2 true/false boxes of aggressive/coward
You can make 4 behaviours for that, and the code to manage coward/aggressive and all that stuff must be elsewhere, meaning that you must a a global behaviour script full of if.

Anyway I'm just talking to put behaviours into separate premade scripts, instead of one big, this structure make monsters with behaviours not worth of having their own script, able to be more complexe, this feature can still be implemented while keeping the current system, but code will be harder to read thats all. You can always call a general script with variables like bo9olean coward and boolean aggressive, but I find it more easy to read if u make 2^n different behaviour scripts rather than one being called with a long list of n boolean variables, you would need to add all the bonus scripting in if in the big behaviour script anyway, making it even less readable, also putting monster behaviour property allow us to cathegorize monsters in hierarchy groups making it simplier to make predators hunt preys rather than making monster #12 attack monsters #1,2,3,4,5,6,7 in the code its more modular and easier to read.

Its equivalent to what u want, but its more modular and more readable. Those are the main diferences. Behaviours being premade scripts of monster actions, rather than a common huge scripts, it also have the advantage that you can make bosses's script behaviour already loaded, and not having to load it each time you create a monster, all monsters using static behaviour objects.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 30 Jun 2008, 00:28
by Crush
You are obviously not familiar at all with TMWServ in general and the monster AI code in particular. Thus your comments are not really valuable.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 30 Jun 2008, 01:25
by Lecter
Dont worry about it, "apprentice programmer", wont be long once I start reading its code.

I were just giving ideas for the code. Since from what I saw monsters only have behaviour characteristics, I then though the AI code would consist of a main function, am I right? All you need for diferent behaviour objects it to have different behaviour functions.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 30 Jun 2008, 13:19
by zick
Another behavior that would be interesting to be seen would be the parent/child model. A child is protected by a parent (specifically a mother) and a mother is protected by a father. Also attacking a parent can cause a child to well up with rage and attack a player who attacks a parent.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 30 Jun 2008, 16:49
by yosuhara
zick wrote:Another behavior that would be interesting to be seen would be the parent/child model. A child is protected by a parent (specifically a mother) and a mother is protected by a father. Also attacking a parent can cause a child to well up with rage and attack a player who attacks a parent.
or maybe child can flee while his parents fight the aggressor ...

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 01 Jul 2008, 01:41
by Booty
Lecter wrote:Dont worry about it, "apprentice programmer", wont be long once I start reading its code.

I were just giving ideas for the code. Since from what I saw monsters only have behaviour characteristics, I then though the AI code would consist of a main function, am I right? All you need for diferent behaviour objects it to have different behaviour functions.
This model is basically already seen with evil mushrooms. The fleeing while others attack is good. Maybe if the attacked monster flees to heals and recover and return would be good.

Re: Monsters teams and behaviours and antimonsters superposition

Posted: 01 Jul 2008, 01:43
by Rotonen
Just make sure you give it a low chance of trying to flee. Fleeing monsters are annoying on the long run. With our current gameplay it could be really annoying.