Printable version of Entry

Click here to view this entry in its original format

Cort's Constructs

AGSM v1.0 (The Allegiance Game Stats Merger)

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
Tips for getting best results
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

https://github.com/hheimbuerger/agsm/releases/download/v1.11/AGSM_v1.11.exe [https://github.com/hheimbuerger/agsm/releases/download/v1.11/ReleaseNotes_v1.11.txt]
(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)]

by: jgbaxter on Sep 25 2007, 11:48 PM

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

by: Aaron Moore on 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

by: madpeople on 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..)

by: Cortex on 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

by: ImmortalZ on 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.

by: Your_Persona on 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.

http://img513.imageshack.us/my.php?image=resultsscreenocr1vy4.png

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.

by: Cortex on 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

by: madpeople on 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

by: Cortex on 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

by: Your_Persona on 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.

by: Cortex on Sep 30 2007, 05:15 AM

http://www.freeallegiance.org/forums/index.php?automodule=blog&blogid=10&showentry=383 has been released, which fixes the image width issue.


-- Cort

by: Fayq on Mar 13 2017, 11:41 PM

Good job man. You gave us a good information.

Powered by IP.Blog (http://www.invisionblog.com)
© Invision Power Services (http://www.invisionpower.com)