Jump to content

Playerbot


Recommended Posts

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Hi Akuba & Flameburst,

Can you both describe your systems please (hardware, os and which mods your using), also providing more information on the errors your getting.

Cheers

Hi

I don't have Flameburst's problem.

Only "problem" now is MoveMapGen from mmaps. Generating *.mmaps and *.mmtiles takes so long time.

But my system:

Windows 7 Ultima 64bit. 8 gig mem (WMware Player 3.1.4 (Ubuntu 11.04 workstation (Mangos with Playerbot new-ai and soon mmaps_rewrite)))

Akuba

Link to comment
Share on other sites

Only "problem" now is MoveMapGen from mmaps. Generating *.mmaps and *.mmtiles takes so long time.

That's the only annoying problem with MoveMapGen. They have certainly improved the extraction time from what it was originally. I remember it used to take about two days on the box I was running at the time. On the dual xeon workstation I have now, it still takes over twelve hours but it's much better. It's good that your having a go at preparing a clean patch for movement maps yourself. If you have any problems, let me know. Remember that you'll have to apply the patches in a strict order. I like to apply movement maps first as it will eventually be part of the core. The playerbot patch will need to be adapted to apply after movement maps (few small changes to Chat.cpp Chat.h and the VC100 source)

Hope this helps

Link to comment
Share on other sites

Only "problem" now is MoveMapGen from mmaps. Generating *.mmaps and *.mmtiles takes so long time.

That's the only annoying problem with MoveMapGen. They have certainly improved the extraction time from what it was originally. I remember it used to take about two days on the box I was running at the time. On the dual xeon workstation I have now, it still takes over twelve hours but it's much better. It's good that your having a go at preparing a clean patch for movement maps yourself. If you have any problems, let me know. Remember that you'll have to apply the patches in a strict order. I like to apply movement maps first as it will eventually be part of the core. The playerbot patch will need to be adapted to apply after movement maps (few small changes to Chat.cpp Chat.h and the VC100 source)

Hope this helps

Heh...I applied playerbot first and then mmaps :D

Didn't see any errors regarding Chat.* or the VC100 source iirc.

Akuba

Link to comment
Share on other sites

Hi X-Savior & marx123

What playerbot code do you want to try?

release code (master) most stable code

https://github.com/playerbot/mangos

https://github.com/blueboy/mangos

beta code for test (master) stable test code

https://github.com/blueboy/portal

alpha code for development (alpha branches) code in development

As far as I'm aware, all code will work with the latest MaNGOS code [11792] (Please let me know if this is not so). If you wiish to try out the latest code changes to playerbot, then I recommend you primarily use the new-ai alpha branch code (this contains all playerbot code, except that from sharedbots). The standard playerbot code allows you to summon/dismiss upto 9 bots from a single account. The sharedbots code (in development) enhances the playerbot code , allowing you to summon/dismiss bots (marked as "shared", see bot_readme.txt for sharedbots code) from several accounts.

Hope this helps

Link to comment
Share on other sites

I would like to try the stable master code. your repo is not up to date with Mangos so I was curious if there was a patch that I can apply to current mangos or if you were going to update your repo so I can compile it and replace my current mangos files to test your playerbot (then if I need to revert I just re-compile original mangos) cause both will be same version.

UDB 402 is for Mangos 11792 so it is difficult to use any mangos version less then this.

Link to comment
Share on other sites

I would like to try the stable master code. your repo is not up to date with Mangos so I was curious if there was a patch that I can apply to current mangos or if you were going to update your repo so I can compile it and replace my current mangos files to test your playerbot (then if I need to revert I just re-compile original mangos) cause both will be same version.

UDB 402 is for Mangos 11792 so it is difficult to use any mangos version less then this.

O.K I've just updated the two stable master code repos (blueboy/mangos & playerbot/mangos) with the lastest core. The code in these two repos is identical and it compiles and runs without issue.

Please note that the code in these to repos does not contain any of the recent improvements reported on the playerbot thread. If you want to test out these improvements, I suggest you use the code on the new-ai alpha branch. Don't worry all our code is stable, the only distinction between our stable release code and the development/test code is that the former is proven.

Your feedback on the code would be welcomed.

Hope this helps

Link to comment
Share on other sites

grep -V

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

You are correct, I have 2.4.2. Since my replacement line works, I'm not really bothered by it; In fact I'd rather keep it this way so any future installations will 'just work' rather than having to remember I updated grep.

Anyway I've done some work on talents in playerbot. I'll make you a .patch file once I get something more complete, but I wanted to get your thoughts on this first. I needed a readable way to get a variable number of talent specs into the config file. Readable of course meant multi-line, but none of the config files had that yet. Will this work? Or is there a better way to do it?

// to be added at the end of the playerbot config file. Data shortened to prettily fit in a quote.

###################################################################################################################

# PLAYERBOTAI TALENT / GLYPH SPECS

#

# Note: adding or removing talent specs does not require a ConfVersion change, unless something structural

# changes

#

# Builds: "Build Name;Class Name;Purpose;Talent1,Talent2,...;MajorGlyph1,2,3,MinorGlyph1,2,3"

# Multiple Builds: Seperate using a new line. All talent specs should be held within a single pair of

# double quotes '"'.

# Invalid builds will simply be ignored. If yours isn't showing up, this is (most likely) why.

# Build Name: Any string of text NOT containing colon ',' semicolon ';' double quote '"' or new lines.

# Class Name: "DEATHKNIGHT", "DRUID", "HUNTER", "MAGE", "PALADIN", "PRIEST", "ROGUE", "SHAMAN", "WARLOCK",

# "WARRIOR", or "PET"

# Purpose(s): "PVE_TANK", "PVE_DPS", "PVE_LEVELING", "PVE_HEALING", "PVE_INSTANCING", "PVE_RAID",

# "PVP_TANK", "PVP_DPS", "PVP_LEVELING", "PVP_TWINK", "PVP_HEALING", "PVP_ARENA"

# TalentN: The talents to be used, in order. May be talent name (exact, no rank) or talent ID. For WotLK

# servers with normal rules this should be 1-71 talents long.

# MajorGlyph1,2,3,MinorGlyph1,2,3: 0-3 major glyphs followed by 0-3 minor glyphs. Regardless of whether

# you want 0 or 6 glyphs, there should always be 5 commas ',' in this section

#

###################################################################################################################

PlayerbotAI.TalentSpecs = "

Death Knight Fast Leveling (54/17/0);DEATHKNIGHT;PVE_LEVELING,PVE_DPS;1939,1939,1945,...,1938;Major Glyph of Death and Decay,...,...,...,...,Minor Glyph of Raise Dead

Paladin Protection Tank (0/53/18);PALADIN;PVE_TANK,PVE_INSTANCING;2185,2185,2185,...,1755;Major Glyph of Divine Plea,...,...,...,...,Minor Glyph of Sense Undead

Paladin Holy SpellPower Focus (51,20,0);PALADIN;PVE_HEALING,PVE_INSTANCING;1432,1432,1432,...,2281;Major Glyph of Holy Light,...,...,...,...,Minor Glyph of Blessing of Wisdom

Paladin Fast Leveling (0/10/61);PALADIN;PVE_LEVELING,PVE_DPS;1407,1407,1407,...,1748;Major Glyph of Judgement,...,...,...,...,Minor Glyph of Sense Undead

"

I also noticed something strange when I was hunting for talent code:

In PlayerbotAI.h, looking at enum TaskFlags (+/- line 144), the flags are not combinable: SELL_ITEMS 0x01 + BANK_WITHDRAW 0x11 = BANK_DEPOSIT 0x12

If they are meant to be combinable, 0x0B, 0xB0 - if not, simply run up ..., 0x02, 0x03, 0x04, 0x05, ... Since there's 9 options + the reset, you'll just need to use a short if you want combinable flags.

Off to code some more... Zug zug.

Link to comment
Share on other sites

Hmm,

Let's give it a try. I often find that once I've written code, I then find a better way to achieve the same result.

The beauty of using the 'alpha branches' as workareas for development is that it doesn't interfere with the main code. If an idea doesn't work, it's no biggy, but it gives others the opportunity to try the code out and provide constructive feedback. If we create a new alpha branch off the portal repo, we can explore different ways to manage character attributes,

  • 1) Maybe adapt the existing 'co' (combatorder) command that utilizes bitwise addition to maintain both primary and secondary orders for each character. You could instead assign

.bot co <paladin> PVE_DPS

.bot co <paladin> PVE_LEVELLING

we could compare the actual talents and gylph abilities for each character, with the talent specs you propose and hightlight available ones in green and those needed in red

/t <paladin> orders

<paladin> Whispers: I PVE_DPS with PVE_LEVELLING

with talents: [talent 1][talent 2][talent 3]...

with glyphs: [glyph 1][glyph 2]...

The talents and glyphs could then be maintained for each character, using the 'talent' command.

  • 2) Possibly utilizing database I/O to maintain character attributes between server restarts.

  • 3) Your suggestion to use the config file (only configurable by server admins) to set default talent spec attributes. Interesting idea that I'm sure we could get functional. Are these talent specs meant to be templates for users to use on their characters, or only guidelines to follow?

Yes, It was never my intention to use bitwise addition with the TaskFlags, as I can't see a situation where it would be necessary to perform multiple tasks on the same item at once. I have taken a closer look at the TaskFlags enum values and they are fine for the purpose (i.e unique). But I do agree that numbering them 0x02,0x03,0x04,0x05 ...etc would more effective, so I'll probably change these next time I push code.

enum TaskFlags

{ // hex bin

NONE = 0x00, // do nothing 0

SELL = 0x01, // sell items 1

REPAIR = 0x02, // repair items 10

ADD = 0x04, // add auction 100

REMOVE = 0x08, // remove auction 1000

RESET = 0x10, // reset all talents 10000

WITHDRAW = 0x11, // withdraw item from bank 10001

DEPOSIT = 0x12, // deposit item in bank 10010

LIST = 0x14, // list quests 10100

END = 0x18, // turn in quests 11000

TAKE = 0x20 // take quest 100000

};

have fun coding and I'll speak with you soon, Cheers

Link to comment
Share on other sites

Well, quite a few ideas, but I was actually specifically asking if that config file would load. Whether it would ignore the newlines and keep loading the string until the second double quotes '"' had been reached. But as I realised last night, that's something I can look up myself. <edit> Actually, I did look it up, got to Configuration.cpp line 1933ish, couldn't decrypt what was there. Will just cross my fingers and try it instead. </edit>

  • 2) Possibly utilizing database I/O to maintain character attributes between server restarts.

In these cases I tend to prefer to shy away from database changes. If you were to add a seperate table instead of modifying an existing one, that would minimize the impact. Of course it would mean yet more .sql files ;)

  • 3) Your suggestion to use the config file (only configurable by server admins) to set default talent spec attributes. Interesting idea that I'm sure we could get functional. Are these talent specs meant to be templates for users to use on their characters, or only guidelines to follow?

Correct, so far I've been looking at it solely from a server admin's perspective. Then again, the config file is a very simple way of adding things. Having a user enter 71 talents + 6 glyphs (can you imagine how many lines would be typed? far more than one, for sure) is... Frankly, a bit mind-staggering. I was and still am planning on ignoring the end-user. WoW is pretty much a game where there is a 'best spec' for every class+purpose combination. If I do my job right and/or get enough help, 95% of the players would be satisfied with the build for their own characters, let alone characters they aren't personally playing. The rest will have to make do with a simple "learn talent X" command. Times 71. Per bot. If you disagree... wait a few weeks for my patch and improve on it :P

As for how to use a talent spec... I was thinking of keeping it simple. A step-up scheme (like a pyramid - every step eliminates a few choices):

.bot <paladin_char> talent spec

1. Paladin Protection Tank (0/53/18);PVE_TANK,PVE_INSTANCING

2. Paladin Holy SpellPower Focus (51,20,0);PVE_HEALING,PVE_INSTANCING

3. Paladin Fast Leveling (0/10/61);PVE_LEVELING,PVE_DPS

.bot <paladin_char> talent spec PVE_INSTANCING

1. Paladin Protection Tank (0/53/18);PVE_TANK,PVE_INSTANCING

2. Paladin Holy SpellPower Focus (51,20,0);PVE_HEALING,PVE_INSTANCING

.bot <paladin_char> talent spec PVE_INSTANCING,PVE_HEALING

2. Paladin Holy SpellPower Focus (51,20,0);PVE_HEALING,PVE_INSTANCING

.bot <paladin_char> talent spec use 2

Applying talents using: 2. Paladin Holy SpellPower Focus (51,20,0);PVE_HEALING,PVE_INSTANCING

For a simple example. Can be refined later on using user feedback but that will probably also be the fastest and simplest way to get a working proof of concept. First next thing would probably be to issue a warning if wrong talents and/or out-of-order talents are already learnt along with a reset talents command/link.

Yes, It was never my intention to use bitwise addition with the TaskFlags, as I can't see a situation where it would be necessary to perform multiple tasks on the same item at once. I have taken a closer look at the TaskFlags enum values and they are fine for the purpose (i.e unique). But I do agree that numbering them 0x02,0x03,0x04,0x05 ...etc would more effective, so I'll probably change these next time I push code.

enum TaskFlags

{ // hex bin

NONE = 0x00, // do nothing 0

SELL = 0x01, // sell items 1

REPAIR = 0x02, // repair items 10

ADD = 0x04, // add auction 100

REMOVE = 0x08, // remove auction 1000

RESET = 0x10, // reset all talents 10000

WITHDRAW = 0x11, // withdraw item from bank 10001

DEPOSIT = 0x12, // deposit item in bank 10010

LIST = 0x14, // list quests 10100

END = 0x18, // turn in quests 11000

TAKE = 0x20 // take quest 100000

};

have fun coding and I'll speak with you soon, Cheers

I think I've actually modified those to be a bit clearer. Guess it's a race to see who gets their patch done first. Safe bet's on you ;)

You've given me a lot to think about but I think I'll just go ahead on my path and adapt once it's 'finished'. Until you see the patch I'm just a meatbag filled with air.

Link to comment
Share on other sites

I'm somewhat close to having a patch ready - except I don't know how to create it.

I know how to make a local copy (aka download everything):

git clone git://github.com/blueboy/portal.git -b new-ai playerbot

and I know how to make a patch file from a github source to patch into a local copy:

//inside a local copy's directory

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

git checkout portal

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

git diff $HASH > playerbot.patch

Of course this is the other way around; Every + should be a - and vice versa.

What I don't know is how to make a patch file from a local copy (for someone else) to patch into a github destination. I did a few searches but it looks like I won't figure it out without a lot of research. Any chance someone could sum it up?

Link to comment
Share on other sites

Haha, big step from my initial intentions. I'm telling you up front chances are between here and a few months I'll lose the willpower and motivation to work on this. If that's fine with you, my github username is the same. <edit> I guess you already found it, thanks for the invite. </edit>

Thanks for the link. I've gone over the entire thread but back then I must've thought "interesting... but it's not like I'll ever be a developer".

The patch is 'huge' (note to self: define huge - too big for a forum post at least). Though most of it are enums of the various class and pet talents. The problem is there's a few things my rusty C++ can't seem to iron out <just yet>, and even if new-ai is an alpha branch the code should at least compile.

While I've got your attention, have you got some sort of "onLevel" handling yet? I did a search in the playerbot code and a quick one in player.cpp. If there's none in Playerbot I'll implement a hook, but if you've done it already and I looked over it I'd appreciate if you could point it out for me.

(Put simply, yes I'm lazy but this is about you telling me in 5 minutes what I'd look for for 2 hours - not about you looking for it for 2 hours instead of me).

Also, you may want to think about adding some basic Git commands to your first post. It's a question I've seen come up time and again, and you shouldn't have to repeat yourself. A few basic commands:

  • Full download of playerbot code
    // download the entire playerbot code into a folder 'playerbot', optionally using the 'new-ai' branch
    // recommended if you want an easy copy of playerbot and the mangos version doesn't necessarily have to be the latest
    git clone git://github.com/blueboy/portal.git [-b new-ai] playerbot


  • creating a patch (show example with playerbot code, including git clone of mangos core)
  • creating a local patch with local playerbot and local/web core/playerbot (see post 101)
  • maybe even a developers crash course... although that might confuse people who aren't developers

And with that an explanation of the differences between the branches.

The first post also mentions a wiki of sorts "which may be out of date". Link it as well?

Link to comment
Share on other sites

Hi Kennumen,

I have now added you to our collaborators list :)

I suggest you create a new branch for your work. Call it anything you want, but keep the name short. For illustration purposes I will use the name 'pvp-ai'.

1. You want to use a suitable code base for your work. I recommend you start by cloning the portal master to your harddrive.

2. Then create the remote branch off portal master

cd pvp-ai

git push origin origin:refs/heads/pvp-ai

3. Now lets track your work. This will allow you to push/pull commits directly to/from your branch 'pvp-ai'. The following (checkout -b) creates and switches to a local branch called 'pvp-ai'. It also sets up tracking (--track) to the remote branch 'origin/pvp-ai'

git checkout --track -b pvp-ai origin/pvp-ai

To view all accessible branches, local & remote

git branch -a

4. To merge the contents of another branch into your branch (e.g new-ai). First, do the merge locally from within pvp-ai and then push to your remote branch.

git merge origin/new-ai

git push

I think this will be enough information to get you started.

Hope this helps

Link to comment
Share on other sites

Haha, big step from my initial intentions. I'm telling you up front chances are between here and a few months I'll lose the willpower and motivation to work on this. If that's fine with you, my github username is the same. <edit> I guess you already found it, thanks for the invite.

We're very relaxed at playerbot :cool: , you contribute only when you wish

While I've got your attention, have you got some sort of "onLevel" handling yet? I did a search in the playerbot code and a quick one in player.cpp. If there's none in Playerbot I'll implement a hook, but if you've done it already and I looked over it I'd appreciate if you could point it out for me.

"onLevel" handling, in what context? Do you want code to handle a "levelup" (client/server) event or a level restriction event? Either way, I don't believe there is anything in playerbot yet.

Your absolutely right about updating the first post with some simple instructions. I'll sort that out, Cheers

Link to comment
Share on other sites

Okay, I've made some headway. All the errors are gone (yay me), the code compiles (even in debug), it runs fine, I've turned on the debug file logging, and the commands... They don't do as expected but they also don't crash the server (which is sort of a win already).

When using the command "talent spec" on a bot, the following debug comes out:

2011-09-21 20:48:02 [PlayerbotMgr]: configSpecs string loaded -

2011-09-21 20:48:02 ERROR:There are no talent specs (at all) in the config file.

The only place that logging could come from is the PlayerbotMgr constructor, where I've placed:

m_confCollectObjects = botConfig.GetBoolDefault("PlayerbotAI.Collect.Objects", true);

// Load string in the form of "\\nSpec\\nSpec\\nSpec\\n"

std::string configSpecs = botConfig.GetStringDefault("PlayerbotAI.TalentSpecs","");

DEBUG_LOG ("[PlayerbotMgr]: configSpecs string loaded - %s", configSpecs.c_str());

if(configSpecs == "")

{

sLog.outError("There are no talent specs (at all) in the config file.");

}

else

Playerbot.conf, on the other hand, contains (an unshortened version of):

PlayerbotAI.TalentSpecs = "

Death Knight Fast Leveling (54/17/0);DEATHKNIGHT;PVE_LEVELING,PVE_DPS;1939,1939,1945,...,1938;Major Glyph of Death and Decay,Major,Major,Minor,Minor,Minor

Death Knight PvP (50/3/18);DEATHKNIGHT;PVP_DPS,PVP_ARENA,PVP_LEVELING;1939,1939,1945,...,2004;Major Glyph of Heart Strike,Major,Major,Minor,Minor,Minor

Paladin Protection Tank (0/53/18);PALADIN;PVE_TANK,PVE_INSTANCING;2185,2185,2185,...,1755;Major Glyph of Divine Plea,Major,Major,Minor,Minor,Minor

"

Best guess, the config loading code sees the double quote, assumes text, sees a newline, ends input, ignores the lines below - it does not process until the double quotes are closed as I'd hoped. Would you agree with that assessment?

If so, I either need some other form of input or I simply scrunch the PlayerbotAI.TalentSpecs data onto one line (which would wreak havoc on maintenance - and possibly text editors. That would seriously be one looong line). If so I'd probably use yet another seperator such as |. Any suggestions on how to best input this data? ... There are a finite amount of 'good' talent specs, perhaps I should just hard-code them? I dunno. Time to sleep on it.

Link to comment
Share on other sites

Hi,

Yes, the 'configSpecs' is more like a 'blob' of data, than a string. The newline character would certainly cause problems. I tried putting a newline character inside the existing playerbot config option

PlayerbotAI.BotguyQuests = "

805,383,2160,54,8350,9313,1656,2159"

std::string reqQuestIds = botConfig.GetStringDefault("PlayerbotAI.BotguyQuests","");

and the server refused to load playerbot.conf at all, as the world daemon starts.

Playerbot: Unable to open configuration file. Database will be unaccessible. Configuration values will use default.

Playerbot: Configuration file version doesn't match expected version. Some config variables may be wrong or missing.

It might be better to load the 'configSpec' as a data blob from a custom database table. You might also try breaking up the blob into smaller quantities, with a less complex data structure. I'm not sure what the maximum character size is for std::string variables. If you can publish your work, we might be able to come up with something together.

How about this;

PlayerbotAI.TalentSpecs.FastLeveling = "(54/17/0);DEATHKNIGHT;PVE_LEVELING,PVE_DPS;1939,1939,1945,...,1938;Major Glyph of Death and Decay,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs.PvP = "(50/3/18);DEATHKNIGHT;PVP_DPS,PVP_ARENA,PVP_LEVELING;1939,1939,1945,...,2004;Major Glyph of Heart Strike,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs.ProtectionTank = "(0/53/18);PALADIN;PVE_TANK,PVE_INSTANCING;2185,2185,2185,...,1755;Major Glyph of Divine Plea,Major,Major,Minor,Minor,Minor"

Each TalentSpec will fit on one line and should load without error.

Hope this helps

Link to comment
Share on other sites

When pulling mobs with my priest, I would like to command bots to be passive and only

start to attack when I command them to do so. Now they start to attack as soon I have

aggroed a mob.

First create two macros

1) priest attack

/w <botname> attack

2) party attack

/p attack

First send in the priest to pull the mob. The party will remain close to the player, and will only react if the player is threatened. Then, command the party to attack, once the priest has the mobs attention.

Hope this helps

Link to comment
Share on other sites

When pulling mobs with my priest, I would like to command bots to be passive and only

start to attack when I command them to do so. Now they start to attack as soon I have

aggroed a mob.

First create two macros

1) priest attack

/w <botname> attack

2) party attack

/p attack

First send in the priest to pull the mob. The party will remain close to the player, and will only react if the player is threatened. Then, command the party to attack, once the priest has the mobs attention.

Hope this helps

Hi

That helped pulling but "passive" command would be handy. For example you can't command

bots away from target dummies if you have started training.

One bot keeps spamming every sec :DImage linkhttp://i52.tinypic.com/nx5f08.jpg[/img]

Best regards,

Akuba

Link to comment
Share on other sites

Hi Akuba,

For example you can't command bots away from target dummies if you have started training.

I know exactly what you mean. I use the ytdb database and the training dummies are a bit proactive. I think the best way for the bots to avoid being followed is to create a command that teleports the bots away from the threat. They will then automatically teleport back to the master. Behaviour similar to using the Hearthstone. In the client chat window,

/p use [Hearthstone]

They will teleport to their respective homes and then immediately teleport back to the master's location. The only problem with using this is that it is subject to a cooldown period, before you can re-use it. Leave it with me and I'll come up with something.

One bot keeps spamming every sec

This suggest that something is continually sending an 'inspect' request to the bot. Are you using any addons that have party chat. I know 'QuestHelper' does. Either disable party chat or disable the addon.

Hope this helps

Link to comment
Share on other sites

Correct, the entire config file failed loading. I missed that...

It might be better to load the 'configSpec' as a data blob from a custom database table. You might also try breaking up the blob into smaller quantities, with a less complex data structure. I'm not sure what the maximum character size is for std::string variables. If you can publish your work, we might be able to come up with something together.

I like the database table. It seems by far the cleanest and most extensible way. But not as a blob. If you're going to have a custom table, might as well do it right (see my blueprintbelow).

How about this;

PlayerbotAI.TalentSpecs.FastLeveling = "(54/17/0);DEATHKNIGHT;PVE_LEVELING,PVE_DPS;1939,1939,1945,...,1938;Major Glyph of Death and Decay,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs.PvP = "(50/3/18);DEATHKNIGHT;PVP_DPS,PVP_ARENA,PVP_LEVELING;1939,1939,1945,...,2004;Major Glyph of Heart Strike,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs.ProtectionTank = "(0/53/18);PALADIN;PVE_TANK,PVE_INSTANCING;2185,2185,2185,...,1755;Major Glyph of Divine Plea,Major,Major,Minor,Minor,Minor"

Each TalentSpec will fit on one line and should load without error.

True, it will work just fine. But in essence it's the same as hard-coding: for each seperate config file variable you need matching playerbot code to load it. This essentially defeats the purpose of having it in the config at all.

You could take your idea, and do something like:

PlayerbotAI.TalentSpecs[0] = "(54/17/0);DEATHKNIGHT;PVE_LEVELING,PVE_DPS;1939,1939,1945,...,1938;Major Glyph of Death and Decay,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs[1] = "(50/3/18);DEATHKNIGHT;PVP_DPS,PVP_ARENA,PVP_LEVELING;1939,1939,1945,...,2004;Major Glyph of Heart Strike,Major,Major,Minor,Minor,Minor"

PlayerbotAI.TalentSpecs[2] = "(0/53/18);PALADIN;PVE_TANK,PVE_INSTANCING;2185,2185,2185,...,1755;Major Glyph of Divine Plea,Major,Major,Minor,Minor,Minor"

It should be possible this way to load a variable number of talent specs. However it's hard to maintain and very prone to human error. What if you've got 30 specs and you want to remove #8? You would need a manual counter as well (of how many specs there are) which again very prone to human error. It's certainly possible but this just makes a database table look that much better.

Suggestion (I invite you to comment on this):

Name - Varchar (255) - text, up to 255 characters including string zero terminator (as I recall). No plans to support localization (except enUS).

Class - tinyint (signed) - 1->127 for actual classes as per "enum Classes" in SharedDefines.h; -1-> -3 for pets (cunning, ferocity, tenacity); 0 errors out.

Purpose - either INT (unsigned), severely limiting additions/removals of the purpose types, or a Varchar(255) to fit the text version. Still very undecided on this. INT is clean, fast, obviously great... IF you never ever ever intend on adding more than 10 PVE or PVP purposes. ... Although in that case just split it into a PVE and PVP int, problem solved. So I vote INT, but welcome your opinion. See my current TalentSpecPurpose enum below.

Talents - 71x SMALLINT (unsigned: 0-65535) - you lose support for servers with more than 71 talents. But a blob is just slow and... dirty. I suppose if someone asks it should be possible to have a variable amount of talents in the table.

Glyphs - 6x SMALLINT (unsigned)- no question as far as I'm concerned. Quick, sleek, ...

enum TalentSpecPurpose

{

TSP_NONE = 0x00000000, // should probably error out?

TSP_PVE_TANK = 0x00000001,

TSP_PVE_DPS = 0x00000002,

TSP_PVE_LEVELING = 0x00000004,

TSP_PVE_HEALING = 0x00000008,

TSP_PVE_INSTANCING = 0x00000010,

TSP_PVE_RAID = 0x00000020,

TSP_PVE_ALL = 0x0000FFFF, // Highly recommend AGAINST using this

TSP_PVP_TANK = 0x00010000,

TSP_PVP_DPS = 0x00020000,

TSP_PVP_LEVELING = 0x00040000,

TSP_PVP_TWINK = 0x00080000,

TSP_PVP_HEALING = 0x00100000,

TSP_PVP_ARENA = 0x00200000,

TSP_PVP_ALL = 0xFFFF0000 // Highly recommend AGAINST using this

};

Hope this helps

Good advice always does, so keep it coming.

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