Applet for Twilight Struggle statistics.

In order to justify my usual complaining about luck after the lost games I’ve created a small Java applet to calculate some of the basic statistics.
If you have trouble running this applet, please see the „Notes” and „Update” sections at the bottom of this post.

How to use[updated]:

  • If asked by a popup, agree for the applet to start by clicking „Run”.
  • Wait for the applet to initialize, which unfortunately can take up to 30 seconds. Only after applet is initialized, the buttons are enabled. You can see the current status in the text area, unless you changed its contents.
  • Copy the game log from Wargameroom application to the text area above. Because this log is truncated by the game application after several thousand characters, it might be necessary to copy it in part by part. The applet can now automatically merge the parts for you, as long as they overlap:
    1. Copy the first log chunk into the text area above and press the „Update & Calculate” button. Make sure that the first chunk contains the beginning of the game log, otherwise some statistics might be wrong.
    2. Copy the next chunk the same way, but make sure that it has a common part with the previous chunk. This common part must contain a line announcing a new round, such as „Turn 4, USSR action round 1″!
    3. Continue copying the log chunks collected from Wargameroom application until the Stats Applet contains a complete log.
    4. After each successful log update the applet will display the full updated log in the text area on the webpage. When the log is completed, you can copy-paste it to your computer so that next time you’ll want to see the statistics for this game, only one press of a button is necessary.
    5. If „Log update failed” error popup means that the common part wasn’t large enough and no significant common line was recognized.
  • If you want to check the statistics for a different game, the applet has to be notified to reset its state and forget about the previous log. Hence – the „Reset applet” button.
  • And now just sit down and observe how lucky your opponent was to have beaten you :-)

Info:

  • A card is „counted for ops” if it was played by the player or discarded due to Quagmire, Blockade, but not Terrorism, Aldrich Ames or „Ask Not…”. What matters is that the card’s ops or event had any meaning.
  • According to a computer simulation I have created, in a full 10-turn game the average ops per card value is about 2,263. Less, if the game was shorter.
  • „Coup attempt success ratio” – number of coups with die roll 4 or higher / total number of coups.
  • „Key coup” – coups in chosen „key” countries – all 1- and 2-stability battlegrounds plus Afghanistan, Malaysia, Greece, Spain/Portugal, and Turkey.
  • Power cards are counted as such only when used by a player for event and it was player’s (or neutral) event. Hover the pointer over the number to see the list of power cards played.
  • Power cards

Notes:

  • This program requires that your browser runs Java version 1.7. If it doesn’t work, obsolete Java version is a likely cause.
  • The warning on the start appears due to the policy of Oracle, which discourages running unsigned Java applets. From my side I assure you that the program is perfectly safe to run.
  • This is the fourth version of the TS_Stats applet. It might still contain errors, especially in edge cases. Please notify me in the comment section of any error you find.
  • All constructive comments are welcome and the best suggested changes might be included in the next version.
  • If you get weird statistics or „Update failed” popup which you believe is incorrect, make sure you pressed the „Reset applet” button after the previous use.
  • I realize that my program isn’t running as fast as it should be. Writing Java applets is not my forte, so if anyone has suggestions for possible performance improvements, they are most welcome.

Update:
Due to regular security issues with the Java applet’s sandbox mode, with the new version of Java Oracle decided to simply forbid running all unsigned and self-signed applets. Since I don’t write Java applets for sale, I’m not particularly keen on paying 100$ for a „trusted certificate” just because Oracle is unable to make the sandbox mode safe and secure.
If you want to use my Statistics Applet and are unable to do so due to this new policy, this page (http://zimna-wojna.pl) must be added to the list of Java security exceptions.

You can find instructions on how to do it here:
https://www.java.com/en/download/help/java_blocked.xml
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/exception_site_list.html

If, upon entering this page, you are redirected to the Java page, it means that the Java version your browser uses is either outdated or incorrect. „Incorrect” usually meaning that you use a 64-bit version of Java for a 32-bit browser. You can your verify browser Java version here:

https://www.java.com/verify/

Jeśli uważasz treści na tym blogu za wartościowe, wyślij donację na adres bitcoin: 1LTicKy5ww4tAQwLqRDHxbpKHBQ9QvcK72
If you consider this blog's content valuable, please send some Bitcoins to: 1LTicKy5ww4tAQwLqRDHxbpKHBQ9QvcK72

2 myśli nt. „Applet for Twilight Struggle statistics.

  1. Pingback: Twilight Struggle Statistics applet – update | Zimna Wojna / Twilight Struggle

  2. Pingback: Twilight Struggle Statistics applet – version 2.0 | Zimna Wojna / Twilight Struggle

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

Możesz użyć następujących tagów oraz atrybutów HTML-a: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>