r26319 - Initial development of Bastille Battalion support by @Verac

This was prompted by my dissatisfaction at how Bastille Battalion games got logged in the gCLI and session log.

Yes, the game is a chain of choice adventures (numbers 1313 - 1319), but for playing in the Relay Browser, you don't need to know the gory details of that, and looking at the default choice adventure logging doesn't tell me anything meaningful about what happened in the game.

Ezandora's relay script is an excellent aid. It tells you expected cheese gains for various choice options, and it displays your "stats". Sort of. The attack/defense stats are dimensionless values, but Exandora's script displays them in units of "pixels". :)

This submission rationalizes the logging. It logs your "stats" - in terms of current "bonus", as provided by the control rig settings you selected and the outcomes of your offense/defense training. We (I) still don't know what your actual "base" stats start at, but doing it this way makes the game log MUCH more understandable.

We now parse every page and track everything about the game progress - and store it in properties. You could write a script to play the game. It would still need a full understanding of the game flow - (up to) five rounds, each with two turns of training and a battle - and would have to know which choice adventures flow into other choice adventures, but you don't have to actually parse a single response text from KoL; KoLmafia does it for you and provides it in those properties.

Here is (sort of) documentation for these properties, as expressed in the comments of a function used by the extensive unit tests I wrote while developing this.

Code:
  public static void reset() {
    // Cached configuration
    currentStyles.clear();
    currentStats.clear();

    // You can play up to five games a day
    Preferences.setInteger("_bastilleGames", 0);

    // Three (reward) potions grant one turn of an effect which will boost your
    // initial stats. If you are smart, you play all five games in a row...
    Preferences.setString("_bastilleBoosts", "");

    // When you initially visit the control rig, you can select the "style" of
    // the four available upgrades: barbican, drawbridge, murder holes, moat.
    // You can fiddle with them to your heart's content until you start your
    // first game of the day. At that point they are locked in and you will
    // receive the appropriate prizes at the end of that game, win or lose.
    Preferences.setString("_bastilleCurrentStyles", "");

    // Each configured style grants a specific bonus to the set of stats.  That
    // is locked in once you start your first game. As you progress through the
    // game, you perform actions to add or subtract to specific (or all) attack
    // or defense stats. Stats revert to your style-provided bonuses at the
    // start of each game.
    //
    // Since we don't know your actual stats, this is user visible bonuses.
    Preferences.setString("_bastilleStats", "");

    // Game progress settings.

    // Two turns of offense/defense/cheese following by a castle battle.
    // The game ends when you lose or beat your fifth castle
    Preferences.setInteger("_bastilleGameTurn", 0);
    Preferences.setInteger("_bastilleCheese", 0);

    // Presumably, the type of castle might influence your training choices.
    Preferences.setString("_bastilleEnemyCastle", "");
    Preferences.setString("_bastilleEnemyName", "");

    // Once you have selected offense/defense/cheese, these are your choice
    // options for that turn.
    Preferences.setString("_bastilleChoice1", "");
    Preferences.setString("_bastilleChoice2", "");
    Preferences.setString("_bastilleChoice3", "");

    // The attributes of the last battle are interesting, but should not carry
    // over across tests.
    Preferences.setString("_bastilleLastBattleResults", "");
    Preferences.setBoolean("_bastilleLastBattleWon", false);
  }

Which doesn't tell you what "Styles" are, or the types of a "Castle", or how the "Stats" appear in that property.
If this were done in response to a Feature Request, I'd have documented them there.
But even if you don't want to code a script, I hope the session logging is pleasing.
 
Back
Top