Jump to content

Playerbot


Recommended Posts

Hi Guys,

I have examined both 'Priest' and 'Druid' 'AI' and can confirm what Kreegoth says. The question is whether it is wrong or not ?

My reluctance to change the 'AI'

I am no gamer and the original 'AI's were developed and revised by guys who are. I am worried that with my inexperience I will make matters worse 'What I like 'AI' wise , might be hated by the next guy'. I have appealed for all to get involved in the development, to help produce a better 'AI'. One that can be used by all levels, satisfying the 'hardcore gamer' needs, yet be easy to use, even by a novice. I have had some guys show initial interest in 'AI' development, but then something scares them off. I wonder whether it might be deodorant I use ;)

PlayerbotPriestAI

No matter what i do the priest will not stop running in and meleeing the creatures I am fighting.. Even if i use the stay command and the HEAL orders.. They run in and melee and nuke all their mana away,

The existing priest AI contains a function call to override the bot(s) movement orders and set them to 'MOVEMENT_FOLLOW' the master. If you as the master go in fighing, so too will the priest, every time. If you stand back from the fight and order the bots to attack, then the priest will stay with you. I have commented out this and added some conditional code to set the combat 'SpellSequence' based upon combat orders (i.e ORDERS_HEAL will cycle through known 'HOLY SPELLS' only). If combat orders aren't set, ('ORDERS_NONE') then it will default to alternating through all Schools and spells e.g.

spell sequence

1. SPELL_HOLY > SMITE

2. SPELL_SHADOWMAGIC > SHADOW_WORD_PAIN

3. SPELL_DISCIPLINE > FEAR_WARD

4. SPELL_HOLY > MANA_BURN

etc...

with the understanding that the bot has sufficient mana. As such, some spells will never be used. It would be nice if we could develop code that adapted to changing circumstances, casting a more appropriate sequence of spells.

I would rather avoid changing movement orders during combat. If the movement order are 'MOVEMENT_STAY' the bot will remain static and be removed from the dynamics of battle. if the priest bot is too far from the battle, it's ranged spells will be ineffectual.

PlayerbotDruidAI

Ive also noticed that for some reason a level 80 druid 50% of the time does NOTHING during a fight. Stays in normal form and melees.. Casts almost no spells and does not shift forms to fight.

This 'AI' seems quite restrictive. It looks like druids will use 'DruidCombat' most of the time. The druid form will only change, if the druid has 'cat form', else it will return the bot to normal form. Also in 'DruidCombat', most spells are orientated towards mellee attack.

e.g. Restriction imposed for 'DruidTank' to allow more general shapeshifting.

    if (Victim and bot health >= 40% and master health >= 60%)
{
       if (Victim is m_bot)   // (i.e master or (pet or minion) doesn't count as a victim)
           SpellSequence = DruidTank;
}

I am not surprised that druid bots rarely changes it's form during combat.

Similiarly with 'DruidSpell', ranged casting only occurs if the targets health is above 20% and the victim is not a bot (i.e only if the target creature is attacking the master or (pet or minion)).

I have created a patch, but it is too large to post to the forum. What I propose is that we develop class 'AI' in a new alpha branch 'new-ai'. It's my hope that this branch will be a melting pot for all your ideas.

EDIT: The patch has been pushed. You can use the following bash script to create a standalone patch

#!/bin/bash -x
git clone git://github.com/mangos/mangos.git new-ai
cd new-ai
git fetch git://github.com/blueboy/portal.git new-ai:new-ai
git checkout new-ai
HASH=`git log --pretty=oneline | grep -m 1 'Cleaning code' | cut -d " " -f 1`
git diff $HASH > new-ai.patch

Your feedback will be appreciated.

Hope this helps

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Very nice to see that you are considering the implications of what I have mentioned as well as looking at this from a realistic standpoint Blueboy.

Being a Gamer myself ( 7 years EQ, 1 Year Wow )

I can say that in the case of the priest I do not think there is EVER a case where the priest should melee. The priest is set to Combat_Ranged and therefore if it is going to engage the target should use wand ranged attack as the hunters do with their bows. At least in my opinion.

For the second part of the question I do not believe the Druid is correct either.

If the Druid is going to remain in Restoration Talents then the player playing them would remain in Tree form or Normal Druid form and cast healing spells.

If the Druid was to be used as DPS it would use cat form

If the Druid was going to be tanking it would use bear form.

I dont imagine anyone who plays a druid would say that they would use normal form to tank or Cat form to heal. So those types of checks would only create a more realistic AI for the druid bot.

Sorry if this post seems a little disorganized but im randomly writing my thoughts down as I come to them after reading your post.

Perhaps the answer is to make a more static command in the Orders// Perhaps a Command useable such as HEAL KREEGOTH for example would cause the bot to ONLY cast healing spells on KREEGOTH so not melee no nuking no Dots ETC.

Or perhaps a STAY type command that was permanent and would not be overwritten unless the bot was given a follow command.

Again these are all just my observations and opinions.

I am going to attempt to patch the New-ui into the core im using and see the differences there and get back to you.

To edit this.. For some reason it seems even with that commented out in the PriestAI the priest is intent on meleeing lol.. As i said i think it would be more realistic even if the priest functioned like the Hunter did and stayed at a range and used the wand.

Link to comment
Share on other sites

To edit this.. For some reason it seems even with that commented out in the PriestAI the priest is intent on meleeing lol.. As i said i think it would be more realistic even if the priest functioned like the Hunter did and stayed at a range and used the wand.

The problem is that priests will approach the target and stand at ranged distance (25.0f). If the spells they cast causes sufficient 'dps', it will draw the targets attention. The priest in close combat will have no choice but to use melee. It may be possible to include conditional code in the general combat 'AI' (i.e. in PlayerbotAI.cpp) to force ranged combat for certain classes.

Cheers

Link to comment
Share on other sites

Trust me Blueboy im not trying to convince you that you are wrong.

What i was meaning is that Hunters stand at range and use their bows and do not melee and approach the mob.

should priests not do the same? they are listed as combat_ranged same as Hunters. I think perhaps there is no support for wands maybe?

Link to comment
Share on other sites

Hi Kreegoth,

I understand your concerns and I wish there was a definite way to keep the priest at distance, yet still part of the action. Even hunters will resort to melee combat at close range. Hunters of course have 'auto shot' to bias their ranged attack and invariably have a ferocious pet to occupy the target at a distance. I have been testing the code with a low level priest that does not have a wand, and only basic spells. Even so, observing the 'combat log' shows that the priest rarely resorts to physical attack. I use a druid 'tank' to occupy the target, while the priest stands back (at ranged distance) throwing 'smite', shadow pain' etc. I am sure your targets are alot tougher than the ones I come up against, so combat is likely to be more difficult and prolonged.

Can you detail your characters spells, weapons, levels, combat locations etc and I'll try to simulate a team on my server. Then we will be on the same page at least for furher testing.

Hope this helps, and thanks for your time testing this out.

Link to comment
Share on other sites

I think the issue lies there.. When i play i actually PLAY the tank.. I use a warrior.

I can bot effectively using a 80 warrior 80 priest 80 shaman 80 hunter 80 hunter.

I used to use 80 warrior 80 priest 80 shaman 80 hunter and 80 druid but dropped the druid due to its ineffectiveness.

The thing is Wand Shoot works like auto shot without having to be clicked over and over again.

more or less the easiest way to test this effectively would be for you to make a level 80 give them all t6 or t7 or so and play the warrior then try an encounter like trash from Utgarde keep or something.

I am happy to help you test any of this out i just hope you dont take my ideas and concerns as ingratitude to you for your work!

PS this may be a stupid idea but would it be possible to add a command to make a bot follow a DIFFERENT target? perhaps then i could tie the priest to the hunter and then it would stay at range with the hunter.

Also i dont see how making it so that a priest ( or really ANY class for that matter ) could DPS or heal would be a bad idea. I mean even for a holy paladin you would want it to conserve its mana and heal instead of DPSing. Same with a priest or a Druid or Shaman.

Link to comment
Share on other sites

Hi Kreegoth,

Thanks for the info, I'll try it out.

No worries... :D I just pleased that we can both collaborate on improving the AI.

Oh, by the way is the 'druid' AI any better?

Hmm, a bot following another bot, don't see why not. Leave it with me and I'll have a play.

No I agree, it might seem a little off the wall to some, having a priest 'dps', but why not. I'm sure that higher level priests and certainly paladins can do alot of damage with holy spells.

Speak with you soon

Link to comment
Share on other sites

Hi Kreegoth,

Thanks for the info, I'll try it out.

No worries... big_smile I just pleased that we can both collaborate on improving the AI.

Oh, by the way is the 'druid' AI any better?

Hmm, a bot following another bot, don't see why not. Leave it with me and I'll have a play.

No I agree, it might seem a little off the wall to some, having a priest 'dps', but why not. I'm sure that higher level priests and certainly paladins can do alot of damage with holy spells.

Speak with you soon

Agreed! Ill let you know about the druid after i get home from work and can test it.

I think that being able to specify whether they WOULD dps or heal specifically would be a GIANT advantage to playerbot.

Again as always this always just in my opinion:P

Link to comment
Share on other sites

posting an update to the earlier question.

Druid AI seems to be much better IMO with the druid effectively choosing to heal more often when given Heal orders also seemed to switch to catform more effectively when give ASSIST orders. Looks good blueboy.

Link to comment
Share on other sites

I'm glad to see the AI portion getting some more attention. Unless there is someone to offer more authoritative definitions of just how the AI should behave, I'd say the best way to figure out the logic of the scripts is to simply ask yourself, "What would I do in this situation if I were playing this character?"

I believe the AI upgrades are in good hands, with Kreegoth's help. After all, Playerbot has done nothing but consistently improve under your guidance, blueboy!

Link to comment
Share on other sites

Ha :D,

If the AI was a reflection of what I would do... you'd all be dead. I have been doing some research into gamers jargon/strategies and I realise I know nothing.

Am I correct in believing that in the following

to make a level 80 give them all t6 or t7

't' stands for tier or level, but does this relate to available spells in the spell book?

and

The player at the top of the threat list is said to have or hold 'aggro'

cite* http://wow-l2p.blogspot.com/2009/03/group-dynamics-tank-healer-dps.html

'aggro' is held by the tank. Is this the focus of the attacking creatures damage?

It might be helpful if we could build a glossary of terms, so there is no misunderstanding (wow 101).

Cheers guys

Link to comment
Share on other sites

T6 or t7 was meant to indicate sets of armor available in wow that players call t6 and t7. It does indeed mean tier short form such as Tier 7.

For example the Warriors T7 set can be found here ( http://www.wowhead.com/itemset=-18/valorous-dreadnaught-plate )

The Tier reference has no bearing on their spells or anything other than their items, in the reference that I was using it. I would however suggest giving the test chars all available spells for their level and some level appropriate weapons.

In wow Aggro is often called threat by players i find but they mean the same thing. A Tank having Aggro or Threat means that he is holding the creatures focus.

Link to comment
Share on other sites

Another idea i had perhaps it seems stupid but who knows!..

When you use a Hunter or a Warlock for a bot You can specify what pet they use or the reaction type they have.

Is it possible to preset what totems a shaman will use? I find mine always uses rather bad choices for fights and such and would benefit me as a person who plays using bots ( and other players ive spoken to ) to be able to preset which 4 totems they will keep up. Perhaps store it in a memory and on the shamans AI set a timer for them to reset them if they are destroyed or something..

Maybe could make a command such as like .BOT BOTNAME TOTEM manaspring,windfury,healing stream,stoneskin or something.

Link to comment
Share on other sites

All interesting suggestions Kreegoth. kyle1 (a.k.a chelobaka) has already added extensive controls for bot 'pet/minion spells' and combat reaction (passive, aggressive,etc).

/t BOTNAME pet spells (Shows spells known to bot's pet. Autocast spells will be shown in green)

/t BOTNAME pet cast <SPELLID | (part of) SPELLNAME | SPELLLINK>

/t BOTNAME pet toggle <SPELLID | (part of) SPELLNAME | SPELLLINK> (Toggle autocast for a given spell)

/t BOTNAME pet state (Shows current react mode of bot's pet)

/t BOTNAME pet react <(a)ggressive | (d)efensive | (p)assive> (Set bot's pet reaction mode)

I agree that it would nice if you could specify which pet/minion is active at any time.

I will also look into making bot 'totem control' more friendly.

Cheers

Link to comment
Share on other sites

blueboy if you got time can you improve dueling with bots..i mean they just stand and do nothing then after 10 sec they attack you then stop again..

Yes, I agree the duel is a bit one sided. The bot just stands there and takes all the damage, without really reacting.

Leave it with me.. :D

Cheers

Link to comment
Share on other sites

In regards to the dueling if it was even made that the bot saw entering a duel to be the same as entering combat with a creature it would perform much better IMO. Once the duel starts and the bot has a hostile target the bot could follow the same AI it uses to fight a creature any other time.

Link to comment
Share on other sites

Blueboy, im going to post here my personal scripts for the priestAI that i have created. With this AI script in place the Priest will perform exactly the same as yours does except instead of running into melee range it will use a WAND for ranged attack from a distance the same as a hunter does.

Lemme know what you think. I will likely do custom ones like this for my own use for Mages and Warlocks as well and can share those here as well if anyone is interested.

diff --git a/src/game/playerbot/PlayerbotPriestAI.cpp b/src/game/playerbot/PlayerbotPriestAI.cpp
index 84c4a62..7b83fe7 100644
--- a/src/game/playerbot/PlayerbotPriestAI.cpp
+++ b/src/game/playerbot/PlayerbotPriestAI.cpp
@@ -1,5 +1,5 @@
-
#include "PlayerbotPriestAI.h"
+#include "PlayerbotMgr.h"

class PlayerbotAI;

@@ -21,6 +21,9 @@ PlayerbotPriestAI::PlayerbotPriestAI(Player* const master, Player* const bot, Pl
    BINDING_HEAL                  = ai->initSpell(BINDING_HEAL_1);
    PRAYER_OF_MENDING             = ai->initSpell(PRAYER_OF_MENDING_1);

+    // WAND
+    WAND_SHOOT                     = ai->initSpell(WAND_SHOOT_1);
+
    // SHADOW
    FADE                          = ai->initSpell(FADE_1);
    SHADOW_WORD_PAIN              = ai->initSpell(SHADOW_WORD_PAIN_1);
@@ -57,6 +60,8 @@ PlayerbotPriestAI::PlayerbotPriestAI(Player* const master, Player* const bot, Pl
    SHADOWMELD                    = ai->initSpell(SHADOWMELD_ALL);
    BERSERKING                    = ai->initSpell(BERSERKING_ALL); // troll
    WILL_OF_THE_FORSAKEN          = ai->initSpell(WILL_OF_THE_FORSAKEN_ALL); // undead
+
+    m_rangedCombat = true;
}

PlayerbotPriestAI::~PlayerbotPriestAI() {}
@@ -169,6 +174,15 @@ void PlayerbotPriestAI::DoNextCombatManeuver(Unit *pTarget)
    // Damage Spells
    ai->SetInFront(pTarget);
    float dist = m_bot->GetDistance(pTarget);
+        if (dist <= ATTACK_DISTANCE && m_rangedCombat)
+        // switch to melee combat (target in melee range, out of ammo)
+        m_rangedCombat = false;
+        else if (dist > ATTACK_DISTANCE && !m_rangedCombat)
+        // switch to ranged combat
+        m_rangedCombat = true;
+
+         if (WAND_SHOOT > 0 && m_rangedCombat && !m_bot->FindCurrentSpellBySpellId(WAND_SHOOT))
+        ai->CastSpell(WAND_SHOOT, *pTarget);

    switch (SpellSequence)
    {
@@ -434,4 +448,5 @@ bool PlayerbotPriestAI::BuffPlayer(Player* target)
        return true;

    return false;
+
}
diff --git a/src/game/playerbot/PlayerbotPriestAI.h b/src/game/playerbot/PlayerbotPriestAI.h
index 67df6a6..f2495bd 100644
--- a/src/game/playerbot/PlayerbotPriestAI.h
+++ b/src/game/playerbot/PlayerbotPriestAI.h
@@ -12,6 +12,7 @@ enum

enum PriestSpells
{
+    WAND_SHOOT_1                    = 5019,
    ABOLISH_DISEASE_1               = 552,
    BINDING_HEAL_1                  = 32546,
    BLESSED_HEALING_1               = 70772,
@@ -90,6 +91,7 @@ public:
private:
    // Heals the target based off its hps
    bool HealTarget (Unit* target);
+    bool m_rangedCombat;

    // holy
    uint32 BINDING_HEAL,
@@ -109,6 +111,9 @@ private:
           RESURRECTION,
           SMITE;

+    // Wand Ranged
+    uint32 WAND_SHOOT;
+
    // shadowmagic
    uint32 FADE,
           SHADOW_WORD_PAIN,

Link to comment
Share on other sites

Hi Kreegoth,

Thanks very much for your contribution, I will try it out and get back to you as soon as I can. I would like to add you to the collaborators list for the GitHub repos, if you are interested. That way you will be able to push your work directly for others to use. If you are interested, I will give you any help you need to push your code.

Thanks again

Link to comment
Share on other sites

Sure Add me to The List!

Thank you for the invite. Although now would probably be a good time to tell you I have no experience with Git other than to retrieve mangos and apply patches...

No problems, neither did I when I started with playerbot

Patches are easy to create and I'll shortly post example instructions, to get you started.

Cheers

Link to comment
Share on other sites

Done! Did you get a chance to test it out? I have the Warlock and Mage ones working correctly as the priest does now. Havent noticed any drawbacks as of yet will do some further testing tonight and report back my findings then.

Not yet :D but I'll do my best to check it out in the next couple of days.

Create a working patch for your work ( I run a unix box, but you can emulate the command instructions on windows)

From your chosen root directory, create two parallel directory trees a & b.

mkdir -p a/src/game/playerbot

and

mkdir -p b/src/game/playerbot

Note the -p option forces the creation of subdirectories

The 'a' tree will hold your reference files and the 'b' tree will hold your modified files

Right now you need to copy the relevant files to these empty trees. I will use the files from 'new-ai' as an example throughout.

mkdir new-ai

cd new-ai

git init

git pull [email protected]:blueboy/portal.git new-ai:master

navigate to the directory where the target files exist. Then copy the files to the appropriate directories in the 'a' and 'b' trees

example

cd new-ai/src/game/playerbot

cp PlayerbotPriestAI.* ../../../../a/src/game/playerbot

cp PlayerbotPriestAI.* ../../../../b/src/game/playerbot

check The files in both trees are identical so the following command (from a & b root) will in theory produce a blank patch

git diff a b > your.patch

If it doesn't, check that you have copied all the relevant files.

Now you can modify the files in the 'b' tree. Once done, run above command again and produce a raw patch. The raw patch will need some manual editing. Each file mod in the patch, will have a header.

example header

diff --git a/a/src/game/playerbot/PlayerbotPriestAI.cpp b/b/src/game/playerbot/PlayerbotPriestAI.cpp

index 84c4a62..7b83fe7 100644

--- a/a/src/game/playerbot/PlayerbotPriestAI.cpp

+++ b/b/src/game/playerbot/PlayerbotPriestAI.cpp

@@ -1,5 +1,5 @@

In the raw patch, you will observe an additional directory level (highlighted 'a/' and 'b/'), that will break the patch if not removed. This gives,

diff --git a/src/game/playerbot/PlayerbotPriestAI.cpp b/src/game/playerbot/PlayerbotPriestAI.cpp

index 84c4a62..7b83fe7 100644

--- a/src/game/playerbot/PlayerbotPriestAI.cpp

+++ b/src/game/playerbot/PlayerbotPriestAI.cpp

@@ -1,5 +1,5 @@

Do this to all file mods in the raw patch to produce a working patch. Now practice creating your own patches and then I'll show you how to apply these and push your changes to 'new-ai'. I have now added you to the collaborators list for portal and sub-branches

Hope this helps

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use