Pet Battle Recorder Addon

Discuss your favorite pet addons and macros.
Post Reply
User avatar
Gráinne
Posts:957
Joined:July 7th, 2015
Pet Score:13747
Realm:Magtheridon-eu
Contact:
Pet Battle Recorder Addon

Post by Gráinne » August 1st, 2017, 11:17 am

I want an addon. I'm even willing to write it myself.

I've even started to hack a kludge together, that kind of works well enough for myself, if I squint a bit and look to one side.

But I'm not yet sure where I want to take it. Here's the story.

Back in Warlords, trying to distract myself from the awfulness of the second 500 battles for Trainer, I started recording what teams I faced, and the result, by the high-tech mechanism of a pen and a pad of paper beside me. I transcribed these into a spreadsheet and turned them into a set of counts that I posted for information.

I got the idea from Discodoggy, who had already recorded and published stats for teams he had faced.

I now wish I had recorded which teams I used.

1. So I would like an addon that records this. What I used. What I faced. Result.

2. I would also like to record the log of the battle. None of us do this at the moment, AFAIK, and while I don't imagine I'd analyse every battle, I wouldn't mind having them all available just in case. Not only for PvP, but possibly for analysing PvE strats, 'cos I'm the kind of compulsive who could get caught up in that occasionally.

So those are two possible functions.

1. Recording Teams

I started by hacking an abandoned addon BattleDex, to see how feasible it looked. The battle recording is at least possible. There are a few corners I'd have to work around - for example, I can't directly ask the game for breeds; I'd have to label the breeds myself from the stats, if I want to do it. Stuff like that,

Storing the information in a Lua database is one thing; displaying it in a useful form is another. I thought I would just want to grab it into a spreadsheet. But then I started wondering: is there any value in having the information available in game? If I don't have a use for that, would somebody else think of one?

2. Recording battles

I don't know how to do this at the moment, but if I do find a way, how to format it in such a way that it would be useful (for what?)

I'm just throwing this out there in case anyone else ever wanted something like this and has ideas about what a final version should look like. I'm used to making do with half-kludged code for myself, and if nobody else is interested, that's what I'll probably do in this case.

But if there's someone who can bring this into focus, I'd love to hear your ideas.

User avatar
Drlambda
Posts:64
Joined:May 8th, 2016
Pet Score:5543
Realm:Arthas-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Drlambda » August 1st, 2017, 1:15 pm

I made a similar suggestion in the Rematch thread, you might want to check it. Gello is considering the possibility of creating an API for Rematch 5.0 that will allow us to write a plugin like that within the Rematch framework, so we would be able to focus on the important parts.

Rather than collecting team data, i'd like "pets i played against" data. Something like "I played against teams containing Bone Serpent X times. Y% of all teams contain Bone Serpent. I won against teams containing Bone Serpent Z times and lost A times, for a win percentage of B%." And then have that as a sheet so you can get a meta snapshot and also see how well you do against the meta, and which pets you do bad against.
CloseToZero - Watch me lose on youtube with bad pets! :D

User avatar
Paladance
Posts:1010
Joined:July 18th, 2015
Pet Score:12412
Realm:Burning Legion-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Paladance » August 2nd, 2017, 12:33 am

PetTracker has a simplified history of teams, and as far as I've noticed, if the pet involved is missing in the journal, it can't refer to it anymore, even if you have duplicates -- so I guess it's quite thorough about this.
Image

I have compiled community knowledge & data about pet battle abilities!
https://www.warcraftpets.com/community/forum/viewtopic.php?f=3&t=19507

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Pet Battle Recorder Addon

Post by Gello » August 2nd, 2017, 12:45 am

Yeah PetTracker has something like this though I haven't played around with it. You should check it out Gráinne if you haven't yet.

To temper expectations on the rematch extra tabs, the extent of the API would be to provide a space within the addon for other addons to do their thing. Register a tab and a frame to display in the tab and then the separate addon would handle everything in its own frame on its own; integrated into rematch via its tabbed view but operating independently.

If you need help getting your addon going, Gráinne, let me know. I suspect the hard part will be detailing exactly how it'd work/behave. For my own distant plans (as in, I'd be relieved if someone else did it to save me the effort!), I had envisioned having a list of teams with their total wins/losses/draws/battles in a spreadsheet view probably like what you have, and a +/- button to expand each row. When expanded, beneath the team it'd list all the opponent teams it fought and the wins/losses/draws/battles for that specific matchup. I had not planned this far, but with you wanting to include logs somehow, maybe an option to save specific battle logs for a fight you just finished. I maybe wouldn't try to record all battles; that'd be an insane amount of data to record unless you trimmed it down to a very basic outline of what happened. But it can't hurt to experiment.

A gotcha you will want to be careful of (and you maybe already considered with the reference to breeds) is the petID is not a reliable reference to a specific pet. Those petIDs can change without warning between sessions. It's even more annoying than the lack of a breed API in game. (I'm so jealous of the web API's breed support!) Keeping tabs on them with a speciesID+breed may be good enough. If a user doesn't use a breed addon, then it's probably likely they don't have many duplicates where breed is a huge issue.

User avatar
Gráinne
Posts:957
Joined:July 7th, 2015
Pet Score:13747
Realm:Magtheridon-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Gráinne » August 3rd, 2017, 6:59 am

Thanks for your comments!

Some thoughts:

Drlambda, I find that the stats on the raw number of Bone Serpents I faced in 500 battles is of very limited interest. I did that on the forum, and it has some statistical interest, but when I look at my spreadsheet and see a whole team, I get a much more satisfying view. For example, one of my observations during WoD was that my win ratio was highly dependent on how many Undead I was facing. So I did the thing of looking at pet numbers individually, and I definitely want more than that. (I really wish I had always used the same order for pets when jotting down teams, so that I could easily see all Graves, BS, Weeb teams together. And I really, really wish I had recorded what I was running when I faced each.)

Paladance and Gello, thank you for the suggestion to look at PetTracker. I really hadn't noticed. I may be able to use some ideas from its code at some point.

Gello, you are spot on in saying "the hard part will be detailing exactly how it'd work/behave". So I've got something that records teams, clunkily. And all I can think of wanting for myself is capturing that in a spreadsheet. And that's probably where it will stay unless I get some other idea.

I don't see myself ever dealing with pet IDs. A lot of that is because of my own habits. I'm not at all disciplined about teams. I will pull up a team, say "meh, what if I dropped in an Idol instead of the Crab", just do that and go without ever saving the changed team, so I tend not to pay attention to specific pets or teams.

I do like the idea of asking, after a battle, "do you want to keep that record?" but I'm nowhere on logging yet.

In Chess, or Go, or Bridge, people learn by recording and replaying existing games. We have none of that with pets. Of course, we have no mechanism to replay a game and try variations, so maybe that's why. :)

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Pet Battle Recorder Addon

Post by Gello » August 5th, 2017, 8:52 am

Gráinne if you're interested, PM me an email address and I can send you the code for this:

Image

When you leave a battle, you can summon this window and click Save Battle and its log gets inserted to the top of the list. You can modify the code all you want, even post it as your own unchanged, or maybe use the code as a reference for the work on your own addon.

User avatar
Gráinne
Posts:957
Joined:July 7th, 2015
Pet Score:13747
Realm:Magtheridon-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Gráinne » August 6th, 2017, 1:25 pm

For anyone interested, Gello has sent me his awesome addon - thank you so much again, Gello - and I've passed it on to Drlambda, who was also interested. No doubt we'll both be looking at it, trying variations, and screwing up Gello's competent code with our noob Lua. :)

Anyone else who is interested, please feel free to post here. I'll be trying out ideas, and if enough people are interested may add enough to the addon to make it useful to others.

User avatar
Rosqo
Posts:276
Joined:April 26th, 2017
Pet Score:9646
Realm:Silvermoon-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Rosqo » August 7th, 2017, 2:19 pm

I'll be interested in this Gráinne I'm recording the teams I face with Closetozero to get an idea of the meta pets and their occurrence.

User avatar
Paladance
Posts:1010
Joined:July 18th, 2015
Pet Score:12412
Realm:Burning Legion-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Paladance » September 3rd, 2017, 3:03 am

Hi Gello!

I've got your addon, but I can't use it because the frame is too big for my low res (x768) and the buttons are cropped away. Could you tell me what to edit out to shorten it?

EDIT: Nevermind, after reading all adnotations thoroughly I figured out I missed a certain thing. I adjusted it myself! :) Thanks for documentation.

EDIT2: The options as presented in Interface don't seem to save at all. I need to save options via editing related .lua file in SavedVariables and/or relocating them to the character directories. But that copy deletes itself after logging out. :S

EDIT3: And the global SV keeps self-modifying too, I don't know why. Maybe I've broken something but I was changing only size numbers.
Image

I have compiled community knowledge & data about pet battle abilities!
https://www.warcraftpets.com/community/forum/viewtopic.php?f=3&t=19507

User avatar
Drlambda
Posts:64
Joined:May 8th, 2016
Pet Score:5543
Realm:Arthas-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Drlambda » September 8th, 2017, 3:47 am

Hi guys, i uploaded the current version on Curse. You can find it here:

https://mods.curse.com/addons/wow/27725 ... elogkeeper

The majority of the code at this stage was done by Gello, but i added a few features. There will be more features in the future, like:
  • Deleting all logs
  • Filtering by week, month, type of battle etc
Ultimately, i plan to fully automatize metagame snapshots, but that's still a plan for the far future.

Let me know if everything works as expected.
CloseToZero - Watch me lose on youtube with bad pets! :D

User avatar
Drudatz
Top Rater
Posts:387
Joined:June 13th, 2011
Pet Score:10205
Realm:Kul Tiras-eu
Contact:

Re: Pet Battle Recorder Addon

Post by Drudatz » February 7th, 2018, 2:30 pm

@Gello: THANKS for coding this in the first place, I always dreamed of something like this! :!:

@Drlambda: Thanks for putting it on curse for everyone!

Post Reply