Cort's Constructs

Welcome Guest ( Log In | Register )

AGSM v1.0 (The Allegiance Game Stats Merger)

Posted by Cort, Sep 25 2015, 06:36 PM in Tools

Cort's Constructs presents AGSM v1.0, the AllegGameStatsMerger.


Note: AGSM has already received some updates, but the link to the latest version has been edited into this post.


Overview

AGSM can take stats screenshots you made from within Allegiance (using the 'PrntScr' button on the stats page) and merge them into one complete image.

Allegiance currently doesn't allow you to export game stats. What you can do is take screenshots of the stats pages. Unfortunately, only twelve players will be shown per screenshot. But if you want to post the stats of a game on the forum, you'll want to include all players.

The usual way the community handles this is to take screenshots of all the pages, then merge them manually in some raster image editor. AGSM automates the last of these steps. It will *not* help you take the actual screenshots, it can just combine them to one image.

If you follow some simple rules, you'll end up with pretty clean images, looking like this:




Usage

AGSM is designed for taking as much work from you as possible. So almost everything is automated.

That means, AGSM will automatically try to find 'clusters' in your screenshots. It will analyse when you took those screenshots and will group all those together taken in short intervals.

It will also analyse and reorder them depending on the position of the scrollbar included in the screenshots. Therefore, it doesn't matter in which order you take them. You can go upside down or downside up or even jump around like crazy, it doesn't matter.

The screenshots can also overlap. You can take them using page scrolling (clicking the scrollbar above or below the 'thumb'), but you'll get better results if you create them with a bit of overlap. The overlapping parts with automatically be removed.

Let's have a look at a screenshot of the GUI and talk about the controls and what they do.

  1. Here you can select the source directory, i.e. the directory your screenshots are in. The Allegiance directory should be entered there by default, so there's normally nothing to do.
  2. The 'screenshot timeframe' determines how your screenshots are grouped into clusters. Two screenshots will be considered as being in different clusters if the first screenshot of one cluster has been taken more than the amount of seconds you enter here after the last screenshot of the previous cluster. Another way to look at it would be that if you put 60s here, you'll have to wait 60s after taking one set of screenshots before you start the next. In general, this value should do fine and there shouldn't be any need to adjust it.
  3. Click the 'Process' button to start the processing. This will fill the list box marked with (4). (It's empty when you start the application.) Click it again to abort it.
  4. You'll get a list of the detected clusters and when you started to take them. Pay attention to those being marked with '[WARNINGS]', something went wrong there. Those having '[FAILED]' can't be saved. (Probably because it's not a cluster of stats screenshots.) Select a cluster here to see the merged image in (5).
  5. You can see the final image here. Make sure no player is missing.
  6. The log will tell you everything the application has done to merge the screenshots together. Pay attention to lines like 'merging failed' or 'file discarded' (but those also generate warnings in the cluster list).
  7. The application will suggest to save the file in the directory your screenshots came from and will suggest a filename based on the time the screenshots were taken. This filename is also 'URL-compatible', i.e. you can upload the file and link it without having to do any escaping of special characters. Nevertheless, you can change it if you want.
  8. Click on 'Save' to write the image you saw in (5) to the disk.

Usage summary

Launch the application, click on 'Process', select cluster, click on 'Save', upload file and post.


Limitations
  • Screenshots using Slipstream GUI are not supported.
  • Whether there are general problems with merging, only your tests will tell. I couldn't produce any with my screenshots…
  • Processing is rather fast, but might take some memory. I have a maximum memory usage of 75MB for a short time with about 90 screenshots in my directory. It completely depends on how many of those have to be merged and how many are actually stats screenshots, so YMMV. But yeah, optimisations would most probably be possible.

Tips for getting best results
  • You can use page scrolling (clicking the scrollbar above or below the 'thumb'), but you'll end up with the white lines following the first player of a page then. You'll get better results if you scroll with some overlap, e.g. by taking a screenshot every half page.
  • Make sure you move the mouse cursor away from the stats region and also don't have it hovered over the scrollbar. Just flick your mouse so the cursor moves to some corner of the screen, then press the button. smile.gif
  • Don't have a line in the stats selected. If you accidentally did select one, just switch to the game lobby and back to the stats and it will disappear.
  • Don't change the sorting order while taking your set of screenshots (duh).
  • Screenshot in fullscreen mode. (I actually haven't tested what happens when you screenshot in windowed mode.)

Reporting bugs

When you're reporting bugs or incorrect merge results, PLEASE also upload/e-mail me the files you tried to process (no worries, BMPs are compressed to tiny archives, even when using a crappy format like ZIP, and I can uncompress pretty much anything) and the shown log. If I can't reproduce it, your report is pretty worthless. sad.gif


Download

Download: AGSM v1.11 installer [Release Notes]
(Access to the source code repository on request.)


Upgrades

Whether I'll proceed working on this depends on whether there's actually any interest in using it. An excerpt from my to-do list:

CODE
v2.0:
    GUI:
    • define minimum size for window
    • change mouse cursor to hourglass while processing?
    • second colon in output filename leads to weird bug
    • replace the ugly file/dir pickers with editbox+icon
    • double-buffering / get rid of preview flickering
    • save GUI window size/position
    
    Processing:
    • do some profiling on the actual merging process and optimise progress bar
    • free cropped images asap / reduce memory usage
    • add button to open merged image in image editor
    • optionally delete merged images
    
    Error handling/reporting:
    • catch&log any unexpected exceptions occuring during merging
    • show proper error message for unexpected exceptions from the GUI
    • log exceptions from processing or GUI and allow them to be automatically submitted
    • implement 'check for updates'
    • optimise process of creating empty preview imagebox (or get rid of imagebox and use wxDC, f.e.)

    Meta:    
    • Installer: optionally create desktop/quicklaunch shortcut (see Components/Tasks pages), run application at the end when installation is finished



Final remark: Yes, indeed, it would have made more sense to just add f.e. CSV support to the Alleg client. But this was a lot more fun and I learned more from it. smile.gif


-- Cort

[EDIT 2007-09-30: Updated post to v1.1 (screenshots unmodified)]
[EDIT 2007-12-03: Updated post to v1.11 (screenshots unmodified)]



Comments

  Padre, Sep 25 2007, 11:48 PM

Nice. Now I post in Dev forum. smile.gif

  Aaron Moore, Sep 26 2007, 02:10 AM

Awesome work Cort!!

I was wondering how you did that.

Thanks for sharing, this is very cool.

mrgreen.gif

  madpeople, Sep 26 2007, 05:45 AM

QUOTE
While writing this post, I noticed that the width cap in this forum seems to be 600 pixels. Any wider and it will resize to 600 pixel width, which looks ugly. That's unfortunate, because AGSM always creates images of 612 pixels width. Whether or not I'm going to continue working on this project, I'll probably fix that.

psst! cut off the scroll bar in the final image wink.gif

(if you wanted to be clever, you could try cutting off the scrollbar, but keeping the rounded edges (ok, you just need to cut off the bar, then add on a separate edge image on top..)

  Cort, Sep 26 2007, 05:49 AM

QUOTE(madpeople @ Sep 26 2007, 12:45 PM)
psst! cut off the scroll bar in the final image wink.gif

(if you wanted to be clever, you could try cutting off the scrollbar, but keeping the rounded edges (ok, you just need to cut off the bar, then add on a separate edge image on top..)

LOL!

Well, madp, to be honest, the scroll bar *is* cut off. The one you see is hand-drawn by the application back into the final image (after merging regions without scrollbar) to make it look more like a real screenshot. mrgreen.gif

I thought it looked kinda ugly without any scrollbar, so I added one back in. Something was missing...


-- Cort

PS: The twelve pixels can also easily be saved by cutting off black regions. The screenshot in the post actually *is* only 600 pixels wide.

This post has been edited by Cortex: Sep 26 2007, 05:52 AM

  ImmortalZ, Sep 26 2007, 01:44 PM

Sweet stuff Cort. Good to see this released mrgreen.gif

Last I hear, aarm is jumping around in glee due to this util saving him 30 mins of pain after SGs.

  Your_Persona, Sep 28 2007, 03:01 AM

Cort I started working on an OCR library that can post process the output from your AGSM.

Here is after 1.5 evenings of work.



There is a little bug in the OCR as far as the points column is concerned. Nothing very hard to fix, it just misses the '1's if they are 1st or 2nd char.

I have also not yet implemented the alphabetic part for reading the player name. Maybe another evening for this.

If you are interested in this at all, then I can give you a SVN repo for the library.


It's also getting quite fast. That is what I've been spending the most time on recently.

  Cort, Sep 28 2007, 06:11 AM

Very cool, even though I would have expected a response like "what a useless tool, I can code the export into the client in 60 minutes" from you. mrgreen.gif Seems like you agree that this is more fun. smile.gif

Yeah, can you generate me a random password and give me access to your repo? Or ask me for an account for mine and commit it there. wink.gif

I'm afraid you didn't write this in Python so we could integrate it directly into AGSM?


-- Cort

  madpeople, Sep 28 2007, 06:35 AM

QUOTE(Cortex @ Sep 26 2007, 11:49 AM)
PS: The twelve pixels can also easily be saved by cutting off black regions. The screenshot in the post actually *is* only 600 pixels wide.

yeah, i thought about the black bits, but they could be a little trickier to do i thought...
and i did notice it was 600px wide, so i was slightly confused by the statement of it supposed to be 612vs the image posted, wasn't sure if the one you posted you had edited to make 600 px wide so it looked nicein the post, or if you had fixed it to make them 600 wide, but not changed the 612 statement

  Cort, Sep 28 2007, 06:50 AM

QUOTE(madpeople @ Sep 28 2007, 01:35 PM)
yeah, i thought about the black bits, but they could be a little trickier to do i thought...
and i did notice it was 600px wide, so i was slightly confused by the statement of it supposed to be 612vs the image posted, wasn't sure if the one you posted you had edited to make 600 px wide so it looked nicein the post, or if you had fixed it to make them 600 wide, but not changed the 612 statement

You got me, I cheated. smile.gif I didn't want to make the defiency that will soon be fixed too obvious, but didn't want to completely hide it either.


-- Cort

  Your_Persona, Sep 28 2007, 10:44 PM

the repo url is : svn://yourpersona.hopto.org/myrepo/AGSM Plugin

I sent you your password, for commit permissions.

Anon has read only permissions.

  Cort, Sep 30 2007, 05:15 AM

AGSM v1.1 has been released, which fixes the image width issue.


-- Cort

  Fayq, Mar 13 2017, 11:41 PM

Good job man. You gave us a good information.

 
« Next Oldest · Cort's Constructs · Next Newest »