Saturday, November 1, 2008

Badge Tracking HOWTO

I've seen a few requests in-game lately for a better explanation of how to do badge tracking with HeroStats. I've just recently released a new HeroStats version (4.2.3.0) that contains several fixes to the badge tracking functionality, so it seemed like a good time to provide some instruction.

Step 1 - Register with a Badge Site

HeroStats has support for two City of Heroes/Villains badge sites: Badge Hunter and City Info Tracker (part of the Titan Network). Go to one (or both) of those links and register for an account. Note the username and password for the site(s), you'll need those later.

Step 2 - Download and Install HeroStats

You can find instructions on getting the latest version of HeroStats from HeroStats.org. I highly recommend keeping your HeroStats version up to date to get the latest bug fixes and new features.

Step 3 - Configure HeroStats

Start up HeroStats and go to the Global Options (View->Global Options), then click on the Web Sites tab. You'll see a screen something like this:


Your screen may not have all the fields shown in the screenshot, if you have either "Use City Info Tracker" or "Use Badge Hunter" unchecked. Select one or both of those, depending on which badge tracking site(s) you've chosen. Then for each site, enter the username and password. You can also set the refresh interval for each site, but I recommend leaving it at the default of 60 seconds, which provides fairly frequent updates without excessive network traffic.

By default, updates are not sent when you use the Test server. You can choose to allow this by unchecking the "Block Test Server Updates" option, but be aware that updates may not be shown correctly depending on exactly what code is on the Test server at any given point in time.

If you're using an unstable build of HeroStats, you'll also see the option to use Unstable Web Services, which simply means the latest version if we're making any changes to the connectivity to the web sites. You won't even see the option if using a stable build.

Step 4 - Ensure HeroStats sees your Badges In-Game

Start up both HeroStats and City of Heroes/Villains, and log in a character. Open your Badges menu and select a badge as your character's title. Then take a look at the HeroStats window. You should see something like this:


Note the Badge Earned: line. If you don't see that, then HeroStats isn't detecting your badges. Try the suggestions documented in the Known Issues on HeroStats.org for this situation.

Once this is working, HeroStats will automatically detect any badges you earn while it is running, and send them to the badge tracking site(s) you have selected.

(Optional) Step 5 - Verify your Existing Badges using Settitle Binds

Both of the badge tracking sites provide bind files that can be used to verify the badges your character has already earned. This is also useful if you earned some badges while HeroStats wasn't running, and want to send them to the site. Current links to the bind files (these may change, if the links don't work then go to the badge tracking site and look around for a new version):

CIT of the Titan Network settitle bind files
Badge Hunter settitle bind files

Those links include instructions on how to use the bind files. Please note that it is important to go through the binds slowly! I typically pause a second in between each press of the key that loads the next bind file, to allow HeroStats to catch up.

If you find that badges aren't being detected by HeroStats while using the bind files, you may need to make use of the "Number of chat messages to maintain as history while scanning" option. This is shown in the Hero Options on the Options tab. Setting this to a higher number (8-10 is about the highest you should need) will help HeroStats to detect rapidly changing messages, such as those from the bind files. This will slow down the HeroStats performance, though, so remember to change it back to a lower number (I usually have mine set to 3) for your normal play sessions.

If it looks like HeroStats does see the badges, but you still don't see them on the site(s), you can use the HSLogFile to check if the badges have been sent. The HSLogFile lives in your HeroStats directory and is a plain text file. You first need to make sure that the Debug Level is set to Info (you can find this in the Global Options). Then run through the binds as described above. Once finished, open up HSLogFile and check for instances of the phrase
"Sent to CIT successfully" or "Sent to BH successfully". If you count up all instances of those phrases, you can see exactly how many badges were sent to each site. (If you find some missing, you might also have to look in an older HSLogFile, as a new file is started once it reaches 1 MB in size. The timestamps on each message can tell you when each logged message was written.)

Conclusion

I hope all this information helps people to use the badge tracking features of HeroStats more easily. This takes a lot of the tedium out of badge tracking, and both badge tracking sites have plenty of features to make badging more fun. Try it out!

Friday, May 16, 2008

Scanner changes for Issue 12

As I mentioned in my previous post, Issue 12 has changed the way things work in the chat message system. This has necessitated some fairly major changes in the HeroStats scanner as of version 4.1.0.6.

For HeroStats Users

If you're a HeroStats user, you'll notice the changes in your hero configuration options. The Channels and Globals tabs are gone - you can no longer choose which channels you'd like HeroStats to scan. Taking their place is a Scanner tab. There are two options here.

First, there is a checkbox which allows you to choose whether HeroStats should ignore any chat tabs that display only "chat-type" messages, which are messages that don't contain any statistics information. Typically this means things from your global chat channels, local chat, etc.

Second, you can enter the name of a tab that you would like HeroStats to scan while ignoring all others. This is very handy to increase performance. The name of this is "HSData" by default, although you can change it to whatever you like. If the name given here doesn't exist, HeroStats will fall back to the default behavior of scanning all tabs. The image below shows a sample setup of the HSData tab for best performance (this is on Test, but a Live setup would be the same minus the new Pet and Hit Rolls channels).


For Developers

If you're a developer who has used the HeroStats scanner in your own program, you'll need to make a few changes with versions 4.1.0.6 and above. The first thing you'll likely notice is that the CohScanner class no longer has properties to set which channels to scan. If you were using those, you'll need to remove that code.

There are some new properties on the CohScanner class, too. The boolean IgnoreChatTypeMessages property and the string HSDataTabName property implement the two hero configuration options described above. Both of these are static properties, so you'll need to set them on the CohScanner class (rather than an instance). You can update these while the scanner is running if you like, it'll recognize the changes.

If you'd like some more control over what chat tabs are being scanned, you can access the list of available tabs using the AvailableTabs property. This one's not static, so access it through your CohScanner instance. AvailableTabs is a List of ChatTab objects, each of which represents one of the user's chat tabs. You can get the tab name from the Name property, and the number of messages on the tab from the MessageCount property. You can also set whether a tab should be scanned with the IsScannable property; if true, the scanner will ignore this tab (unless it's the one specified in HSDataTabName).

Internally, the old ChatChannel class in the scanner has been greatly reduced. Most of its functionality is now in the new ChatTab class. The old channel types still exist, but they're really used only for looking at which channels should be on each tab. There is also a new property on the MemlocFinder class called IsLiveCode, which is used throughout the scanner to drive logic that's different between Live and Test servers.

Wednesday, May 14, 2008

Issue 12 beta changes

So Issue 12 is in open beta now, and there's a ton of changes. Lots of quality-of-life improvements, many of which relate to chat messages. Unfortunately, those changes mean much of what HeroStats does has to be changed in order to work with I12.

By far the biggest change is how message channel is identified. Pre-I12, the channel type was hardcoded to a particular value, and each message was tagged with the appropriate channel type value. Now that's no longer the case. Messages are instead stored in the client memory with pseudo-HTML tags that set the message color and other attributes. This is great for the game client - it enables the linking you see in I12, and the ability to change the color of each channel on your tabs. But it's not so good for HeroStats, because there's now no good way to take a message and figure out which channel it came from. Those pseudo-HTML tags don't help, because they can be changed by the user at will.

So, we're going back to an approach that I tried once before - scanning each tab of the chat message window, rather than looking for individual channels. This can potentially give us better performance, but does require that the users have their chat tabs set up in certain ways. I'm working on a way to make this transparent to the user, or at the very least use the new I12 feature to load tab settings from a file to make it easy to set up.

This also means that we no longer know which channel a particular message belongs to. Previously the channel was used to 1) let people choose which channels that HeroStats would log and 2) filter out messages on channels that never contained any information needed for stats gathering. Both of those features will no longer be available with the new system.

I haven't had as much time as I'd like to work on this, so the new scanning system isn't completely ready for prime time just yet. I'm hoping to have it finished before Memorial Day, hopefully prior to I12 actually going live.

Thursday, February 14, 2008

To-Hit messages: the good, bad, and ugly

As of February 12, the new combat log messages reporting To-Hit rolls are live on the CoX servers. This is a mixed blessing for HeroStats users. As of right now, the unstable builds (3.9.9.12 at the moment) use these messages, and by this weekend the stable builds will as well.

The Good: I previously posted about accuracy tracking improvements when these messages were on Test. Pretty much all of that still applies. For many powers, the To-Hit messages are going to make accuracy tracking better.

The Bad: There are some powers have no To-Hit message when they hit (Blazing Aura, for instance). That makes it difficult to track accuracy for those - it could be done, but it requires us to count damage messages as hits. That's an ugly kludge that I was hoping to get rid of.

The Ugly: Then there's powers that have a chance for a secondary effect to occur (for example, the chance to disorient on Barrage). For these, you see two To-Hit messages - the first for the secondary effect, the second for the actual damage. The power name is exactly the same in both cases. To make it worse, the secondary effect message only shows up for misses, and unlike the powers mentioned above, there's no damage message to use.

Because of the ugliness mentioned here, I'm leaving the old Power Accuracy calculations in HeroStats as well as using the new To-Hit message method. You'll be seeing two sections for accuracy now, one called Player Accuracy (the To-Hit message method) and one called Power Accuracy (the old method based on power activation/damage/miss messages).

What I'd like to see is a fix on these To-Hit messages by the CoX devs, so we can use only those for all powers and ditch the "Power Accuracy" section altogether. Suggestions:
  • Refer to what the roll is actually being used for - i.e. "Barrage Chance to Disorient" or "Barrage Damage".
  • Always show the To-Hit message, whether it's a hit or a miss.
That's pretty much all it would take.

Saturday, January 26, 2008

Test server 25-Jan release

The 25-Jan-2008 build of the Test server has a bunch of new combat log messages available to help track accuracy. You can see the patch notes on the official forums. What this means to HeroStats is that it's now much easier to track accuracy of a power, and it's even possible to see the accuracy of an enemy's powers!

The latest unstable build (download it from the unstable web site) takes these new combat log messages into account. You'll see a bunch of new statistics related to accuracy if you're running the unstable build on Test. Here's a brief rundown of what's new:
  • Both player and enemy accuracy is tracked. Each section discussed below comes in two flavors, one for player stats and one for enemy stats. For players, everything is tracked by power. For enemies, it's tracked by both enemy type and power (since a Behemoth's version of Fire Sword might be different than the Fire Thorn Caster version of Fire Sword).
  • [Player/Enemy] Accuracy: This section measures the actual accuracy for each power over the time you've been collecting statistics. It's calculated from actual hits / (actual hits + actual misses).
  • [Player/Enemy] Hits and Misses: A detailed breakdown of the number of hits and misses per power.
    • Hits and Misses are simply counted from the new log messages.
    • Hits (calculated) is generated by looking for messages where the roll is less than or equal to the percent chance to-hit. That's a debugging tool, mainly - in theory Hits should always equal Hits (calculated) - if it doesn't then something's not right.
    • Number of Rolls is the count of times you had to make a to-hit roll. You might think this should always be equal to the number of times you attacked, but it's not always the case - sometimes a power is auto-hit, and sometimes the streakbreaker gets involved.
    • Streakbreaker Count is the number of times the streakbreaker was used to force a hit. I'm not going to try to describe the streakbreaker here, Arcanaville's Guide to Defense does it better than I would.
  • [Player/Enemy] To-Hit Chance: The to-hit chance percentage from the new combat log messages.
    • Average is exactly what you'd expect, the average of the percentages from all the hits and misses for the power. Note that auto-hit and streakbreaker "hits" aren't counted.
    • Total isn't all that useful, it just adds up all the to-hit numbers. It's used for calculating the average.
  • [Player/Enemy] To-Hit Rolls: The to-hit rolls from the new combat log messages. This is the same as the to-hit chance above except it's the roll numbers.
The old accuracy and hit/miss stats are still in HeroStats for now. Once these new combat log messages are stabilized I'll probably remove that, but for now it's interesting to see how the old and new ways differ. From the little testing I've done so far, they're pretty much the same, which is a good thing.

All this information is accurate as of the 25-Jan-2008 Test build and the 3.9.9.8 version of HeroStats. New Test builds and new HeroStats versions could be a bit different, keep an eye on the change logs for each.

Friday, January 11, 2008

HeroStats, Real Numbers, and City Vault

With the new year, NCSoft has announced several upcoming features for City of Heroes/Villains in their 2008 State of the Game article. There's a lot of good information there which I encourage everyone interested in CoX to read. Here, I'd like to address a couple of things of interest to HeroStats users.

The Real Numbers

As a general quality of life improvement we will be adding new functionality in a coming version of the game to display the “real” numbers behind your characters and their powers. This includes a user configurable display of important characteristics such as movement rate, regeneration rate, resistances and many more! Additionally, you will be able to see how those statistics are affected in real time by buffs and/or debuffs affecting your character.

The article mentions the ability to display the actual values for the various statistics that your character has - regeneration, resistance, movement, etc. Let me first say that I think this is long overdue, and a welcome change. I remember this request coming up way back in City of Heroes beta, and it's been a regular discussion topic ever since. It's great to hear that it's coming.

One of the core functions of HeroStats has always been to track the actual values during a play session for the accuracy of your powers, damage dealt, damage received, etc. Note that the article didn't mention any of these sorts of statistics. It's possible they may be included, and that would be wonderful, but I have my doubts. As long as this sort of information is not available through the game client, HeroStats will continue to provide it.

What was mentioned in the article is the type of information you see in a build planner. How much resistance to smash/lethal do I have? What's my total regeneration? Those sorts of statistics have never been tracked by HeroStats (because they don't show up in the combat log). It's great to see that this information will be available without having to put all my information into an external build planner tool. (Side note - build planners will still be useful, though. There was no mention in the article of any way to do a "what if" scenario, and that's where the build planners are most useful.)

There's one possible area of overlap - recharge timers. If the UI is going to be able to display how much time is left before a power recharges, the recharge timer function of HeroStats may become obsolete. This wouldn't break my heart - recharge timers are less than completely accurate, as I've described before. If the developers want to change the game UI to do a better job, more power to 'em.

Here again, however, I have my doubts. There was much furor on the forums about the UI change to have buff timers blink 10 seconds before expiration, and how it would make HeroStats buff timers obsolete. Hasn't happened - plenty of people still use HeroStats for tracking buffs, because 10 seconds just isn't enough warning much of the time. We'll have to see exactly how the UI changes are implemented before making any assumptions about what HeroStats functions will become obsolete.

City Vault

We gave a sneak peak of the new “City Vault” feature at the recent San Jose Meet ‘n Greet. The City Vault is coming soon to the City of Heroes website and will showcase the millions of interesting Heroes and Villains found in Paragon City and the Rogue Isles. It will allow you to search for characters by a number of different criteria, and then view those characters, including images of different costumes, powers, badges, friends, stats by zone and other fun information! As we have previously announced, you can manage what information will be displayed through the City Vault for your characters via several in game options.

Again, let me first say that I'm very happy to see this. The ability to see in-game info outside of the game has been a much-requested feature for a long time. It's great to see it becoming reality.

None of the functions mentioned in the article will impact HeroStats directly. The core function of HeroStats, tracking statistics within a play session, is in no way impacted by the ability to view character information on the web.

HeroStats does, however, have some secondary functions that could be impacted by the City Vault. Several community websites (see our affiliates list at http://herostats.org) use HeroStats to gather information about characters. Much of this information may now be viewable through the City Vault.

We'll have to wait for the actual City Vault to be available to know exactly how it will impact these community websites. At the moment, I'm willing to say that it's highly unlikely that the City Vault feed will be real-time (for performance reasons) and therefore a site like City Game Tracker, which allows you to see who is online at a particular time, will still be useful. Badge tracking sites typically provide quite a bit more functionality than simply listing badges - showing uncollected badges, for instance, or listing the top badge collectors on a server - so those will still be useful as well.

As for HeroStats, the main impact will be in the data we're sending to the community websites. Some, like City Game Tracker, probably won't change at all. Others, like the badge sites, might start getting their information from the City Vault and not need HeroStats at all. It's difficult to say until we see the City Vault in action, and have some idea how easy or difficult it will be to use that information.

Friday, January 4, 2008

Why does it take so long to load HeroStats?

I've seen a few people ask this question in the past. I freely admit that HeroStats takes a good long time to start up initially. And to make matters worse, while it's starting, it eats up most of your CPU so other programs are impacted. So why does this happen?

The answer, as in most programming, comes down to a trade-off. HeroStats makes heavy use of regular expressions (also known as regexs) to parse the text of the combat log into the stats that everyone wants. Regexs are a great way to recognize text messages and get information out of them, but they require a good deal of setup time if you want them to run quickly. This is known as compiling the regexs and it takes a lot of your computer's CPU time.

And we certainly want them to run quickly. HeroStats scans the CoX client chat tabs twice every second to look for new messages. Every time a new message is found, we have to run through the regexs to figure out what that message means. The code is pretty smart about checking the most common regexs first, but it can still take quite a while to go through them all, especially if your message happens to be one that isn't used very often.

So we want the regexs to run quickly, but in order to do that we need to spend the time to set them up first. And this is why your HeroStats takes a while to start up. It's loading up all those regexs so that while you're actually playing the game, your statistics/timers/etc. are being pulled quickly from those log messages.