User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Improved Battle Reports - not really a Mod but kind of

Thu Jul 31, 2014 9:51 pm

Hi all,

I am/was frustrated about the difficulty in understanding the battle report screen and how it feels like information is being withheld for no real reason.

For example, here is a battle I recently fought while storming St. Louis (I am CSA and am playing my mod - hence Pearce):
[ATTACH]29697[/ATTACH]

You can see I won the battle and destroyed the 2nd Minnesota Militia and a Garrison Unit. You can also see Pearce was killed (or injured, from the messages I know he was killed). You can see a regiment in Price's division and in Greene's brigade destroyed a unit. From the message bar I can see Price was congratulated. I wrote a program (perl script) that went through the battle log and re-did the summary:

Code: Select all

Battle in Saint Louis, MO on day 2. Attack by  S. Price' Force on 1.Garrison Saint Louis Depot.  Region terrain is City and weather is .
CSA Stack Commander: Sterling Price Exp change: 5
    Unit Commander: Benjamin McCulloch Exp change: 0
      Line - 1006197 2nd Missouri -    Men: 19 Lost: 2 Damage Done: 0 Exp change: 0
      Line - 1004053 3rd Louisiana -    Men: 20 Lost: 2 Damage Done: 2 Exp change: 0
      Line - 1004054 3rd Arkansas -    Men: 19 Lost: 2 Damage Done: 4 Exp change: 0
      Line - 1004055 1st Arkansas Mtd Rifles -    Men: 19 Lost: 2 Damage Done: 0 Exp change: 0
      Line - 1004062 5th Arkansas State Troops -    Men: 15 Lost: 4 Damage Done: 1 Exp change: 0
      Line - 1004060 3rd Arkansas State Troops -    Men: 15 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1006198 1st Missouri Rifles -    Men: 20 Lost: 2 Damage Done: 6 Exp change: 0
      Support - 1006201 1st MO Art. -    Men: 8 Lost: 0 Damage Done: 2 Exp change: 0
      Line - 1004061 4th Arkansas State Troops -    Men: 15 Lost: 0 Damage Done: 2 Exp change: 0
      Line - 1006195 4th Missouri -    Men: 20 Lost: 4 Damage Done: 6 Exp change: 0
      Line - 1004056 2nd Arkansas Mtd Rifles -    Men: 20 Lost: 6 Damage Done: 4 Exp change: 0
      Line - 1006194 Cos A-B Pindall's 9th MO Battalion -    Men: 10 Lost: 4 Damage Done: 1 Exp change: 0
      Line - 1004205 4th Arkansas -    Men: 20 Lost: 2 Damage Done: 2 Exp change: 0
      Line - 1006196 3rd Missouri -    Men: 19 Lost: 2 Damage Done: 4 Exp change: 0
      Line - 1006199 1st Missouri -    Men: 19 Lost: 0 Damage Done: 4 Exp change: 0
    Unit Commander: Nicholas B. Pearce Exp change: 0
      Line - 1006877 10th Arkansas Cav. -    Men: 19 Lost: 18 routed by 12th Missouri Damage Done: 2 Exp change: 0
      Support - 1004070 Reids's Battery -    Men: 8 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1004066 1st Arkansas Cavalry -    Men: 20 Lost: 18 routed by Armstrong's KS Art. Damage Done: 0 Exp change: 0
      Line - 1004058 3rd Texas Cavalry -    Men: 20 Lost: 14 routed by 15th Missouri Damage Done: 2 Exp change: 0
    Unit Commander: NoUnitCommand Exp change: 0
      Line - 1006957 6th Missouri -    Men: 20 Lost: 0 Damage Done: 3 Exp change: 20
      Line - 1006954 Cos C-D Pindall's 9th MO Battalion -    Men: 10 Lost: 2 Damage Done: 0 Exp change: 0
      Line - 1006956 7th Missouri -    Men: 20 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1006959 5th Missouri -    Men: 20 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1006958 Clark's MO Regiment -    Men: 20 Lost: 0 Damage Done: 2 Exp change: 0
      Line - 1006955 7th MO 'Franklin's Rgt' -    Men: 20 Lost: 0 Damage Done: 2 Exp change: 0
    Unit Commander: Sterling Price Exp change: 5
      Line - 1004513 Brown's Cav. -    Men: 10 Lost: 2 Damage Done: 1 Exp change: 0
      Line - 1004521 Campbell's Cav -    Men: 10 Lost: 0 Damage Done: 1 Exp change: 45
      Line - 1004501 3rd MO State Gd -    Men: 19 Lost: 0 Damage Done: 2 Exp change: 0
      Support - 1004523 Guibor's Battery -    Men: 8 Lost: 0 Damage Done: 4 Exp change: 0
      Line - 1004520 Foster's Inf. -    Men: 14 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1004516 Thornton's Inf. -    Men: 15 Lost: 0 Damage Done: 0 Exp change: 0
      Support - 1004068 Woodruff's Battery -    Men: 8 Lost: 0 Damage Done: 6 Exp change: 0
      Line - 1004517 Rives' Cav. -    Men: 10 Lost: 4 Damage Done: 1 Exp change: 0
      Line - 1004512 Kelly's Inf. -    Men: 15 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1004499 1st MO State Gd -    Men: 20 Lost: 0 Damage Done: 6 Exp change: 0
      Line - 1004515 Hughes' Inf. -    Men: 14 Lost: 0 Damage Done: 0 Exp change: 0
      Line - 1004519 Wingo's Inf -    Men: 15 Lost: 4 Damage Done: 0 Exp change: 0
      Line - 1004502 4th MO State Gd -    Men: 20 Lost: 2 Damage Done: 0 Exp change: 0
      Line - 1004500 2nd MO State Gd -    Men: 20 Lost: 0 Damage Done: 0 Exp change: 0
USA Stack Commander: NoStackCommand Exp change: 0
    Unit Commander: NoUnitCommand Exp change: 0
      Line - 1005953 17th Massachusetts -    Men: 20 Lost: 2 Damage Done: 2 Exp change: 0
      Line - 1006449 13th Missouri -    Men: 20 Lost: 6 Damage Done: 10 Exp change: 0
      Line - 1006031 2nd Minnesota Mil -    Men: 15 Lost: 15 destroyed by 6th Missouri Damage Done: 4 Exp change: 0
      Line - 1005954 7th Connecticut -    Men: 19 Lost: 2 Damage Done: 6 Exp change: 0
      Line - 1006447 11th Missouri -    Men: 20 Lost: 2 Damage Done: 12 Exp change: 0
      Support - 1006451 Armstrong's KS Art. -    Men: 10 Lost: 0 Damage Done: 10 Exp change: 0
      Line - 1006450 15th Missouri -    Men: 20 Lost: 6 Damage Done: 10 Exp change: 0
      Line - 1005955 8th Connecticut -    Men: 20 Lost: 2 Damage Done: 4 Exp change: 0
      Line - 1005952 15th Massachusetts -    Men: 20 Lost: 5 Damage Done: 6 Exp change: 0
      Line - 1007170 Fort Jones -    Men: 19 Lost: 19 destroyed by Campbell's Cav Damage Done: 2 Exp change: 0
      Line - 1006448 12th Missouri -    Men: 19 Lost: 6 Damage Done: 12 Exp change: 0
      Line - 1006446 10th Missouri -    Men: 20 Lost: 5 Damage Done: 18 Exp change: 0


In this version, you can see how many hits each unit went into the battle with, hits lost, damage done, and experience from destroyed units. You can see who destroyed those two USA regiments (6th Missouri and Campbell's Cav) and what happened to Pearce's division (3 units routed - and you can see who did it). You can see the amount of special experience gained by units and by commanders for destroying regiments and you can see that no special experience is recorded as being gained for routing units. Peace died (I can see it in the messages), but this is not recorded here. Neither army retreated - if it had some information about retreating armies is recorded.

I've recorded whether the unit was a support unit or a line unit - I could record unit subtype (cav, art, etc) but haven't. No non-combat support units were involved, I assume the log handles them normally and we'd see their results just fine.

Anyway, I'm wondering how much wider interest there is in such a work. I'm planning on developing it a bit further (multipliing hits by hits per regiment to get men, putting in information on who a regiment destroyed). It seems possible to read the hst file and figure out a few more things (if a commander died or was injured in battle, what regiments were in the region but did not fight, if anyone was congratulated - perhaps having more units destroy your opponent than were destroyed is sufficiently informative on this point). What would you like to see it include? What would you do to improve it?
Attachments
Untitled.png

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Fri Aug 01, 2014 12:46 am

I was thinking about writing a Python program to go through the logs to get more stats.
I hope they do more extensive stats (there is a post somewhere I wrote with the kind of stats I like, like top 10 of biggest battles and so on).
Makes the game a lot more interesting.
Processing the logs after each turn would mean it's possible to keep a lot more stats than we currently have.

The output of the script is interesting (although I'm not perl fan :) )
Only thing I would change for this first version is the number after "Men."
20, 10, and so on, isn't telling me a lot. If you could get the number of men instead, it would help understanding the numbers even more.

2nd improvement I would make is to make sure the stats (Men, Lost and so on) all start at the same column.
Now with long names, they make the number shift right, which doesn't benefit readability.
Also an underline for the "Unit Commander" lines and stack commanders makes it more readable.
Another improvement could be to record the date.
And a last improvement, might be to put totals for both stacks, and a grand total at the end.

Jagger2013
General of the Army
Posts: 641
Joined: Sat Apr 27, 2013 2:14 am

Fri Aug 01, 2014 2:17 am

Very nice! I wonder if your program would be useable with other AGEOD titles as well? I assume it would.

PS: It would be nice if the program could create separate reports for each faction within a game for PBEM purposes. And I believe some AGEOD games have up to 4 or 5 factions.

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Fri Aug 01, 2014 3:18 am

@minipol: sorry, I have been thinking about switching from R to SciPy forsome of my work, and if I did I would use python more, but I don't think I will. So for now, perl is my language of choice for fun/personal projects. I'm happy to share the code, for what it is worth.

I agree very much about more extensive stats, this is the first (and hardest, maybe) step in such a project. The game overwrites the battle log between each turn, so one would have to remember to run a script between each turn as it is now (I'm not savvy enough to skip such a step). I strongly doubt that AGEOD will make statistics a priority at all.

I'll definitely change from hits to men. It is interesting as attacks seem to usually (always) take 2 hits per regiment per round per fire (2 hits * 30 men per hit = 60 men for most infantry) or 1 if there is only 1 hit left, of course. I'll also aggregate statistics to the division (or unit), corps (or stack), and side (army, I think) level. I haven't processed a multi-corps battle with it, and I don't know how those log files look, but I think my code will handle it fine as it is and I can aggregate at the "side" level for that.

Formatting the statistics to columns really means putting the output into a table. I'm thinking about writing the output into html (using tables), as that will render nicely on any system and can be used by people who wouldn't bother with a spreadsheet. Maybe csv is smarter, though, I'm not sure. What would work best, do you think? I just used tabs and text for this because it looks nice enough. Underlining is smart, I'll look at some Orders of Battle and fudge the formatting a bit as I go.

To get the date (month and year) I'd have to integrate the program with the hst file. Also note that the divisions I show don't have 17 regiments - this is because not all 17 were in the fight and those that aren't in the fight aren't in the battle log. Again, hst integration can show these regiments, but this will be more of a pain because that file is harder to understand. Once I get the script running nice for a single turn, I'll have it read the hst at least for the date and start working on recording battles for a complete campaign.

@Jagger2013: I think it will work with other titles. I'm happy to share my code - and would be happy to run the code on a battle log for another program, if anyone wants to provide one. I would ask for a key to how many men per hit (and horses and guns per hit - perhaps other games have other things, too) for different units in different titles. I think it would be a fun addition to PBEMs, especially. What would you wish to hide from opposition factions? Certainly some of it, but I'm curious what would be best to obfuscate?

User avatar
Gray Fox
AGEod Guard of Honor
Posts: 1583
Joined: Wed Aug 22, 2012 7:48 pm
Location: Englewood, OH

Fri Aug 01, 2014 12:58 pm

FYI, some of the battle icons seem to have no meaning. In one battle report, an enemy battery had the "opened murderous fire" icon, even though none of my units took any hits or lost cohesion. They must have forgot the cannonballs. It made me wonder, how many of the icons are just window dressing?
I'm the 51st shade of gray. Eat, pray, Charge!

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Fri Aug 01, 2014 3:12 pm

@GF: Are the "opened murderous fire" and "landed hits" icons mutually exclusive? If not, then "opened murderous fire" could just mean that multiple cannons fired or firing started at a long range or something. As I gain experience, I think I'll know for sure.

By the way, the battle log doesn't indicate unit type with enough precision to know how many hits per men - for that I will need to cross-reference the models file and the hst file (the hst file gives a unit ID (UID) for every element ID and the models file gives hits per men for every UID). So it looks like my next step will be looking at these two files.

User avatar
ArmChairGeneral
AGEod Grognard
Posts: 997
Joined: Thu Nov 21, 2013 9:00 am
Location: Austin, TX, USA

Fri Aug 01, 2014 10:25 pm

I would rather see hits displayed rather than men. Hits (hearts) are the unit that replacements come in. Converting hits to men just muddies the waters for me.

I like this a lot, and I think an html table output to keep the columns in a nice viewable order would work just fine.

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Sat Aug 02, 2014 2:18 pm

In a csv output, I can (and will try to) include every statistic in which anyone is interested. For html/text output, though, I think I need to drop something. Here is what my output looks like right now:

Code: Select all

Battle in Fairfax, VA on day 1 of Late Dec. Attack by  Army of the Potomac on Alexandria Defense Force.  Region terrain is Clear and weather is Storm.
CSA Stack Commander: P.G.T. Beauregard Exp change: 8
    Unit Commander: Charles S. Winder Exp change: 5
      Reg (Line) - 1003593 11th NC 'Bloody Bethel' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 routed Bat C 1st Connecticut Heavy Artillery, Exp change: 0)
      Reg (Line) - 1006100 15th Virginia (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 2 routed Volunteers, Exp change: 0)
      Reg (Line) - 1003597 8th South Carolina (Men: 600 Lost: 30 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 1) Damage Done: 4 Exp change: 0)
      Reg (Line) - 1004011 3rd Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Art (Support) - 1003592 1st Bty, Richmond Howitzers Bat (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 16 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1004017 9th VA 'Hansbrough's' Inf Bat (Men: 285 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 5 destroyed Volunteers, Exp change: 42)
      Art (Support) - 1003591 Alexandria VA Light Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 16 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 Exp change: 0)
      Art (Support) - 1004081 Norfolk Howitzers (Men: 90 Lost: 0 Horses: 6 Lost: 0 Guns: 48 Lost: 0 Ships: 0 Lost: 0 (Hits: 6 Lost: 0) Damage Done: 3 routed Light Infantry, Exp change: 0)
      Cav (Line) - 1003590 Munford's Squadron VA Cavalry (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 600 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 1 Exp change: 0)
      Reg (Line) - 1003596 7th South Carolina (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Art (Support) - 1003620 Loudon VA Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 24 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1003611 19th Virginia (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 3 destroyed Bat C 1st Connecticut Heavy Artillery, Exp change: 39)
      Reg (Line) - 1003610 18th Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 6 Exp change: 0)
      Cav (Line) - 1003589 Wickham's Squadron VA Cavalry (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 600 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1003609 8th Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1003612 28th Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 4 destroyed Light Infantry, Exp change: 44)
      Reg (Line) - 1003595 3rd South Carolina (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 2 Exp change: 0)
    Unit Commander: James Longstreet Exp change: 2
      Reg (Line) - 1002435 8th Georgia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1004010 1st VA Inf Bat 'Irish Bat' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1003604 17th VA 'Bloody 17th' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 4 Exp change: 0)
      Reg (Line) - 1004014 5th VA 'Archer's' Inf Bat (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 4 Exp change: 0)
      Reg (Line) - 1003605 5th North Carolina (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1004492 14th Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1002434 7th Georgia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Art (Support) - 1002433 Wise Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 24 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 Exp change: 0)
      Cav (Line) - 1003585 Scott's Squadron VA Cavalry (Men: 570 Lost: 60 Horses: 0 Lost: 0 Guns: 570 Lost: 60 Ships: 0 Lost: 0 (Hits: 19 Lost: 2) Damage Done: 1 destroyed 153rd New York, Exp change: 73)
      Cav (Line) - 1003601 Whitehead 30th VA Cav. (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 570 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1005521 2nd AL 'Magnolia Rgt' (Men: 570 Lost: 60 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 2) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1004202 13th Virginia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1003587 24th Virginia (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 0 Exp change: 0)
      Cav (Line) - 1005596 AL 'Forrest's Cavalry' (Men: 570 Lost: 30 Horses: 0 Lost: 0 Guns: 570 Lost: 30 Ships: 0 Lost: 0 (Hits: 19 Lost: 1) Damage Done: 1 Exp change: 0)
      Reg (Line) - 1003603 1st Virginia (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 0 Exp change: 0)
    Unit Commander: W.H.C. Whiting Exp change: 3
      Art (Support) - 1002439 Charleston Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 16 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 Exp change: 0)
      Mil (Line) - 1003616 Schaeffer's VA Battalion (Men: 450 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1003614 49th VA 'Extra Billy Smith's Boys' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1004009 1st AL 'Clayton's Reg' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 destroyed 26th Michigan, Exp change: 20)
      Reg (Line) - 1003578 5th AL 'Rhodes' Reg' (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1002437 1st South Carolina Infantry (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 4 destroyed 1st District of Columbia, Exp change: 36)
      Art (Support) - 1003633 Purcell VA Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 24 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 Exp change: 0)
      Art (Support) - 1003618 1st Lynchburg VA Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 16 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 2 routed 1st District of Columbia, Exp change: 0)
      Reg (Line) - 1003632 2nd Tennessee (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1003631 1st Arkansas (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Reg (Line) - 1003579 6th Louisiana (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 0 Exp change: 0)
      Reg (Line) - 1002438 17th South Carolina Militia (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 2 Exp change: 0)
      Cav (Line) - 1003576 Jenifer's VA Cav Bat (Men: 600 Lost: 0 Horses: 0 Lost: 0 Guns: 600 Lost: 0 Ships: 0 Lost: 0 (Hits: 20 Lost: 0) Damage Done: 1 routed 153rd New York, Exp change: 0)
    Unit Commander: NoUnitCommand Exp change: 0
      Cav (Line) - 1002449 1st Georgia Cavalry (Men: 570 Lost: 0 Horses: 0 Lost: 0 Guns: 570 Lost: 0 Ships: 0 Lost: 0 (Hits: 19 Lost: 0) Damage Done: 1 Exp change: 0)
      Art (Support) - 1003574 2nd Lynchburg VA Artilllery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 24 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 4 routed 26th Michigan, Exp change: 0)
      Art (Support) - 1002445 NC Battery A, Ellis Light Artillery (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 24 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 0 Exp change: 0)
      Art (Support) - 1005090 Alexandria Bty (Men: 180 Lost: 0 Horses: 12 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 12 Lost: 0) Damage Done: 3 Exp change: 0)
      Art (Support) - 1004079 Gospord Bty (Men: 72 Lost: 0 Horses: 8 Lost: 0 Guns: 32 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 4 Exp change: 0)
 Stack Commander: NoStackCommand Exp change: 0
    Unit Commander: NoUnitCommand Exp change: 0
      Art (ReceivingOnly) - 1003602 3rd Co Washington (LA) Art (Men: 240 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 0 Exp change: 0)
      Art (ReceivingOnly) - 1003577 1st Co Washington (LA) Art (Men: 240 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 8 Lost: 0) Damage Done: 0 Exp change: 0)
      Art (ReceivingOnly) - 1003586 4th Co Washington (LA) Art (Men: 210 Lost: 0 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 7 Lost: 0) Damage Done: 0 Exp change: 0)
USA Stack Commander: NoStackCommand Exp change: 0
    Unit Commander: NoUnitCommand Exp change: 0
      Mil (Line) - 1007350 Volunteers (Men: 450 Lost: 450 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 15) destroyed by 9th VA 'Hansbrough's' Inf Bat Damage Done: 0 Exp change: 0)
      Mil (Line) - 1007344 26th Michigan (Men: 420 Lost: 420 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 14 Lost: 14) destroyed by 1st AL 'Clayton's Reg' Damage Done: 0 Exp change: 0)
      Reg (Line) - 1007345 153rd New York (Men: 450 Lost: 450 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 15) destroyed by Scott's Squadron VA Cavalry Damage Done: 1 Exp change: 0)
      Art (Support) - 1007347 Bat A 1st Connecticut Heavy Artillery (Men: 108 Lost: 0 Horses: 12 Lost: 0 Guns: 48 Lost: 0 Ships: 0 Lost: 0 (Hits: 12 Lost: 0) Damage Done: 4 Exp change: 0)
      Reg (Line) - 1007351 Light Infantry (Men: 450 Lost: 450 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 15) destroyed by 28th Virginia Damage Done: 0 Exp change: 0)
      Mil (Line) - 1007349 Bat C 1st Connecticut Heavy Artillery (Men: 450 Lost: 450 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 15) destroyed by 19th Virginia Damage Done: 1 Exp change: 0)
      Mil (Line) - 1007343 1st District of Columbia (Men: 450 Lost: 450 Horses: 0 Lost: 0 Guns: 0 Lost: 0 Ships: 0 Lost: 0 (Hits: 15 Lost: 15) destroyed by 1st South Carolina Infantry Damage Done: 0 Exp change: 0)


I think I won't mention horses, guns, and ships for the text/html output because we usually think of things in terms of men first. Also, I still have to aggregate men-type statistics to the division and stack levels.

Also, notice I've started integrating the host log file (for the date), the hst file (for the model type) and the models db csv (for the men per hit, guns per hit, etc). The next step is to add in regiments which were not involved (my interpretation is that regiments in stacks which are involved in a battle can have 4 dispositions: Support, Line, ReceiverOnly, and NotInvolved. Support and Line are categories given when a support or combat regiment is chosen to attack (it may also be chosen to be attacked), ReceiverOnly is what I'm calling it when a regiment is attacked but isn't chosen to attack, and NotInvolved is for regiments in a stack which aren't involved in the battle - note that being chosen to attack isn't the same as succeeding in making a hit).

Let me know what statistics I'm still missing and what else I need to do.

Also, I'm having difficulty compiling my perl script into an executable which can be used by people who don't have perl (I've had no luck with PAR, some with perl2exe, I'll keep trying). PM me if you think you might be able to help.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sat Aug 02, 2014 9:47 pm

Hhmm per2exe sounds reasonable, as there is a py2exe I have used in the past and works.
Ideally the program would be in the form of an exe.
It's a shame I'm on holiday otherwise I could help more, although my knowledge of perl is very limited.
Html output is easier to do.
If you use placeholders for the different lines and maybe variables for certain values, one could customize the standard html template you use.
For you it would mean making a simple html file and layout, reading the layout, and while you process the results, write the correct values in the output html file.

For stats of the game, you could use an SQLite database. First however, one would have to make a model of the tables needed and wanted for a first set of stats.
Then anyone could parse the result the way he or she wants or make other queries and so on.
One interesting stat I think adds to the immersion is a top 10 of units that fought the most battles, had the most casualties or inflicted the most.
As for a modding point of view, one could maybe add a experience to the unit with an event or add a medal in the stats part of the game.

So many possibilities *drool* :)

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Mon Sep 15, 2014 3:47 pm

I want to follow up on this. I've got the basic program working pretty well. There are a couple issues I didn't fix.

1) The log files can include multiple turns are not overwritten each turn but rather each time you start a game (so if you open a different save during play, I think it overwrites the log files). So when the output file is currently created, the date is wrong if your log files include multiple turns.

2) I don't care enough to figure out a perl to exe solution. Its just a perl script.

3) If a battle doesn't involve a unit in a stack that is involved, that unit doesn't appear. To find out about this unit I need to look at the main log file not the battle log file but I haven't done it.

I think I might fix 3 someday, but maybe not. Most of the usefulness of the script doesn't require 3. I won't be fixing 1 and 2 anytime soon.

I also have a couple notes:

I don't find the script to be that great. If I do a full AAR of a game I'm hosting, I might run it. My favorite use of it isn't to find out which regiment fights the most (by the time this is important, the game is over and I'm not curious anymore - it would matter more if I was doing an AAR). Rather, I like how it helps organize my understanding how battles are won and how experience is earned. This is information that is in the battle log but I didn't really figure out before.

I've settled with creating a csv file rather than a html file since general usability doesn't matter if I'm leaving it as a perl script.

In conclusion:

I haven't played a full CW2 game for a while, and want to play a full game running and cleaning the code before publishing. Of course, feel free to let me know if you have any particular requests. If you can't wait, msg me and I'll send along my current draft.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Wed Sep 17, 2014 11:53 am

To me, the script would be most usefull to indeed keep stats that aren't currently tracked in CWII.
In the improve CWII section I postes some interesting stats, at least to me they sound interesting.
If the script could be used for this or even adjusted to provide this kind of info, that would be great.
As I've told earlier, I also was looking towards creating something like this.

Anyway, if you have any info to share on what logs to parce for what, it could be a starting point for other people wanting to make such a tool,
even for other ageod games.

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Wed Sep 17, 2014 1:14 pm

When I post the code, I'll have it well commented and can post some pseudo-code as well. If you wanted to work together on it, I'd be happy for the help/to help you. If that is the case, I must note that I'm not a software developer at all and I'd be happy to overhaul things or port to a different language or whatever.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Thu Sep 18, 2014 9:30 am

OK, well I'll first try to get the logs active and then process them.
If I get anywhere (or not :) ), I'll let you know.

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Thu Sep 18, 2014 10:56 am

I just noticed that the logs changed between patches, so my script happens to be completely kaput right now. Also, the battle reports have changed (improved, I think) a little bit.

To help you get started, in the battle log battles are bounded by "<<<-----START----->>>", but a few lines above that you can find who fought in "GiveGroupsTargets". If you have large forces the regiments that are involved in a round are selected, then the battle is played out by range and round. In each round are a number of ranges (1st round artillery ranges are relevant, after that fewer) and at each range any regiment which can act at that range which was selected can target an enemy. The enemy targeted might not be one of the selected regiments (unselected regiments won't target but can be targeted). These targettings are called "actions". At the beginning of each round retreat is checked and if retreat happens, hits can be given.

Another big change to the logs between patches is the old logs spelled out all of the attack/defense bonuses (abilities, entrenchments) but the new one doesn't as much. I think it will be a bit easier to parse the new logs. But if the logs change between each patch, it makes me even less excited about this project. It is too bad that the developers don't do this.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Fri Sep 19, 2014 12:14 pm

Thanks for the info.
I already started programming yesterday before I saw you info.
It is indeed a very fragile system. If AGEOD changes something to the output of the battlelogs, you need to restart.
That's why it might be a fun system for us but not so great to release to the public.
If the devs leave the info as is, it would be easier.
Anyway, I'm having to much fun, and it's going to be the only way for me to have additional stats that I like so I'll keep programming and release it when it's usable.
Of course it would be more fun if they did the stats, but it's doable to program.

This is an excerpt from what I programmed in a couple of hours.
I list all units firing and assaulting as I want to know the most active units and so on.
Fun thing is, in the log I parsed from an old tur, it was the 3rd IN. Vol who were very active.
They are a light infantry unit.
In 1 battle they fired and assaulted 25 times, the next battle 23 times !
They only suffered about 150 casualties. Well only, it was 25% of the total men.
But I was surprised to see a light unit so active in assaulting and firing.

********************************************************************************
Battle 2
********************************************************************************
Region Knox, state IN on day 1
58 possible units involved
-- Round 0 - range 7
b" --> CSA unit Culpeper Artillery of T. Jackson' Corps firing"
b" --> CSA unit Culpeper Artillery of T. Jackson' Corps firing"
b" --> CSA unit State Volunteer Artillery of T. Jackson' Corps firing"
b" --> CSA unit State Volunteer Artillery of T. Jackson' Corps firing"
-- Round 0 - range 6
b" --> CSA unit Culpeper Artillery of T. Jackson' Corps firing"
b" --> CSA unit State Volunteer Artillery of T. Jackson' Corps firing"
-- Round 0 - range 5
b" --> CSA unit Staunton Artillery of T. Jackson' Corps firing"
b" --> CSA unit Staunton Artillery of T. Jackson' Corps firing"
b" --> CSA unit Raleigh Bty of T. Jackson' Corps firing"
b" --> CSA unit Georgia Artillery of T. Jackson' Corps firing"
b" --> CSA unit State Volunteer Artillery of T. Jackson' Corps firing"
b" --> CSA unit Raleigh Bty of T. Jackson' Corps firing"
b" --> CSA unit Georgia Artillery of T. Jackson' Corps firing"
b" --> CSA unit Culpeper Artillery of T. Jackson' Corps firing"

and so on

-- Round 5 - range 0
b" --> CSA unit 1st Raleigh Zouaves of T. Jackson' Corps assaulting"
b" --> CSA unit 4th Alabama of T. Jackson' Corps assaulting"
b" --> CSA unit 2nd & 11th MS of T. Jackson' Corps assaulting"
b" --> CSA unit 1st Alabama of T. Jackson' Corps assaulting"
b' --> USA unit Fort Jones of 23. Union Detachment assaulting'
b" --> CSA unit 1st Georgia Shp. of T. Jackson' Corps assaulting"
b" --> CSA unit 20. Volunteers (KY) of T. Jackson' Corps assaulting"
b" --> CSA unit 23. Volunteers (KY) of T. Jackson' Corps assaulting"
b" --> CSA unit 11th S.Carolina of T. Jackson' Corps assaulting"
b" --> CSA unit 4th N.Carolina of T. Jackson' Corps assaulting"
b" --> CSA unit 1st Georgia Vol. of T. Jackson' Corps assaulting"
b" --> CSA unit Fort Jones of T. Jackson' Corps assaulting"
b" --> CSA unit 32. Militia Garrison of T. Jackson' Corps assaulting"
b" --> CSA unit 26. Volunteers (KY) of T. Jackson' Corps assaulting"
b" --> CSA unit 16. Volunteers (KY) of T. Jackson' Corps assaulting"
b' --> USA unit 3rd Illinois of 23. Union Detachment assaulting'
Rounds 6, maximum range 7, minimum range 0
== Units involved ==
b'Fort Jones saw action 38 times, 26 firing, 12 assaulting'
b'1st Georgia Shp. saw action 27 times, 21 firing, 6 assaulting'
b'2nd & 11th MS saw action 21 times, 15 firing, 6 assaulting'
b'4th Alabama saw action 20 times, 14 firing, 6 assaulting'
b'1st Alabama saw action 20 times, 14 firing, 6 assaulting'
b'32. Militia Garrison saw action 20 times, 14 firing, 6 assaulting'
b'11th S.Carolina saw action 20 times, 14 firing, 6 assaulting'
b'20. Volunteers (KY) saw action 20 times, 14 firing, 6 assaulting'
b'1st Raleigh Zouaves saw action 20 times, 14 firing, 6 assaulting'
b'4th N.Carolina saw action 20 times, 14 firing, 6 assaulting'
b'16. Volunteers (KY) saw action 20 times, 14 firing, 6 assaulting'
b'26. Volunteers (KY) saw action 19 times, 13 firing, 6 assaulting'
b'23. Volunteers (KY) saw action 17 times, 11 firing, 6 assaulting'
b'1st Georgia Vol. saw action 17 times, 11 firing, 6 assaulting'
b'Raleigh Bty saw action 16 times, 16 firing, 0 assaulting'
b'Georgia Artillery saw action 16 times, 16 firing, 0 assaulting'
b'State Volunteer Artillery saw action 16 times, 16 firing, 0 assaulting'
b'Culpeper Artillery saw action 16 times, 16 firing, 0 assaulting'
b'Staunton Artillery saw action 14 times, 14 firing, 0 assaulting'
b'3rd Indiana saw action 13 times, 9 firing, 4 assaulting'
b'2nd Indiana saw action 13 times, 9 firing, 4 assaulting'
b'2nd N.Carolina saw action 11 times, 8 firing, 3 assaulting'
b'2nd Illinois saw action 10 times, 6 firing, 4 assaulting'
b'3rd Illinois saw action 10 times, 5 firing, 5 assaulting'
b'7th Indiana Mil. saw action 8 times, 6 firing, 2 assaulting'
b'9th Indiana Mil. saw action 7 times, 5 firing, 2 assaulting'
b'4th Indiana Mil. saw action 3 times, 3 firing, 0 assaulting'
b'5th Indiana Mil. saw action 2 times, 2 firing, 0 assaulting'

And so on for all battles.
Then afterwards, I do some top stats

-- Unit totals top 10 --
b'Sharpshooters saw action 214 times'
b'Fort Jones saw action 64 times'
b'3rd IN Vol. saw action 48 times'
b'26th Illinois saw action 40 times'
b'8th Illinois saw action 39 times'
b'29th Illinois saw action 39 times'
b'25th Illinois saw action 37 times'
b"9th IL 'Brockett's' saw action 37 times"
b'5th Minnesota saw action 36 times'
b'10th Indiana saw action 36 times'
----------------------------------------

-- Unit firing top 10 --
b'Sharpshooters fired 168 times'
b'Fort Jones fired 47 times'
b'3rd IN Vol. fired 37 times'
b'1st OH Lt., Bty.A fired 31 times'
b'26th Illinois fired 29 times'
b'1st OH Lt., Bty.B fired 29 times'
b"1st IL, Bty.B '2nd Chicago Lt.' fired 28 times"
b'8th Illinois fired 28 times'
b'29th Illinois fired 28 times'
b'25th Illinois fired 26 times'
----------------------------------------

-- Unit assault top 10 --
b'Sharpshooters assaulted 46 times'
b'Fort Jones assaulted 17 times'
b'3rd IN Vol. assaulted 11 times'
b'5th Minnesota assaulted 11 times'
b'1st IN Vol. assaulted 11 times'
b'26th Illinois assaulted 11 times'
b'8th Illinois assaulted 11 times'
b"9th IL 'Brockett's' assaulted 11 times"
b'10th Indiana assaulted 11 times'
b'29th Illinois assaulted 11 times'
----------------------------------------

I still need to find the info on how I can find the generals involved.
Is this the line you are referring too?
GiveGroupsTargets 1010753 J. Hooker' Corps initiating fight against faction 1000002 engaging: 1011404 E. Johnson' Detachment

How can you find other generals involved?
I noticed some actions where you can find more info:

18:01:32 (Reporting) *** Start of action # 5 1003427 1st PA Lt., Bty.A vs 1010534 Fort Jones ***
18:01:32 (Reporting) 1st PA Lt., Bty.A - Commander: Joseph B. Hooker Cmd Coeff. %: 125
18:01:32 (Reporting) Fort Jones - Commander: Edward Johnson Cmd Coeff. %: 115
18:01:32 (Reporting) Battle effectiveness with leader rating: 110.00%
18:01:32 (Reporting) *** End of action ***

Here I find the commanders of both selected units I think.
In other action parts, there is even a unit commander
18:01:32 (Reporting) *** Start of action # 12 1003796 2nd Maine vs 1010532 Fort Jones ***
18:01:32 (Reporting) 2nd Maine - Commander: Joseph B. Hooker Cmd Coeff. %: 125
18:01:32 (Reporting) Fort Jones - Commander: Edward Johnson Cmd Coeff. %: 115
18:01:32 (Reporting) 2nd Maine - Unit Commander: T. Runyon Cmd Coeff. %: 109

If I add up all the commanders, I should have all commanders involved (I hope :) )

How do you get the number of casualties? It's calculated from the hits?
18:01:32 (Reporting) *** Start of action # 136 1003826 39th New York vs 1008581 Edward Johnson ***
18:01:32 (Reporting) 39th New York - Commander: Joseph B. Hooker Cmd Coeff. %: 125
18:01:32 (Reporting) Edward Johnson - Commander: Edward Johnson Cmd Coeff. %: 115
18:01:32 (Reporting) 39th New York - Unit Commander: Jesse L. Reno Cmd Coeff. %: 106
18:01:32 (Reporting) Edward Johnson - Unit Commander: Edward Johnson Cmd Coeff. %: 100
18:01:32 (Reporting) Battle effectiveness with leader rating: 116.00%
18:01:32 (Reporting) Attacker DmgDone: 2 CohDone: 10 AsltDmgDone 2 AsltCohDone: 12
18:01:32 (Reporting) Attacker ToHit: 7.00 rolled a 5 scoring a hit Defender remaining Health&Cohesion 0 / 62
18:01:32 (Reporting) *** End of action ***

For instance in the above case, it's a hit from the 39th New York on Edward Johnson.
How many casualties is a hit and it probably depends on the unit it was targeting?
Also, does the 0 /62 at the end mean the unit is destroyed?

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Fri Sep 19, 2014 12:52 pm

Great work. I'll give some replies based on my experience, but I want to note that it might not apply to the new log format.

minipol wrote:Fun thing is, in the log I parsed from an old tur, it was the 3rd IN. Vol who were very active.
They are a light infantry unit.


Yeah, initiative is a big deal. I was surprised that when a fight goes multiple rounds, light infantry and sharpshooters don't retire in later rounds. Both have non-zero protection, so that helps, though. Also, both have low firepower, so they don't actually land a hit too often, so it makes sense, more or less.

minipol wrote:I still need to find the info on how I can find the generals involved.
Is this the line you are referring too?
GiveGroupsTargets 1010753 J. Hooker' Corps initiating fight against faction 1000002 engaging: 1011404 E. Johnson' Detachment


Right, so the name of the stack usually includes the name of the leader of the stack, so it is good to have your code notice that - for instance, I'm not sure how the logs handle MTSG. It seems to me that when a corps and army is involved, only the stack commander appears under "actions" and only the first stack involved shows up in the "initiating fight" part so you don't really get a full picture of army hierarchy other than corps hierarchy (ie in the logs, the Army stack just looks like another stack). But the relevant stack commander is actually the person listed at the start of the action. As you noticed, when a stack commander is present, he is named as "commander". And when a brigade or division exists, its commander is listed as "Unit Commander".

minipol wrote:If I add up all the commanders, I should have all commanders involved (I hope :) )


Close, if a commander is in a region but none of his units attacks or is targeted, he won't show up. If you want to find him, you need to look in the hst file, I think.

minipol wrote:How do you get the number of casualties? It's calculated from the hits?
[...]
For instance in the above case, it's a hit from the 39th New York on Edward Johnson.
How many casualties is a hit and it probably depends on the unit it was targeting?
Also, does the 0 /62 at the end mean the unit is destroyed?


Yeah, there is a statistic called hits per man in the models files.

In the next posts, I'm going to post some of my code, maybe it will help in a couple places

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Fri Sep 19, 2014 12:54 pm

I use a lot of hashes, it helps make everything much easier. If you know how to code databases (I don't really, but in perl hashes play this role), then you can ignore this. Anyway, here is code for how my output is written - it shows how I use hashes for pretty much everything:

Code: Select all

print SHEET "Battle in $region on day $day of $date. Attack by $stacktargeter on $stacktarget.  Region terrain is $terrain and weather is $weather.";
if($retreater ne ""){print SHEET " At the end of the battle, $retreater retreated, taking $hitsretreat hit(s).\n";}
else{ print SHEET "\n";}
foreach my $side (sort keys %types) {
   print SHEET "\t$side (Men: $sidemen{$side} Lost: $sidemenlost{$side})\n";
    foreach my $stackcom (keys %{ $types{$side} }) {
      print SHEET "\t\tStack Commander: $stackcom (Men: $stackmen{$stackcom} Lost: $stackmenlost{$stackcom} Exp change: $exp{$stackcom})\n";
       foreach my $unitcom (keys %{ $types{$side}{$stackcom} }) {
         print SHEET "\t\t\tUnit Commander: $unitcom (Men: $unitmen{$unitcom} Lost: $unitmenlost{$unitcom} Exp change: $exp{$unitcom})\n";
         foreach my $regiment (keys %{ $types{$side}{$stackcom}{$unitcom} }) {
            if(!($regiment =~ m\NoReg\)){
               print SHEET "\t\t\t\t$types{$side}{$stackcom}{$unitcom}{$regiment} - $regiment ";
               print SHEET "($regdata{$regiment})\n";
            }
         }
      }
    }
}

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Fri Sep 19, 2014 1:42 pm

The other thing I wanted to mention in its own post is that to get the number of men per hits, its easier to use the csv files from the DB that pocus posted in the mod forum. Here is how my code does it:

In the battle log, we have a number of unit names. In the log the unit names are preceded by a number. This number is useful if two units happen to have the same name (this mostly happens with garrison units).

Code: Select all

my $file = $dir.'\CW2_DB_Models_v9q.csv';

my $csv = Text::CSV_XS->new( { sep_char => ";" } )
    or die "Cannot use CSV: " . Text::CSV->error_diag();

open (CSV, "<:encoding(UTF-8)", $file) or die $!;
while (<CSV>) {
   if ($csv->parse($_)) {
      my @columns = $csv->fields();
      $unitname{$columns[0]} = $columns[2];
      $unitnumber{$columns[3]} = $columns[0];
      $unitnameconv{$columns[0]} = $columns[7];
      $unitnameconv{$columns[0]} =~ s|\$||;
      if($unitnameconv{$columns[0]} =~ m\NULL\){
         $unitnameconv{$columns[0]}=$columns[3];
      }
      $menperhit{$columns[0]} = $columns[38];
      $gunsperhit{$columns[0]} = $columns[40];
      $horsesperhit{$columns[0]} = $columns[39];
      $shipsperhit{$columns[0]} = $columns[41];
      $i=2;
      @temp=();
      while($columns[$i]){
         push(@temp, "$columns[$i]");
         $i++;
      }

      $number++;
   } else {
      my $err = $csv->error_input;
      print "Failed to parse line: $err";
   }
}
close CSV;


Column 0 of that csv is the model ID number, which is key. Note, this is different from the unique number in the battle log we found earlier. For many units, the model statistics are based on the statistics of a different model. So unitnameconv looks for the name of the model those statistics are based on. If you look in the DB, you'll see CSA infantry models are based on CMN infantry models, so we need to look at CMN infantry statistics (Check out the DB, hopefully this makes sense).

Now you need to look in the hst file (while there, get which turn you are on). Find the "btllog" for the relevent battle. To do this, look for the string "btllog" which follows the name of the region the battle occurred. If there were two battles in that region, just keep an eye on both of them, it doesn't matter at the moment which is which. The code in the hst of the battle will look something like this:

Code: Select all

597|1|593|1|232|2|229|1|227|2|182|1|¤94|1|¤ | |¤ | |¤ | |¤ | |¤100¤100¤12¤0¤0¤25¤593¤0¤1¤3¤3¤6¤1¤6¤1¤1¤0¤0¤0¤1¤1¤0¤0¤0¤0¤51¤55¤0¤0¤0¤1¤124¤27¤1¤6¤0¤1¤100¤100¤0¤0¤0¤0¤-1¤0¤0¤0¤0¤0¤0¤0¤0¤0¤0¤0¤0¤0¤2702¤900¤0¤30¤30¤0¤600¤600¤0¤210¤210¤0¤1¤1444¤1¤2¤2678¤-6926¤-4095¤593|3|1|1|1|0|597|3|1|1|1|0|¤NoLeader¤#BtlLog#NULL#BtlLog#NULL#BtlLog#1003444|0|L. Blenker|L. Blenker' Force|L. Blenker|879|1|72|0|1|72|0|0|0|0|0|593|3|1|1|0|1|1|L. Blenker{593{|PH3|PH4|PH5|PH6|PH7|PH8|1003342|0|Western Volunteers|L. Blenker' Force|L. Blenker|441|46|234|0|46|202|0|3|13|0|0|597|3|1|1|34078722|7|4|A. Howe{597{Manning Rifles{182{24th Kansas{232{35th Iowa{232{|PH3|PH4|PH5|PH6|PH7|PH8|1003339|0|Kansas Mounted Volunteers|L. Blenker' Force|L. Blenker|442|30|109|1|29|76|1|4|16|1|12|-1|0|0|0|101187586|4|2|2nd Kansas{227{1st Kansas{227{|PH3|PH4|PH5|PH6|PH7|PH8|#BtlLog#1004389|0|Rives'|Rives'|NULL|55|20|85|0|13|42|0|1|12|7|29|-1|0|0|0|1|2|1|MO Cavalry{94{|PH3|PH4|PH5|PH6|PH7|PH8|#BtlLog#¤BPL¤30|30|0|0|0|0|0|0|0|0¤210|210|0|0|0|0|0|0|0|0¤2702|900|0|0|0|0|0|0|0|0¤600|600|0|0|0|0|0|0|0|0¤PH6¤PH7¤PH8¤PH9¤PH10


The model ID for each unit comes just after the element name, ie "A. Howe{597{Manning Rifles{182", where "A. Howe's" model is "597" and "Manning Rifles" model is "182". Both of these the number of men per hit is NULL, so our code will have to convert these. Then that ID can be plugged into the menperhit (and guns, horses, and ships) hash I already created. Then when I see that name in the battle log, I know what the ID is and how many men per hit it should have.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Fri Sep 19, 2014 8:56 pm

Cool, thanks for the info !
I started to optimize the first run through a battle log, so the code is clear when trying to add new stuff.
Well, it confused me a bit.

The offical start of <<<-----START----->>>, but a few lines above.
It's starts with Battle in 255 Richmond, VA Day: 1 Round: 0
then followed by GiveGroupsTargets like you said.
Then you get the START sign, followed by signs.
The end of a battle is a bit tricky to detect.
Again, I noticed because I tried to optimize the code.
This is the end of a battle.
First a round starts (Round: ...), and the line after it ends (Round 0 ended)
to start another round in the battle again: Battle in ...
However, the troops are not commited and as such, then it goes on to the next battle.

18:01:32 (Reporting) Round: 0 Battle is now at range 0
18:01:32 (Reporting) Round 0 ended
18:01:32 (Reporting) Battle in 255 Richmond, VA Day: 1 Round: 1
18:01:32 (Reporting) Commit Chance 1010753 J. Hooker' Corps 65 %, Rolled: 91 Not commited
18:01:32 (Reporting) Commit Chance 1011370 R. Milroy' Corps 55 %, Rolled: 59 Not commited
18:01:32 (Reporting) Commit Chance 1010753 J. Hooker' Corps 65 %, Rolled: 82 Not commited
18:01:32 (Reporting) Commit Chance 1011370 R. Milroy' Corps 55 %, Rolled: 71 Not commited
18:01:32 (Reporting) Battle in 816 Knox, IN Day: 1 Round: 0

Printing a few clear tags that aren't changing-between-patches would make it a lot easier to capture the necessary data.
Parsing the individual attacks from a battle is easy enough, but getting all the info in such as involved units and so on, that's something else.

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sat Sep 20, 2014 3:34 pm

A small update. I now read the file first in an array, marking the start and the end of each battle line.
Some battle lines mean a new battle, some are a continuation of another battle.
I mark these spots, and now I have the start and end of each battle which allows me to capture the needed info more easily then before.
Should be handier to get the stats out in a structured manner :)
To be continued

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sun Sep 28, 2014 12:06 am

Already a step further in parsing thanks to tripax.
I can read the hst file to get the model id for a unit, and then use that id to lookup the info in the csv file.
When I try to do that in a battle, the numbers don't add up.

This is a battle where the Union received 75 casualties, the CSA 90.
The info from the battle log

22:42:57 (Reporting) *** Start of action # 15 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 5 scoring a hit Defender remaining Health&Cohesion 8 / 87
22:42:57 (Reporting) *** End of action ***

22:42:57 (Reporting) *** Start of action # 18 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 6 scoring a hit Defender remaining Health&Cohesion 9 / 58
22:42:57 (Reporting) *** End of action ***

22:42:57 (Reporting) *** Start of action # 21 1005859 3rd New Mexico Cav. vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 12 scoring a hit Defender remaining Health&Cohesion 9 / 57
22:42:57 (Reporting) *** End of action ***

22:42:57 (Reporting) *** Start of action # 22 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 5 scoring a hit Defender remaining Health&Cohesion 7 / 78
22:42:57 (Reporting) *** End of action ***

22:42:57 (Reporting) *** Start of action # 26 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 9 scoring a hit Defender remaining Health&Cohesion 9 / 83
22:42:57 (Reporting) *** End of action ***

If I check the models, all the units end up as either 137 or 226 which end up being Rangers (mdl_CMN_Ran)
The stats for hit are 10, men per hit 15. Horses per hit is 0 (which seems kind of weird).
Now how do I calculate the casualties from these numbers.
I tried to count every hit as 15 men, but that doesn't add up.
Otherwise the Union would have 45 casualties, the CSA 30.

Is the Attacker DmgDone important? For all 5 attacks it is 1.
Or the ToHit factor? Again, for all attacks it's 12. Does the dice role affect the number of casualties or is it just a hit or no hit?

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sun Sep 28, 2014 12:12 am

Sorry double post

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Sun Sep 28, 2014 1:10 am

It looks to me like you are correct. Are you sure you aren't missing actions where a hit landed? I worry that the battlelog might miss actions or something.

Great job so far!

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Sun Sep 28, 2014 4:09 am

There may have been retreat or routing hits. You need to look at the units and see how many hits they took (check the elements in game, not just the combat log). That could explain the difference.
Remember - The beatings will continue until morale improves.
[SIGPIC][/SIGPIC]

User avatar
ohms_law
AGEod Veteran
Posts: 725
Joined: Sun Oct 19, 2008 5:42 pm
Location: Syracuse, NY

Sun Sep 28, 2014 4:17 am

The line with "Attacker DmgDone 1 CohDone 7" etc... looks like flags of some sort. Maybe. Like, "this unid did damage, did cohesion damage, did assault damage, did assault cohesion damage", or maybe "is able to do damage".

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Sun Sep 28, 2014 9:08 am

Can you post the BattleLog so we can look at it more closely?

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sun Sep 28, 2014 11:59 am

Thanks for the help. Here is the full battle log of that battle:


22:42:57 (Reporting) Battle in 1905 East Soccoro, NM Day: 14 Round: 0
22:42:57 (Reporting) Commit Chance 1009316 51. CSA Detachment 30 %, Rolled: 16 Commited
22:42:57 (Reporting) GiveGroupsTargets 1009316 51. CSA Detachment initiating fight against faction 1000001 engaging: 1003916 17. Union Detachment
22:42:57 (Reporting) 1003916 17. Union Detachment new target is 1009316 51. CSA Detachment
22:42:57 (Reporting) Checking combat stance for United States of America in region 1905 East Soccoro, NM
22:42:57 (Reporting) Preliminary test: No need to retreat from this battle: OppPower: 51 FacPower: 88 .
22:42:57 (Reporting) Checking combat stance for Confederate States of America in region 1905 East Soccoro, NM
22:42:57 (Reporting) InCS %: 0 New Retreat Will %: 100
22:42:57 (Reporting) Ammo %: 100 New Retreat Will %: 100
22:42:57 (Reporting) Weighted average of Trench levels: 0
22:42:57 (Reporting) Power of opponents compared to us: 172.55 % Base Retreat Will: 73.00 %
22:42:57 (Reporting) Dice rolled: 30
22:42:57 (Reporting) => We will try to retreat
22:42:57 (Reporting) Dice rolled: 83
22:42:57 (Reporting) 51. CSA Detachment failed to retreat
22:42:57 (Reporting) Group 51. CSA Detachment has failed to retreat
22:42:57 (Reporting) <<<-----START----->>>
22:42:57 (Reporting) Starting CheckBattles, a battle occurs in region East Soccoro, NM at day 14
22:42:57 (Reporting) Checking Battle Abilities given by 1003916 17. Union Detachment
22:42:57 (Reporting) Checking Battle Abilities given by 1009316 51. CSA Detachment
22:42:57 (Reporting) GetRound SubList 6 SUs can be involved during this round.
22:42:57 (Reporting)
22:42:57 (Reporting) Round: 0 Battle is now at range 3
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1003918 1st New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 1 1003918 1st New Mexico Cav. vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005862 4th NM 'Carleton's Rangers' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 2 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1004741 2nd NM 'Carsons' New Mexico Cav.' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 3 1004741 2nd NM 'Carsons' New Mexico Cav.' vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1004741 2nd NM 'Carsons' New Mexico Cav.' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 4 1004741 2nd NM 'Carsons' New Mexico Cav.' vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005859 3rd New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 5 1005859 3rd New Mexico Cav. vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1003918 1st New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 6 1003918 1st New Mexico Cav. vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005862 4th NM 'Carleton's Rangers' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 7 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1003918 1st New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 8 1003918 1st New Mexico Cav. vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005034 San Elizario's firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\2nd NM 'Carsons' New Mexico Cav.'
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 9 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1004741 2nd NM 'Carsons' New Mexico Cav.' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 10 1004741 2nd NM 'Carsons' New Mexico Cav.' vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005862 4th NM 'Carleton's Rangers' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 11 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005032 Hunter's Rangers firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\1st New Mexico Cav.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 12 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005859 3rd New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 13 1005859 3rd New Mexico Cav. vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005034 San Elizario's firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\2nd NM 'Carsons' New Mexico Cav.'
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 14 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005032 Hunter's Rangers firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\1st New Mexico Cav.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 15 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 5 scoring a hit Defender remaining Health&Cohesion 8 / 87
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005032 Hunter's Rangers firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\1st New Mexico Cav.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 16 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005034 San Elizario's firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\2nd NM 'Carsons' New Mexico Cav.'
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 17 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Changing range
22:42:57 (Reporting)
22:42:57 (Reporting) Round: 0 Battle is now at range 2
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005862 4th NM 'Carleton's Rangers' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 18 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 6 scoring a hit Defender remaining Health&Cohesion 9 / 58
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1003918 1st New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 19 1003918 1st New Mexico Cav. vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1004741 2nd NM 'Carsons' New Mexico Cav.' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 20 1004741 2nd NM 'Carsons' New Mexico Cav.' vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005859 3rd New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 21 1005859 3rd New Mexico Cav. vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 12 scoring a hit Defender remaining Health&Cohesion 9 / 57
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005032 Hunter's Rangers firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\1st New Mexico Cav.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 22 1005032 Hunter's Rangers vs 1003918 1st New Mexico Cav. ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 5 scoring a hit Defender remaining Health&Cohesion 7 / 78
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005034 San Elizario's firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\2nd NM 'Carsons' New Mexico Cav.'
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 23 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Changing range
22:42:57 (Reporting)
22:42:57 (Reporting) Round: 0 Battle is now at range 1
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005862 4th NM 'Carleton's Rangers' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\San Elizario AZ Spy co.
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 24 1005862 4th NM 'Carleton's Rangers' vs 1005034 San Elizario's ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1004741 2nd NM 'Carsons' New Mexico Cav.' firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 25 1004741 2nd NM 'Carsons' New Mexico Cav.' vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: CSA 51. CSA Detachment 1005034 San Elizario's firing
22:42:57 (Reporting) Target unit is: United States of America\17. Union Detachment\2nd NM 'Carsons' New Mexico Cav.'
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 26 1005034 San Elizario's vs 1004741 2nd NM 'Carsons' New Mexico Cav.' ***
22:42:57 (Reporting) Attacker DmgDone: 1 CohDone: 7 AsltDmgDone 1 AsltCohDone: 7
22:42:57 (Reporting) Attacker ToHit: 12.00 rolled a 9 scoring a hit Defender remaining Health&Cohesion 9 / 83
22:42:57 (Reporting) *** End of action ***
22:42:57 (Reporting)
22:42:57 (Reporting) Picked: USA 17. Union Detachment 1005859 3rd New Mexico Cav. firing
22:42:57 (Reporting) Target unit is: Confederate States of America\51. CSA Detachment\Hunter's AZ Rangers
22:42:57 (Reporting) Defender failed to disengage.
22:42:57 (Reporting)
22:42:57 (Reporting) *** Start of action # 27 1005859 3rd New Mexico Cav. vs 1005032 Hunter's Rangers ***
22:42:57 (Reporting) *** End of action ***

minipol
General
Posts: 560
Joined: Fri Oct 11, 2013 1:24 pm

Sun Sep 28, 2014 12:18 pm

Also, if the round start at range 0, the assault phase, should i take the assault damage from the csv or does it remain "men per hit"?
As for retreats, how are those casualties calculated? Should I watch for units destroyed? Even so, how do I know how many casualties they had?

As an example of the previous battle, I report the individual attacks and at the end of each battle, I give some stats.
After the nr of casualties is correct, I will start to clean up the code, and send the output per turn to a html file.
Step after that is to write the stats to a database.
If I code a frontend on it, it will be usable as a tool for everybody and then I'll release it.

Rounds 1, maximum range 3, minimum range 1
USA men killed 20, CSA men killed 30

== Top 10 units firing ==
b"2nd NM 'Carsons' New Mexico Cav.' fired 5 times"
b"San Elizario's fired 5 times"
b"4th NM 'Carleton's Rangers' fired 5 times"
b'1st New Mexico Cav. fired 4 times'
b'3rd New Mexico Cav. fired 4 times'
b"Hunter's Rangers fired 4 times"

== Top 10 units assaulting ==

== Top 10 units targeting ==
b"San Elizario's targetted 9 times"
b"Hunter's Rangers targetted 9 times"
b"2nd NM 'Carsons' New Mexico Cav.' targetted 5 times"
b'1st New Mexico Cav. targetted 4 times'

== Units involved ==
b"2nd NM 'Carsons' New Mexico Cav.' saw action 5 times, 5 firing, 0 assaulting and was targeted 5"
b"San Elizario's saw action 5 times, 5 firing, 0 assaulting and was targeted 9"
b"4th NM 'Carleton's Rangers' saw action 5 times, 5 firing, 0 assaulting and was targeted 0"
b'1st New Mexico Cav. saw action 4 times, 4 firing, 0 assaulting and was targeted 4'
b'3rd New Mexico Cav. saw action 4 times, 4 firing, 0 assaulting and was targeted 0'
b"Hunter's Rangers saw action 4 times, 4 firing, 0 assaulting and was targeted 9"

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Sun Sep 28, 2014 12:54 pm

re: earlier question: What comes next in the log? If that is it, then I really don't know. In the previous version of the log, the logs told how many hits involved elements had at the beginning of the battle and after each hit received - I used that to count hits rather than DmgDone/AsltDmgDone which didn't really make sense to me. Next time I play, I'll look at the new log more and see what I can see.

re: retreat: Further down in the battle from what you posted, there should be a message about hits taken in retreat. I didn't figure out how those were distributed, the message just tells how many hits were taken by the whole group. I imagine it is deterministic and just not spelled out, but who knows.

What you've got looks really great! Keep it up!

User avatar
ohms_law
AGEod Veteran
Posts: 725
Joined: Sun Oct 19, 2008 5:42 pm
Location: Syracuse, NY

Sun Sep 28, 2014 1:40 pm

I'm following this too. I tend to prefer C# myself, mostly because it's a RAD platform and I'm quite familiar with it. Once you guys have the details nailed down I may create a program to do this myself. I was thinking about doing exactly that anyway, when I figured out that the battle log existed a couple of weeks back.

Return to “Civil War II”

Who is online

Users browsing this forum: No registered users and 4 guests