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.


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:


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.

  • 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: AGSM v1.11 installer [Release Notes]
(Access to the source code repository on request.)


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:

    • 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
    • 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.)

    • 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)]

AGSM v1.11

Posted by Cort, Dec 3 2007, 02:48 PM in Tools

Here's a small service release for AGSM that should add support for screenshots done with R4 (R3 screenshots are still supported!). Running the installer over previous installations (without uninstalling) should work just fine. Thanks to aarmstrong for reporting it.

If you don't know what AGSM is, please refer to this entry.

Changes from v1.1 to v1.11

  * fixed issue that caused AGSM to fail to recognise all screenshots created by Allegiance R4 (added R4 stats screen detection template)


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

-- Cort

ASGS Google Gadget v1.0

Posted by Cort, Oct 3 2007, 09:50 AM in Tools

Ozricosis Random Software Requests
The ASGS Google Gadget v1.0
Now with improved layout and proper caching.

Google Gadgets (Java devs might know the concept as 'Portlets') are small Javascript applications for Google's portal, called iGoogle. This Google Gadget shows a list of all players currently logged into ASGS. Most of the code isn't my work, the whole GUI is a subset of Squire's Advanced ASGS Online List [thread] Greasemonkey userscript (branched from version 0.81).

Therefore, just as the Advanced ASGS Online List, the ASGS Google Gadget might rely on special Firefox features and/or just contain bad Javascript code (the library part Squire has *not* written) that only works in Firefox. I made a quick test in Opera: it doesn't show anything, but doesn't report any Javascript errors either. *shrugs*

To use it, just click this link click the big colourful button there and you're set. I think you need a Google account to have it permanently on your iGoogle page.

-- Cort

PS: You don't have to care at all, but here's what the info text at the bottom means:
"Last cache update from ASGS", the local time on the cache server when it syncronised with ASGS. This time is not necessarily in sync with your time!
"Age of cache at last Gadget data update", how old the data was at the time your Gadget talked to the cache server. This value can only change when your Gadget is talking to the cache server, of course.
"Time until next Gadget data update from the cache", a countdown until the next time your Gadget asks for an update from the cache server.

AGSM v1.1

Posted by Cort, Sep 30 2007, 05:11 AM in Tools

As promised, here's AGSM v1.1 which primarily fixes the "612 pixels width" issue. Merged stats should now be displayable on the forum (in full quality) as they are created by the application. If you don't know what AGSM is, please refer to this entry.

If you already have v1.0 installed, this installer should automatically upgrade to v1.1. But I'm new to Inno Setup (and I have to say: not very impressed, if anyone cares), so please report any problems related to an upgrade.

Changes from v1.0 to v1.1

  * merged images are now exactly 600 pixels wide
  * fixed issues causing the preview window to cut off some pixels of the image
    on all sides (switched from wxImageBox to using the DC on a wxPanel)
  * fixed issues causing the scrollbar parameters to be incorrectly set after
    the window has been resized
  * improved installer:
    + can now optionally create desktop icon
    + can now optionally create quicklaunch icon
    + can now optionally launch executable after installation has finished
  + application now aborts if required external files are missing
  * minor improvements of the About screen


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

-- Cort

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

Greasemonkey script: Remove Ignored Posts

Posted by Cort, Jul 31 2006, 05:47 PM in Tools

Yeah, I admit it, Greasemonkey (Wikipedia) is addictive...

If you don't like Invision's method of ignoring users (still showing the existence of those posts), then you might want to use this Greasemonkey script:
FAO Remove Ignored Posts user script

It completely removes posts of users you have set to ignore. There is currently no way to bring them back except for disabling the script (which is ludicrously easy using the context menu of the Greasemonkey icon at the status bar of your FF). It will not prevent the posts from showing up in the thread index of a forum, or prevent the forum system from sending you e-mail updates for the thread.

You need to have Greasemonkey installed in your Firefox. Then you just need to click the link above and there on "Install". But I guess you already know that if you're using Greasemonkey.

Mind you, this is marked beta for a reason. I'm by no means sure this removes only posts of ignored users, works on all threads, etc. So don't sue me if you miss a post. (But tell me, so I can fix it.)

EDIT 2006#08#09:
The script has been updated to version 1.11. Blog comments by ignored users should now be removed as well.

Unfortunately, Invision generates completely different HTML for ignored blog comments. So I rewrote the whole script. The detection method is simpler but less reliable now (future updates to Invision are more prone to break the script), but I could use the same method to remove blog entries and forum posts this way.

I hope it works. You can update by clicking the link above and then on "Install", just as you did with the previous version. You don't need to uninstall the old version first. Greasemonkey will detect whether it's your first installation or an update and deal with it accordingly. Enjoy!

EDIT 2006#12#16:
The script has been updated to version 1.21. This is a bugfix necessary for the script to work with the board update.