There are many challenges inherent in my attempts to make a log parser for LOTRO. Most of these challenges stem from the way that LOTRO writes its combat logs.
Information in Combat Logs - Or Lack Thereof
While the information given in a combat log is adequate at a casual glance to see roughly how well you're doing in combat, it has significant drawbacks when trying to delve deeper into theorycraft, and there is currently no way for a third-party application to gather information from the LOTRO client other than reading log output.
No Combat State Notification!
The logs do not tell you when you are considered to be 'in combat,' nor do they tell you when you have dropped out of combat. This requires a parser to either make an educated guess or require input from the user.
To make an educated guess, the parser must wait for some number of seconds after the last incoming or outgoing damage event for the player, and after this time has passed, the parser assumes you are out of combat. This number of seconds will be customizable as with cstats.
Methods of user input will be provided in the form of 'commands' that are typed into the chat box and caught in the log. I will write more on this in a later entry.
The logs do not tell you when an attack misses or is blocked, parried or evaded. This makes it, as far as I know, impossible to write a parser that will be useful in helping you determine the effectiveness of your defenses (or of your hit rating against a given mob's defenses). Therefore, avoidance calculations are not a consideration for this program.
It would be a bit simpler to write some of the things I want to do into the app if LOTRO automatically timestamped logs - but, alas, it does not. However, I have already made the app timestamp every line it receives, so this point is not a terribly prohibitive one. Nonetheless, it would have been nice for it to be there because that would mean there'd be a little bit less for my program to worry about.
No Crit or DoT Distinction!
There is no difference whatsoever between a line that is a crit and a line that is a non-crit. DoTs are somewhat similar, but not quite. DoTs do not tell you the attack that they were triggered on, so they are simply lines that say that you wounded the mob for x amount of type y damage. Unfortunately, this is identical to how autoattack damage lines are written, so there is a bit of a problem in figuring out what is and isn't a DoT.
These problems can be solved, however, by comparing data that the parser has already picked up in the current log and comparing it to the current hit. Most DoTs are significantly lower in damage per tick than the average autoattack, and most crits are something like at least 150% of the damage that whatever the attack would normally do. The program can ask, 'is this line that looks like an autoattack significantly less damaging than the average autoattack? if it is, I think it's a DoT.' Or it can ask, 'is this line about the Blade of Elendil skill significantly higher than most other occurances of Blade of Elendil? if it is, I think it's a crit.'
Of course, with this method, there has to be some data gathering beforehand, so the parser isn't going to know whether or not the first few hits in the log were crits or not. It will still be helpful to those who are serious about testing out their crit ratings, though.
Others' Activities are Ignored!
Every bit of damage that is logged is centered around the player that is logging it - this includes incoming/outgoing damage and incoming/outgoing healing. If Player A is fighting Mob X, then Player A will see his own events and Mob X's events. But if Player B is fighting Mob Y nearby, Player A is unable to log any of the events that are occurring between Player B and Mob Y, and Player B and Mob Y cannot log the events going on between Player A and Mob X. The one exception to this is defeat/retreat/revival, which is not useful for the purposes of calculating DPS. Therefore, at this time it is impossible to log and analyze the actions of anyone other than yourself or the mobs that are hitting you - unless, of course, you use the replay feature on a log file that someone else gave you after the fact.
Event Line Formats are Inconsistent!
This challenge is probably only annoying at best. Skill lines look like this:
You wound Thaurlach with Devastating Blow for 432 points of Beleriand damage.
And autoattack lines look like this:
You wound Thaurlach for 432 points of Beleriand damage.
If autoattack lines instead looked like this:
You wound Thaurlach with an autoattack for 432 points of Beleriand damage.
... then it would be simpler to write a regexp that could parse these. I tried to write The One Regexp To Rule Them All and it is more difficult than it seems at first to write a regexp that will properly harvest data from both lines - not to mention other lines, such as those for healing and death.
These are the main challenges that come to mind at the moment. If I think of any more I will add them to this entry.
In my next entry I will discuss the most useful features I have planned for the project.