AGSM—The Allegiance Game Stats Merger
| State: | active |
| Timeframe: | since September 2007 |
| Project type: | open source |
| Client: | — |
| Role: | architect, developer |
| Platform: | platform independent |
| Languages: | Python |
| Libraries: | PIL, wxWidgets |
| Technologies: | py2exe, Inno Setup |
Description
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 like the one in the screenshots section below.
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.
- 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.
- 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.
- 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.
- 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).
- You can see the final image here. Make sure no player is missing.
- 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).
- 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.
- Click on 'Save' to write the image you saw in (5) to the disk.
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…
- 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.
- 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. :)
- 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.)
(Source only available on request, for now.)
Screenshots

Screenshot 1: That's what a merged stats image can look like when generated from proper screenshots.
Downloads
| Name | Version | Application type | Distribution type | Release date | Release Notes | Download |
|---|---|---|---|---|---|---|
| AGSM | 1.11 | Windows executable | Windows installer | 2007-09-26 | 5.28MB |


