Jump to content

Playerbot


Recommended Posts

Update: Worn item UNequip- pushed to skillbot

If your bots' equipped items get too worn (10% of max durability atm) they will automatically Unequip them IF they have the space in iventory to do so.

They will then inform you of any worn items.

Bots should not equip any worn items.

If you find any problems, just turn off the bots AutoEquip , til it can be fixed.

This is an integrated part of autoequip now, but could easily be made into a separate function if needed.

I've tested this with two parties, for several hours.. I hope theres no major issues I haven't found.

Let me know how it goes, and if any changes need to be made to anything.

The percentage at which the bot UNequips the item, might need tweaked, so let me know if anything odd happens.

Hope it works! :)

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

I'm working on a conflict between new-ai and skillbot. will update the branch when I figure it out.

I've been attempting to keep skillbot up to date with new-ai, but am getting a merge conflict atm.

sorting it.

***Edit***

sorted!

skillbot up to date with branch new-ai

should merge fine now

Link to comment
Share on other sites

@macks

Hey! Everything I've worked on I push to the skillbot branch of playerbot:

Playerbot - skillbot branch

git command would be (from your local repo):


git pull [email protected]/blueboy/portal.git skillbot

I've fixed a merge conflict, and it is up to date with the new-ai branch at the moment.

If you are using the new-ai branch of code, just pull the skillbot branch and it should merge fine!

If not, let me know and I'll try to help! :)

Link to comment
Share on other sites

@macks,

Just to clarify: skillbot is a branch of playerbot, not a new version. I've kept it merged with new-ai to make sure it stays

compatible, but merging it with an existing playerbot code shouldn't add much size at all.

if you're already using playerbot, (especially if you're already using new-ai code) i doubt you'll notice much size difference at all.

It should merge fine what you have already. maybe 100 kb more tops? havent really paid attention.

Other than the autoequip functions, it only adds a few minor fixes to existing stuff.

Hope that helps!

Link to comment
Share on other sites

Okay, recap..

bots will now automatically unequip worn items if they get below 10% of their max durability.

they will also check for worn items, and wont equip them.

Once repaired, they'll use them again.

They are more picky now, so if they have an item that has stats they cant use, they wont equip it,

even if theres nothing else.. You can inspect them, and tell them to equip and they will, but if you

don't turn off autoequip meanwhile, they will just take it off again =)

I've had to manually edit a new pull from new-ai (won't merge automatically) but they are merged in

this branch (finally!) so if you have any probs let me know. Ive compiled it 3 times, pulled it to 3 different

local temp repos and compiled.. and its compiling fine, and after 2 hours of testing in game, everything seems

to be working.

Enjoy!

**Edit**

completely restructuring the ItemStatComparison() function.. its far too large and inefficient..

what I'm working on will effect only this function within playerbotai.cpp itself.

It will do the same thing, just with more efficient coding (I hope!)

This will make it easier to tweak class/style decisions for item stats.

***Current EDIT***

Pushed an update removing whitespaces * :8 * sorry about those, I'll be more careful

AND the restructured ItemStatComparison() function. (still basic, will be adding stricter comparisons as it goes and

probably have these decisions based somewhat on the talent specs/styles you choose for the bot)

Dong Fui Chow!

Link to comment
Share on other sites

mangos gives this error on server start up

********************

the procedure entry point ?PrintindexError@Object@@ABE_NI_N@z

could not be located in the dynamic library mangosd.exe.

********************

BUT i click on ok, and server loads up and plays fine..

when I googled this, all I got was some pastebin logs from 2010 of the same error... but no solutions

Is this related to mmaps? I haven't created them yet (I have created the newest dbc, maps, vmaps , just not the mmaps yet, I will tonight after I get done wtih the computer.)

This just started after recent update to mangos. I've already recreated the new version of everything , just not made mmaps yet..

Hope thats not confusing lol

I'll be making my mmaps tonight, if that resolves it I'll let yas know.

Link to comment
Share on other sites

Was thinking of adding a line or two of code allowing the player to adjust the bots follow distance on the fly..

Sound like something anyone would use?

It would default to the playerbot.cfg setting, but depending on the situation you could say for example:

/p follow low

or

/p follow medium or med

or

/p follow high

each being a set percentage change of the config settings..

Thoughts?

Link to comment
Share on other sites

@blueboy,

gotcha, I'll look at it.

Don't plan to allow much change. I notice though if your party includes tauren, they really invade your private space! lol

Its hard to see things at times. I'll test some minute changes and see what happens.

while you can set that in the config, I thought maybe an option to tweak that in game might come in handy.

Atm I'm using 1.5 / 2.0 in config and thats not bad, so maybe allow a tad more than that..

the initial value is .5/1.0 .

***Edit***

this is working out rather well at the moment.. Ive added a sub command for follow (follow dist) may change that but for now.. thats what it is..

You type it, and bot(s) will increment their follow distance by a set number, up to three times.. I'll explain,

/p follow dist

Bot whispers -"my follow distance is now set to medium"

/p follow dist

bot whispers -"my follow distance is now set to high"

/p follow dist

bot whispers -"my follow distance is now set to highest"

/p follow dist

bot whispers -"my follow distance is now set to Normal"

I'm still working on the specifics and tweaking the added distance.. It has some interesting results I have to say..

for one, when you stop, they dont all dog pile you .. they randomly space out around you in a much neater fashion.

You can space them even better by giving each of the bots a different follow distance.

It might take some tweaking / changing, but I think it might be work out to be a good addition.

I made the command the way I did (incremental) so it would be easy to macro..

I'll let you guys know when I have a copy to test.. first I really need to compare my files to the master and make sure I've gotten rid of all my whitespace/ tab indention errors.

I seriously did NOT make all those!! Git has it out for me!

Link to comment
Share on other sites

Hi Gitch,

Sorry, I should take more time reading posts (Too many late nights). I saw '"follow" and on the "fly" and thought you wanted to reduce the distance between player and bots during flight. Obviously you can set the general follow distance in the config file, but I agree it would be nice for users to be able to change this as they play. Hopefully I'll have a chance this weekend to do some more gaming ;) Believe me whitespaces in code are like cancer, if you don't keep a check on them they take over. I remember creating a standalone patch for movemaps before it's inclusion in the core, it took well over an hour to clean the code.

Cheers

Link to comment
Share on other sites

Hey Blueboy,

It's okay, I figured you misunderstood :D

BUT I had also actually thought about that distance as well, so I'm glad you mentioned what you did about them following too soon for taxi's.

Almost done with follow adjust. Will be 3 new sub commands for 'follow', 'near', 'far', 'reset' .

Hope that doesnt get confusing.. I'll explain them:

'follow far' will increment the bots min/max follow distance by 1 each time the command is given.. for testing purposes, there is no limit to how far you can make it atm..

'follow near' will increment the bots min/max follow distance by -1 each time the command is given. once 0 is reached it resets to config file default.

'follow reset' as it seems, resets the follow distance to the config file default distance.

When I finish some polishing up, I'll push this, and I'll try to also post a patch (its really not that much code, changes in two files PlayerbotAI.cpp and PlayerbotAI.h .

Cyas!

Link to comment
Share on other sites

Thank Kreegoth for pointing out an issue between playerbot and mmaps.

The bots don't check Z position and sometimes wind up above or below ground trying to follow you along the X and Y position and dont realize you are above or below them..

Added a section to the following code. The "GetPositionZ" is the added part, between the asterisk lines . you can see where to put it. I'll be adding it to skillbot code. I'm in the middle of working on that section for

variable following distance and am too lazy to make a patch atm :D

This just happened to be the very section of code I'm working with... 3 lines down!

I still don't have mmaps created, so ... if someone can test it and verify it works, would appreciate it.

Compiler liked it okay, just can't test it really...

This is NOT a patch, you'll have to enter the lines between the asterisks in the code below to you PlayerbotAI.cpp file and compile.

(this is pushed to skillbot branch now)


// use player's corpse as distance check target
                       if (pTarget->GetCorpse())
                               distTarget = pTarget->GetCorpse();
               }

               // is bot too far from the follow target
               if (!m_bot->IsWithinDistInMap(distTarget, 50))
               {
                       DoTeleport(*m_followTarget);
                       return;
               }
               //****************************************************************************************
               if (m_bot->GetPositionZ() > (pTarget->GetPositionZ() + INTERACTION_DISTANCE) ||
                  (m_bot->GetPositionZ() + INTERACTION_DISTANCE) < pTarget->GetPositionZ())
               {
                       DoTeleport(*m_followTarget);
                       return;
               }
               //****************************************************************************************
               if (m_bot->isAlive() && !m_bot->IsBeingTeleported())

Link to comment
Share on other sites

Hi Gitch,

I not sure whether you have tried copying/pasting your patch, but with the code box formatting 'Diff' you endup including line numbers and no (cr/lf)s. I had problems with this myself. It's very pretty to read, but for practicality it's better to post code boxes in raw format.

Cheers

Link to comment
Share on other sites

@blueboy, thanks I forgot about that.. that patch is obsolete now, so deleting it!

Pushed to skillbot

Adjustable follow distance + Z check.

Bots initially just stand there and not follow until follow reset is given...

Patched & pushed fix for this...

**Edit**

Thanks to blueboys advice and git help :D

I've also pushed a whitespace / tab in indent fix to skillbot..

Looks like its finally cleaned up ... for the moment haha.

AND finally back to current with all the updates I had made before I trashed the branch and had to

rebuild it /sigh

Have fun guys!

(p.s) if in testing the new Z check, you find there is still a need for a "summon bot" command let it be known..

(maybe I'll put the 'puter to making Mmaps tonight when I log off and go to bed )... maybe :rolleyes:

Take Care

*Edit*

if anyone tests this, Id appreciate your thoughts on distance ... how far do you let them follow etc.. I'd say we probably need to put a cap on how far you can let them follow.... maybe 1 less than INTERACTION_DISTANCE which would be 49 (though not sure if anyone would ever have them following that far away).

Link to comment
Share on other sites

Hey guys,

Just pushed a new shaman AI to new-ai

-Enhance and Elemental rotations have been implemented/updated

-Shields are now handled slightly differently and will be refreshed in comabt if needed

-No progress on weapon buffs or totem stacking yet, still looking for a way to make them work

Its got some pretty radical changes, if anyone tests it I'd be interested to know how they perform

Link to comment
Share on other sites

Playerbot Wiki has been updated a little .

check it out HERE or click the link in my signature.

Updates coming for AutoEquip (new class usefulness item comparisons)

config file setting for "levels lower than bot" to tell bot how low level of a white item he/she should auto sell when told to. Default will be 10 levels lower than bot. (I like 5!)

Adjustable follow distance (a bit more fine tuned, text cleaned up etc)

will push when I have most of this where I want it to be at present.

cyas

Link to comment
Share on other sites

Update

Pushed to skillbot

Feb, 14, 2012

Updated Adjustable follow distance, added new config setting "PlayerbotAI.SellAll.LevelDiff"

(Make SURE you copy the new Playerbot.conf.dist.in file and rename/replace your old config in your Mangos directory)

copy Playerbot.conf.dist.in from src/game/playerbot/ to your wow directory, rename it to playerbot.conf, edit it if you like, and save it.

it defaults to 10, you can set it to what ever you like..

What does it do?

bots will sell white items that are "x" amount of levels lower than they are.

X is the setting. Defaults to 10.. set it as you like.

Cleaned code up.. wow, I actually made a patch with not even a tab in indent error lol...

We'll see how long that lasts!

Also I tweaked the ItemStatComparison some more, it will be even more strict now on what bots will autoequip.

Take care guys

Link to comment
Share on other sites

More stuff from me!

recent push to new-ai:

Implemented Resist combat order

-Just 1 order that takes any of the four resist types (fire, frost, nature, shadow)

-Works as a secondary order so a shaman can eg. resist and dps or a paladin can tank and resist

-For now it only effects shaman totems, I havn't looked at the paladin AI yet

Only other class effected will be hunter, the rest(eg. priest) can resist without impacting any other spells

The orders are single strings eg: 'resistfire' or 'resistnature'

It didn't like spaces :S

It will also tell you that they are resisting 1-4 instead of names, since it uses enums, I don't think this is a large enough issue to bother with.

I don't envision it being used much but since they have the capability I figured they should be able to use it if anyone wanted to.

If someone's really keen it might even be used to make them wear resist gear, lol

As always, I appreciate any feedback on how it works

Link to comment
Share on other sites

Update

Pushed to skillbot

Feb, 15, 2012

Updated a section of code which caused bots to ignore the attack command if they could not see the target.

This will now cause the bots to move to the player, and check LOS again. If they can see the target now, attack,

if not, they now can ignore the command. (so the player must still be in LOS of the target).

And heres a patch for it as well:

diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
index 45f413d..c8dd825 100644
--- a/src/game/playerbot/PlayerbotAI.cpp
+++ b/src/game/playerbot/PlayerbotAI.cpp
@@ -1702,7 +1702,6 @@ void PlayerbotAI::HandleBotOutgoingPacket(const WorldPacket& packet)
            }
            return;
        }
-
        // Handle when another player opens the trade window with the bot
        // also sends list of tradable items bot can trade if bot is allowed to obey commands from
    case SMSG_TRADE_STATUS:
@@ -7612,7 +7611,13 @@ void PlayerbotAI::_HandleCommandAttack(std::string &text, Player &fromPlayer)
    if (attackOnGuid)
    {
        if (Unit * thingToAttack = ObjectAccessor::GetUnit(*m_bot, attackOnGuid))
-            if (!m_bot->IsFriendlyTo(thingToAttack) && m_bot->IsWithinLOSInMap(thingToAttack))
+            if (!m_bot->IsFriendlyTo(thingToAttack) && !m_bot->IsWithinLOSInMap(thingToAttack))
+            {
+                DoTeleport(*m_followTarget);
+                if (m_bot->IsWithinLOSInMap(thingToAttack))
+                    GetCombatTarget(thingToAttack);
+            }
+            else if (!m_bot->IsFriendlyTo(thingToAttack) && m_bot->IsWithinLOSInMap(thingToAttack))
                GetCombatTarget(thingToAttack);
    }
    else

no idea why the large extra blank space in the code box... its not like that in my text here...

Take Care!

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