Jump to content

Playerbot


Recommended Posts

Arena

As for Arenas and Battlegrounds... Let's start with arenas. They should be simple: it's still only a party (2v2, 3v3 or 5v5). There's different optimal gear, different talent specs and different spell rotations (geared towards burst damage rather than maximum dps) but frankly I don't see why it wouldn't work with the current playerbot (albeit suboptimally) - with the relatively small modification to attack players instead of mobs. The arenas are more or less square and the only objective is to kill the other team. The only real difficulty will be finding opponents. And perhaps getting the bots to join your team.

Battleground Basics

On to battlegrounds which are quite a bit more complicated. In addition to what I've mentioned above, I see three big steps that need to be taken for playerbot to be viable in battlegrounds. Maps and such can be found here but ignore the level ranges, those apparently have changed for Cataclysm. This is mostly for blueboy and those who haven't (or barely) played battlegrounds.

  1. The AI needs to be able to work individually as well as in small groups, and there also needs to be map-wide coordination. While it's generally better to be in 'groups' of 2 or 3 (and/or a giant swarm or two), sometimes a few single players going off on their own can mean victory. In any case it's very different from the PvE minded AI now where the entire party/raid should stick together. Quick example: WarSong Gulch, 10v10. A group of 3 defends, a group of 6 goes through the middle to defeat the enemy, slowly going towards the enemy flag. Finally, a single player goes off alone by the side - Perhaps there is only 0 or 1 defender, or the defenders are too busy fighting the swarm to notice a single player. Perhaps there's 2 defenders, a swarm of 5, and 3 trying to sneakily get the flag. Make it random, unpredictable, and it should be fun for the humans.
  2. The AI needs to understand the objectives of the battleground in question. See list below
  3. The system needs to be able to add playerbots not linked to actual human players. Since battlegrounds (and arenas) require two sides - while not strictly necessary - it would be beneficial to have playerbot add AIs not under the command of players. Further explanation below

Battleground types information: - [em]only for those not familiar with BGs[/em]

  • There are flags to acquire and bring back home to your own flag/base. Likewise, when the enemy has your flag, you must return it. If each team has the other, the enemy flag must be defended in your own base while attempting to retrieve your own. (First Person Shooter (like Unreal Tournament): Capture The Flag)
  • There are 'bases' (call them immobile flags if you will) to capture. Here you need to channel a 'capture' spell for a bit without being interrupted by an enemy. Once that succeeds, it takes a bit longer for it to actually become yours - the enemy usually has a minute to cancel your 'takeover'. Holding bases can yield various advantages.(FPS: Domination)
  • Destructible items can be objectives. Towers or gates are the only ones, I believe.
  • Some battlegrounds are mixed offense and defense. Others are one side does offense first until time runs out or they win, then the other side tries to beat that time. (FPS: Assault)

These objectives are combined in different ways:

  • WarSong Gulch: Capture the Flag. 3 Flag captures wins the match. 10v10. Levels 10-19, ..., 70-79, 80
  • Arathi Basin: Domination, 5 bases. Holding more bases gets exponentially more points (over time). 15v15. Levels 20-29, ..., 70-79, 80
  • Eye of the Storm: mix of Capture the Flag and Domination. Single flag to bring back to a friendly base, 4 bases. Holding more bases gets exponentially more points (over time and per flag capture). 15v15. Levels 61-70, 71-80.
  • Alterac Valley: A kind of assault but where both teams attack and/or defend at the same time. 4 towers (or so) to destroy/defend, with PvE boss (+ 1 crony per still-standing tower) at the end. 40v40. Levels 51-60, 61-70, 71-80.
  • Strand of the Ancients: Alternating assault. 3 to 5 gates to destroy before destroying a crystal. Then the other team tries to do the same faster. 15v15. levels 71-79, 80
  • Isle of Conquest: Domination (bases held also activate various things like siege weapons, a zeppelin, ...). 3 Gates per team to destroy. Frankly forgot the winning objective. PvE boss probably. 40v40. levels 71-79, 80
  • World Zone - Silithus: Capture the Flag, sort of, except there are lots of flags, each making you slow and highly visible.
  • World Zone - Eastern Plaguelands: Domination. 4 towers.
  • World Zone - Others
  • World Zone (WotLK - not listed in link above) - Wintergrasp: Assault, the winner of the previous Wintergrasp is defending. Gameplay has a lot in common with Isle of Conquest.

Stand-alone playerbots - [em]advantages[/em]

This is something I've been thinking of quite a bit, but I haven't got much to show for it yet. The idea is simple.

  • Example: A player wants to run through an instance of shadowfang keep. Instead of creating 4 more bots and levelling them to that point, he simply uses a command to summon them (or, once it's working, playerbot interfaces with Dungeon Finder to fill out open spots).
  • Another example: The player finds out about dragon flying mounts. He goes through the quests. All of a sudden he comes to a 5man party world quest. Woops, hope you've kept levelling alts. Or you simply run a few commands, ".bot request tank", ".bot request healer", ".bot request dps" x2. A few moments later *poof* there they are, ready to auto-accept your party invite.
  • Yet another example: You enter Silithus. Unfortunately this is an unpopular zone (mostly due to outlands levelling/gear). So Mangos loads the zone (because there were no players before), when it does that it also loads a few playerbots and flags them PvP. You no longer feel alone in the zone, [em]and[/em] the world zone pvp becomes a whole lot more exciting.
  • And yet another example: You're 48. You (or you and a few friends) want to do some Arathi Basin. Your server has low population so BG queues are pretty empty, let alone at the 40-49 bracket. But fret not, playerbot immediately fills your battleground to 12v12 (80%, plenty room for human players - better yet, setting for playerbot.ini). Should more humans join you can even remove a bot or two.

Stand-alone playerbots - [em]Enough about why I want them. Onto what we'll need.[/em]

  • First you'll need a way to add players. The right way of doing it would be to use Mangos' functions to add an actual account, add a character to it, and log it in. It looks hard when I look over the database, but it should be easy enough with the core's functions. The quickfix way of doing it would be to simply add a new table under characters. It probably wouldn't really be quick though. Things would quickly creep up like bot exploration XP, bot inventory, ...
    Although, come to think of it, playerbot uses 0-9 bots from one account, so perhaps you could do it with a single account adding 50 characters to it?
  • Once you've created characters you'll need to set their race, gender, class, level, appearance. Summoner's level +/- 3? Another setting for playerbot.ini. You might also want to (optionally) allow this to be specified by the summoner, within limits (as in, max level = summoner + 4).
  • There's also talent builds. Each talent build can of course have it's own glyphs and spell rotation (if not specified, fallback to default). As many ways of input as possible (e.g. [5/5 Toughness], or just {[10, Toughness], [11, Toughness]}, ...). Will need to be specified with: class, PvP or PvE (... or both?), function (tank, healer, dps, hybrid/assist-tank, hybrid/assist-healer) and Description. For example: Death Knight, PvE, tank, "Blood Tank 51/17/3".
    Actual talent build: "DEATHKNIGHT","Blood Tanking (53/8/10)",
    [5/5 Toughness, <SNIPPED FOR READABILITY>, 3/3 Will of the Necropolis, 5/5 Blood Gorged, 1/3 Bloodworms]
    [Major Glyph of Disease,Major Glyph of Death Strike,Major Glyph of Vampiric Blood,Minor Glyph of Horn of Winter,Minor Glyph of Raise Dead,Minor Glyph of of Pestilence]
    [em]Protip: don't hardcode this. Put it in the playerbot.ini or even an extra .ini[/em]
  • Let's not forget equipment. Here I suggest a trickle down system. You create a character level 27 for ShadowFang Keep. There are no hands listed for (that class, function, and) level 27, look at 26,25, and so on. TODO: expand for a bit of variation. It should be possible for equipment to be tagged PvE or PvP, but also to link those equips to an instance. Once you're level 80, level doesn't tell you much as to how good the equips should be. TODO: Add coefficients to the playerbot.ini to make gear better/worse for bots (seperate setting for PvE and PvP). Change difficulty of instances and battlegrounds (or, in other words, increase/decrease human contributions). Perhaps even allow these settings to be changed in-game for that particular instance/party/side/...
    [em]Protip: don't hardcode this. Put it in the playerbot.ini or even an extra .ini[/em]

There's a few more thoughts I have but this post is in danger of becoming a wall of text so I'll leave you to ponder and reply to the above.

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Hi

I use YTDB myself so I'll pop over to Westfall and see if I get the same. I've taken a quick look at the paladin ai and I agree there is no code to handle "Seal of Righteousness'. Leave it with me and I'll come up with something. The loot roll should be easy to fix. I'll include a condition to force the bots to pass on the loot if their inventories are full.

Hope this helps

Link to comment
Share on other sites

Hi

I use YTDB myself so I'll pop over to Westfall and see if I get the same. I've taken a quick look at the paladin ai and I agree there is no code to handle "Seal of Righteousness'. Leave it with me and I'll come up with something. The loot roll should be easy to fix. I'll include a condition to force the bots to pass on the loot if their inventories are full.

Hope this helps

Cool.

That Murloc Hunter's pet goes under the ground and only bot can target/attack it. With only one bot, bot was too weak to kill it.

But she still tried to kill it. No bot command to follow the master even bot is in combat? That could have been handy.

With many bots I was able to kill the pet and then mangosd crashed when bots tried to loot it...I think.

Many times bots go under the ground. I have VMAPS enabled, so is it Mangos bug?

Best regarsd,

Akuba

Link to comment
Share on other sites

Hi Guys,

The bots can now accept and complete quests from gameobjects.

Example. A quest chain that begin with guard Thomas, located at the eastern Elwynn bridge. You are first instructed to [Find the lost Guards]. Travel north upstream towards Stone Cairn lake. Here you will find the corpse of the first guard Malaki. There are two ways the bots can complete these quests, either with the player or without. If the player examines the corpse, the bots close to the player with automaticly turn in the quest [Find the lost Guards] and then accept the new quest [Discover Rolf's fate]. For the bots to do this on their own, Malaki's corpse is treated as a gameobject. So first, execute a 'survey' command to display [A half-eaten body]. Then using the 'get' command,

/t BOTNAME get [A half-eaten body]

The bots will now travel to the corpse, kneel to open, turn in [Find the lost Guards] and auto-accept [Discover Rolf's fate]. You will then travel to the murloc village to find Rolf's corpse and repeat the process before returning to guard Thomas.

  • I have updated the group loot code for bots. If the bots do not have any space in their inventory, they will pass on the roll.

  • I have updated PlayerbotPaladinAI.cpp to include code to utilize 'Seal of Righteousness', so 'Judgement of Light' and 'Judgement of Wisdom' can be used in combat.

I have been examining PlayerbotPriestAI.cpp too. The healing spell LESSER_HEAL was not used to heal target members. The example given by Akuba and kennumen would certainly work, but I feel there maybe a better way. The chain of heal spells replace one another. Once GREATER_HEAL is learnt at level ~38, LESSER_HEAL becomes all but redundant. So too,

else if (hp < 60 && ( (HEAL > 0 && ai->CastSpell(HEAL, *target))

|| (LESSER_HEAL > 0 && ai->CastSpell(LESSER_HEAL, *target)) ))

return true;

code expressly referencing LESSER_HEAL. If we were to have a more general condition, say

else if (hp < 60 && ( (HEAL > 0 && ai->CastSpell(HEAL, *target))

return true;

and change the value stored in HEAL, then the code would remain useful

A snippet from the initialization of spells, from the priest AI

LESSER_HEAL = ai->initSpell(LESSER_HEAL_1);

FLASH_HEAL = ai->initSpell(FLASH_HEAL_1);

(FLASH_HEAL > 0) ? FLASH_HEAL : FLASH_HEAL = LESSER_HEAL;

HEAL = ai->initSpell(HEAL_1);

(HEAL > 0) ? HEAL : HEAL = FLASH_HEAL;

The ReloadAI() function that I have recently added will now update active spells, each time a new spell is learnt. So before the HEAL spell becomes available, HEAL can be equated first to LESSER_HEAL and then to FLASH_HEAL. This I believe will make the code more concise and the AI more flexible.

I realise that each spell has it's uses. In combat it would be better to utilize faster yet weaker spells. In non-combat situations, speed of casting is not so important and more powerful spells would be favoured. I suggest that the complexity of AI for each class will evolve in time with your help of course.

@kennumen Thanks for the wealth of information you provide. This will be very useful for me and I'm sure many others as we begin to develop the AI. Please bear with me, it will take awhile for me to digest everything ;) before I can comment properly.

@Akuba You say that the murloc pets are disappearing below ground. I guess you are not using 'mmaps' then. This provides solidity to visible maps/buildings and 'pathfinding' ensures that land based creatures always follow the most appropriate routes (i.e. above ground level ;) ) travelling from point A to point B. So no more hostile creatures levitating across canyons or else passing through walls to attack you). Once you try it, you won't go back. Hopefully it won't be too long before the code is included in the core.

I will be updating the new-ai branch shortly.

Hope this helps

Link to comment
Share on other sites

Felt like contributing, thought I'd go look at the talent code to see if I could help somewhat with talents in playerbot. After a little searching I found the talent tab info, as well as the talent info... Except I didn't find any link between the talent description and the talent ID. It makes sense that the description wouldn't actually be necessary server-side, so I set out to link it (mostly to be used in a possible future playerbot Talent Template processing, but also to have a correlation between IDs and names, to easily look up). I got the info from the gamestool 3.3.5 talent calculator - no direct link because that site is NSFW. The result was made to be pasted into Excel (or Calc or whatever your office suite's spreadsheet software is named). The information is actually probably out there already and I should've done it more automatically instead of typing it all over manually (so yes, there may be a typo or two - but I sure hope not), but too late for that now. If you happen to do the talent enums (should be easy enough with a concatenate), these would probably go in "src\\game\\dbcenums.h".

Oh, and all the "#N/A" errors you get near the end is because I simply didn't do the Pet talents.

Concerning your LESSER_HEAL solution it's more elegant. I don't agree with the pecking order though. Flash Heal is a viable spell even later on due to its speed (as I recall it's main weakness is not a lack of HPS but its mana drain), good for emergencies. Also, I think it's HEAL that replaces LESSER_HEAL, without having anything to do with FLASH_HEAL. But it's been a while since I played a priest, let alone a healing one. Since LESSER_HEAL isn't ever really meant for emergencies I'd simply have HEAL replace LESSER_HEAL when HEAL becomes available and leave FLASH_HEAL out of the replacement conditionals.

Since you're so enthusiastic :D I have more information for you to read. I don't agree with all of it but it's probably less biased and a bit more complete (but less detailed in some areas) than what I wrote before, so it's certainly a good read. Instance Grouping Guide and Newbie battleground guide.

Link to comment
Share on other sites

hey guys, i've got a error while compiling. someone got an idea how to solve this?

[  7%] Built target g3dlite
[  7%] Built target gsoap
[ 72%] Built target mangosscript
[ 72%] Built target framework
[ 76%] Built target shared
[ 76%] Built target realmd
[ 76%] Building CXX object src/game/CMakeFiles/game.dir/BattleGround.cpp.o
/home/marlon/mangos/src/game/BattleGround.cpp: In member function âvirtual void BattleGround::EndBattleGround(Team)â:
/home/marlon/mangos/src/game/BattleGround.cpp:757:126: error: âclass Playerâ has no member named âGetGUIDâ
make[2]: *** [src/game/CMakeFiles/game.dir/BattleGround.cpp.o] Fout 1
make[1]: *** [src/game/CMakeFiles/game.dir/all] Fout 2
make: *** [all] Fout 2

Link to comment
Share on other sites

Hi kennumen,

Forgive my ignorance over the relevance of the talent info. I guess management of talents is key to bots properly functioning in arenas and battlegrounds. I'm very much out of my depth with the details at present, but I hope to find time to get some experience in these areas myself. When I do, I'm sure this information will be very useful, so keep posting it and thanks

I thought I might have got the heal spell order wrong, but that can be easily fixed, thanks

and thanks for your time

Link to comment
Share on other sites

hey guys, i've got a error while compiling. someone got an idea how to solve this?

[  7%] Built target g3dlite
[  7%] Built target gsoap
[ 72%] Built target mangosscript
[ 72%] Built target framework
[ 76%] Built target shared
[ 76%] Built target realmd
[ 76%] Building CXX object src/game/CMakeFiles/game.dir/BattleGround.cpp.o
/home/marlon/mangos/src/game/BattleGround.cpp: In member function âvirtual void BattleGround::EndBattleGround(Team)â:
/home/marlon/mangos/src/game/BattleGround.cpp:757:126: error: âclass Playerâ has no member named âGetGUIDâ
make[2]: *** [src/game/CMakeFiles/game.dir/BattleGround.cpp.o] Fout 1
make[1]: *** [src/game/CMakeFiles/game.dir/all] Fout 2
make: *** [all] Fout 2

Your question is a little premature as playerbot does not yet have anything to do with battegrounds. :D However I took a look at BattleGround.cpp and I couldn't find a reference to 'GetGUID' in the function EndBattleGround(Team). I guess you are using other mods on your server that maybe changing the core code. Off the top of my head you might try changing the reference to the player, using GetObjectGuid() instead of GetGUID. It may work ;)

Hope this helps

Link to comment
Share on other sites

Forgive my ignorance over the relevance of the talent info. I guess management of talents is key to bots properly functioning in arenas and battlegrounds. I'm very much out of my depth with the details at present, but I hope to find time to get some experience in these areas myself. When I do, I'm sure this information will be very useful, so keep posting it and thanks

We were all WoW newbies at some point, so don't sweat a lack of knowledge - it can be gained easily enough.

Talents become more important for anything high-level. Not just for PvP, also PvE. With talents your spell rotation/queue becomes different. Some spells become stronger, or you get a new spell from a talent. It's not as important as good gear, but it's definitely up there come level 80.

For now, my main goal for talents in playerbot (beyond understanding and using them better) would be to have the bots acquire their talents (once levelled) according to a player-chosen talent spec. Once this is in place, it would provide most of the framework for any other talent things in playerbot (including stand-alone bots).

In any case, have fun getting "some experience" :)

Link to comment
Share on other sites

For now, my main goal for talents in playerbot (beyond understanding and using them better) would be to have the bots acquire their talents (once levelled) according to a player-chosen talent spec. Once this is in place, it would provide most of the framework for any other talent things in playerbot (including stand-alone bots).

The 'talent' command allows you to add bot talents as they level up and you can even get the bots to reset all their talents, if necessary (cost increasing each time it is done, for a particular bot). I added this to playerbot in reponse a request by someone who also going to develop the playerbot ai further. He then promptly disappeared :/ The code is in place and I'm sure it can be further adapted if required.

Hope this helps

Link to comment
Share on other sites

Hello

Been busy with RL.

Now had time to play. Fetched and compiled latest new-ai.

Got same type of server crash like in the coast of Westfall.

Now in the cave on the way to The Deadmines near Marisa du'paige.

Maybe bot tried to loot Living Flame <Defias Magician's Guardian> ?

Here few lines from the server log:

----

None (Guid: 0) is unsupported for looting.

19:51:18 Pet (Petnumber: 1 Guid: 1) is unsupported for looting.

Program received signal SIGSEGV, Segmentation fault.

[switching to Thread 0xa7573b70 (LWP 6206)]

0x0829200e in Loot::GetMaxSlotInLootFor(Player*) const ()

CRASH ON Wed Sep 7 19:51:42 EEST 2011

Using the running image of child Thread 0xa7573b70 (LWP 6206).

Program stopped at 0x829200e.

It stopped with signal SIGSEGV, Segmentation fault.

Type "info stack" or "info registers" for more information.

BACKTRACE

#0 0x0829200e in Loot::GetMaxSlotInLootFor(Player*) const ()

#1 0x084cf42f in PlayerbotAI::PickPocket(Unit*) ()

#2 0x0862fbc8 in PlayerbotRogueAI::DoNextCombatManeuver(Unit*) ()

#3 0x084e0078 in PlayerbotAI::DoNextCombatManeuver() ()

#4 0x084e10c6 in PlayerbotAI::UpdateAI(unsigned int) ()

#5 0x0830d375 in Player::Update(unsigned int, unsigned int) ()

#6 0x08286175 in Map::Update(unsigned int const&) ()

#7 0x0816279f in MapManager::Update(unsigned int) ()

#8 0x083793d4 in World::Update(unsigned int) ()

#9 0x081414bd in WorldRunnable::run() ()

#10 0x086760f2 in ACE_Based::Thread::ThreadTask(void*) ()

#11 0x00214325 in ACE_OS_Thread_Adapter::invoke (this=0xa7677040) at ../../ace/OS_Thread_Adapter.cpp:90

#12 0x001c8731 in ace_thread_adapter (args=0xa7677040) at ../../ace/Base_Thread_Adapter.cpp:124

#13 0x007b8e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0

#14 0x0089c73e in clone () from /lib/i386-linux-gnu/libc.so.6

BACKTRACE FULL

---

Best regards,

Akuba

PS. My configuration: Ubuntu 11.04 desktop 32bit running in VMware Player 3.1.4

Link to comment
Share on other sites

blueboy i'am sorry, I'm an ass. I spended yesterday to much time on this error, that i have seen things that aren't there. I realy thought i have seen playerbot. But now I read it again, I do not understand what I was thingking.

I think it's because I wanted to compile ahbot, playerbot and Armory and at the same time. Thought it would be possible. Anyway, thx for looking into it anyway

hey guys, i've got a error while compiling. someone got an idea how to solve this?

[  7%] Built target g3dlite
[  7%] Built target gsoap
[ 72%] Built target mangosscript
[ 72%] Built target framework
[ 76%] Built target shared
[ 76%] Built target realmd
[ 76%] Building CXX object src/game/CMakeFiles/game.dir/BattleGround.cpp.o
/home/marlon/mangos/src/game/BattleGround.cpp: In member function âvirtual void BattleGround::EndBattleGround(Team)â:
/home/marlon/mangos/src/game/BattleGround.cpp:757:126: error: âclass Playerâ has no member named âGetGUIDâ
make[2]: *** [src/game/CMakeFiles/game.dir/BattleGround.cpp.o] Fout 1
make[1]: *** [src/game/CMakeFiles/game.dir/all] Fout 2
make: *** [all] Fout 2

Your question is a little premature as playerbot does not yet have anything to do with battegrounds. :D However I took a look at BattleGround.cpp and I couldn't find a reference to 'GetGUID' in the function EndBattleGround(Team). I guess you are using other mods on your server that maybe changing the core code. Off the top of my head you might try changing the reference to the player, using GetObjectGuid() instead of GetGUID. It may work ;)

Hope this helps

Link to comment
Share on other sites

Hi Akuba,

Sorry my fault :( When I created the function PickPocket() for rogues, I didn't build in any event traps for invalid targets. A NULL pointer is being passed as a target to pickpocket.

None (Guid: 0) is unsupported for looting.

Then there is an attempt to loot an invalid creature and CRASH!

0x0829200e in Loot::GetMaxSlotInLootFor(Player*) const ()

On entry to the function I should have included a statement

if(!pTarget)

return false;

I have updated the new-ai branch and would be grateful if you could confirm that it stops the crash.

.. and thanks for drawing my attention to this error

Hope this helps

Link to comment
Share on other sites

I think it's because I wanted to compile ahbot, playerbot and Armory and at the same time. Thought it would be possible. Anyway, thx for looking into it anyway

AHBot has been integrated with the core, no need to patch it in anymore (doing so would probably explain your error). As for armory, I wasn't aware it needed to be patched into the core (thought it was 100% website) but it should play nice with playerbot.

BACKTRACE

#0 0x0829200e in Loot::GetMaxSlotInLootFor(Player*) const ()

#1 0x084cf42f in PlayerbotAI::PickPocket(Unit*) ()

#2 0x0862fbc8 in PlayerbotRogueAI::DoNextCombatManeuver(Unit*) ()

#3 0x084e0078 in PlayerbotAI::DoNextCombatManeuver() ()

#4 0x084e10c6 in PlayerbotAI::UpdateAI(unsigned int) ()

...

From the log it definitely looks like the rogue was trying to pickpocket a pet. [em]During combat[/em]. Did I read that right?

For now, my main goal for talents in playerbot (beyond understanding and using them better) would be to have the bots acquire their talents (once levelled) according to a player-chosen talent spec. Once this is in place, it would provide most of the framework for any other talent things in playerbot (including stand-alone bots).

The 'talent' command allows you to add bot talents as they level up and you can even get the bots to reset all their talents, if necessary (cost increasing each time it is done, for a particular bot). I added this to playerbot in reponse a request by someone who also going to develop the playerbot ai further. He then promptly disappeared :/ The code is in place and I'm sure it can be further adapted if required.

Hope this helps

Honestly I wasn't planning on doing much coding. My attention span is generally aroundabouts 3 months and I wanted to avoid helping out, quit midway, and end up doing more damage than good. Anyway, I'll take a closer look at the talent code you did a while ago, hopefully this weekend, and see if I can't whip you up a nice little patch.

Thanks for pointing me in the right direction. There is an awful lot of code to simply dive in.

Link to comment
Share on other sites

Hi Akuba,

Sorry my fault :( When I created the function PickPocket() for rogues, I didn't build in any event traps for invalid targets. A NULL pointer is being passed as a target to pickpocket.

None (Guid: 0) is unsupported for looting.

Then there is an attempt to loot an invalid creature and CRASH!

0x0829200e in Loot::GetMaxSlotInLootFor(Player*) const ()

On entry to the function I should have included a statement

if(!pTarget)

return false;

I have updated the new-ai branch and would be grateful if you could confirm that it stops the crash.

.. and thanks for drawing my attention to this error

Hope this helps

Hi

Still crashing on the coast of Westfall:(

---

20:10:01 Next game event check in 120 seconds.

Pet (Petnumber: 7 Guid: 7) is unsupported for looting.

Program received signal SIGSEGV, Segmentation fault.

[switching to Thread 0xa7873b70 (LWP 26666)]

BACKTRACE FULL

#0 0x0861152c in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*>, std::_Select1st<std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*> > >::_M_begin (this=0xf90) at /usr/include/c++/4.5/bits/stl_tree.h:488

No locals.

#1 0x08610335 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*>, std::_Select1st<std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*> > >::find (this=0xf90, __k=@0xa7872d98) at /usr/include/c++/4.5/bits/stl_tree.h:1532

__j = {_M_node = 0x0}

#2 0x0860f152 in std::map<unsigned int, std::vector<QuestItem, std::allocator<QuestItem> >*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<QuestItem, std::allocator<QuestItem> >*> > >::find (this=0xf90, __x=@0xa7872d98) at /usr/include/c++/4.5/bits/stl_map.h:712

No locals.

#3 0x0860b879 in Loot::GetMaxSlotInLootFor (this=0xf54, player=0xa49d0100) at /home/mangos/new-ai/src/game/LootMgr.cpp:727

itr = {_M_node = 0x0}

#4 0x087fea91 in PlayerbotAI::PickPocket (this=0xa581ca40, pTarget=0xa4734100) at /home/mangos/new-ai/src/game/playerbot/PlayerbotAI.cpp:3359

markGuid = {m_guid = 17383894561767555079}

c = 0x0

loot = 0xf54

looted = false

lootNum = 7846284

#5 0x088db2fe in PlayerbotRogueAI::DoNextCombatManeuver (this=0xa49ae900, pTarget=0xa4734100) at /home/mangos/new-ai/src/game/playerbot/PlayerbotRogueAI.cpp:159

ai = 0xa581ca40

m_bot = 0xa49d0100

fTargetDist = 4.9416151

pVictim = 0x0

out = <incomplete type>

#6 0x087f9e4b in PlayerbotAI::DoNextCombatManeuver (this=0xa581ca40) at /home/mangos/new-ai/src/game/playerbot/PlayerbotAI.cpp:1879

No locals.

#7 0x087fd2d9 in PlayerbotAI::UpdateAI (this=0xa581ca40) at /home/mangos/new-ai/src/game/playerbot/PlayerbotAI.cpp:2889

pSpell = 0x0

currentTime = 1315501890

#8 0x0861ea30 in Player::Update (this=0xa49d0100, update_diff=100, p_time=100) at /home/mangos/new-ai/src/game/Player.cpp:1475

---

Link to comment
Share on other sites

Hi Akuba,

As I have pointed out in your message on PM, your not actually using the code on new-ai, but the code on portal master. If you clone the portal repository, you need to switch to the new-ai branch

git checkout new-ai

You can then build your server and enjoy the changes on new-ai

Hope this helps

Link to comment
Share on other sites

I'm somewhat confused with which branch in Portal to use. Is new-ai the same as portal master, except for the bot AI development? Also, if I wish to use sharedbots, do I need to merge it with new-ai or is it necessary to merge master, new-ai, and sharedbots together to have all the latest development work in one package?

Link to comment
Share on other sites

Hi,

new-ai is an 'alpha' branch off portal master, they are not the same. The code in new-ai contains all code from master, plus recent development work and fixes.

EDIT: Sorry, yes thats what you said. It's been a long day...

new-ai does not contain sharedbots code. To use all the code, it is only necessary to merge new-ai and sharedbots.

I like to build from a clean download of the latest core. I then apply standalone patches.

1) new-ai.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 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1`

git diff $HASH > new-ai.patch

and then

2) sharedbots.patch

#!/bin/bash -x

git clone git://github.com/blueboy/portal.git sharedbots

cd sharedbots

git fetch git://github.com/blueboy/portal.git sharedbots:sharedbots

git checkout sharedbots

HASH=`git log --pretty=oneline | grep -m 1 'Merge branch' | cut -d " " -f 1`

git diff $HASH > sharedbots.patch

hope this helps

Link to comment
Share on other sites

1) new-ai.patch

...

2) sharedbots.patch

#!/bin/bash -x

git clone git://github.com/blueboy/portal.git sharedbots

cd sharedbots

git fetch git://github.com/blueboy/portal.git sharedbots:sharedbots

git checkout sharedbots

HASH=`git log --pretty=oneline | grep -m 1 'Merge branch' | cut -d " " -f 1`

git diff $HASH > sharedbots.patch

That's what I based my procedures off of (thanks much) but the HASH line gave me errors on windows. Instead, I adapted it to:

HASH=`git log --pretty=oneline | grep '\\[1[0-9]\\{4\\}]' | head -n 1 | cut -d " " -f 1`

Don't ask me why or how (especially since I did that 4 months ago) - google is your friend :) It does the job though, and does it well.

Link to comment
Share on other sites

but the HASH line gave me errors on windows

Pound to a penny, the complaint was that grep utility didn't understand what the '-m' option was. If this is the case, then you need too update the version of grep.exe in your windows bash shell. This is a very old error and I don't know why they haven't updated these shells yet to contain the newer version of grep. I did it manually myself by finding a suitable replacement on the internet and then overwriting the file locally.

To check your version

grep -V

and you should have 2.5.4 or greater. If not, this would account for your error

Hope this helps

Link to comment
Share on other sites

can som1 plz help me with this .. i really dont know how to make a core with bots.......

can i git clone mangos then merge with new-ai branch then compile willl that work?if som1 have time plz make a fast mini tutorial how to have latest core with new-ai branch ...

thx alot and sorry for my english.... and blueboy you are doing awsome job: P

Link to comment
Share on other sites

Hello blueboy

I followed your advice you gave to Flameburst.

Here my result on Ubuntu 11.04 desktop, git version 1.7.4.1 and "default" git config:

---------------

git config --list

[email protected]

user.name=xxxxxxxx

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

remote.origin.url=git://github.com/mangos/mangos.git

branch.master.remote=origin

branch.master.merge=refs/heads/master

----------------

Script:

#!/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 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1`

git diff $HASH > new-ai.patch

git checkout master

git apply --check --whitespace=fix new-ai.patch

Git apply --check gave error

new-ai.patch:4598: trailing whitespace.

so I edited line 4598 in new-ai.patch and removed extra tab.

After that patch didn't gave any errors :)

Akuba

Link to comment
Share on other sites

hello... i did follow this step and compile mangos with no errors that nice...but problem is when i wanna create any characther my mangos just crash..any solution?

mkdir mangos // create a directory, call it anything you want.

cd mangos

git init // create an empty local git repositoty

git pull http://github.com/blueboy/portal.git new-ai:master

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