Monday, December 11, 2017

Change Log: 2.59.1125

The Watcher alpha release has begun!

As usual, /r/kingdomdeath has really been coming through with support, signal amplification and assistance. Thanks again!

The first round of alpha testing and tickets brought our attention several non-trivial issues related to how we manage assets behind the scenes in the API. Release 2.59.1125, therefore, is mostly focused on those issues, i.e. on the back-end, e.g. tightening up how game asset definitions are typed/retrieved, correcting some bad math, etc.

This is important to users of the Manager because the high volume of big-deal back-end updates in this release basically guarantees that there will be some unintended downstream consequences, e.g. errors in the legacy webapp at

Please report all issues! Every bug you submit against the legacy webapp helps improve The Watcher and, at this point, we need all the help we can get!

(And thanks in advance for your patience as we work through these growing pains!)

Finally, in terms of what's going on in the legacy webapp, this release (finally) implements API support for survivor avatars! In fact, all avatar-related code has been deprecated and removed from the legacy webapp which a.) fixes some outstanding issues that I have been ignoring a year and b.) will improve UI/UX by no longer requiring the Survivor Sheet to refresh/reload when changing an avatar.

Corrections and Fixes

  1. Fixed a typo in the "Cannibalize" description. -Dave F
  2. Fixed an issue where Survivors with Matchmaker A&I did not cause their endeavor to show up in the settlement endeavors in certain cases.
  3. Addressed an issue where creating a new survivor with an avatar threw an encoding error when posting to the API. -Fenris XL
  4. Addressed a presentation issue where survivor Quick Menus did not display well at laptop resolution. -Wayforger
  5. Updated the no-www redirect in the Nginx config for the API server so that goes to the landing page, rather than the API documentation. -Caleb
  6. Addressed an issue where attempting to use non-ascii/upper-ascii characters in a custom Cause of Death threw un-labeled errors. -laterite
  7. Addressed an issue where settlement death count was not calculated correctly on the Settlement Sheet. -Dave F, paddirn

Application Enhancement

  1. Updated the JSON encoder in the legacy webapp's api.post_JSON_to_API() method so that it can encode images (to base 64). This Stack was helpful: shouts to Martijn Pieters!
  2. Deprecated support for survivor avatars:
    1. removed the avatar_size setting from the legacy 'settings.cfg' file
    2. Deprecated the assets.Survivors.update_avatar() method
    3. Removed support for the 'survivor_avatar' key from assets.Survivors.modify()
    4. Removed the (wicked hack) from the Survivor Sheet that used a hidden form to post avatar changes to the legacy webapp.
  3. Refactored survivor avatar management to use the API:
    1. creating new survivors with avatars is once again supported.
    2. Added a JS-based avatar changer to the Survivor Sheet. Created a custom directive in survivorSheet.js. Hat tip to sqren!
    3. Added base64 conversion (for use with API methods below) to survivorSheet.js. Hat tip to eliseosoto!
    4. Made a spinner and built some fancy presentation logic for setting a new avatar without reloading the Survivor Sheet. Feature demo here.
  4. Added a new breakpoint for laptops (and landscape tablets, I suppose).
  5. Removed/deprecated support for toggling admin status from the legacy webapp
  6. Deprecated the code from assets.User.mark_usage() that used the user-level activity log feature (which is deprecated af).
  7. Updated the "Twelve Fingers" A&I so that it sets the 'cannot use two-handed weapons' flag on a survivor.
  8. The controls for editing storage (on the Settlement Sheet) no longer show up before storage is loaded (i.e. and let you load a blank screen where you can wait or reload).
This is...a huge release.

API Development

  1. The API now supports avatars and new survivors can once again be created with avatars!
    1. Updated the method to check for incoming avatars on creation
    2. Added a set_avatar() method to the Survivor class methods (that basically is a port of the legacy webapp's update_avatar() method).
    3. The set_avatar() method is called during and includes optional 'save' and 'log_event' kwargs (that are used to avoid issues during creation, etc.)
    4. Created a route: /survivor/set_avatar/<oid> that can be used to hit the new method.
    5. Updated the documentation and included some helpful sample JS code for my front-end peoples.
  2. Massively revised how asset lookups work in preparation for public "release" of the API:
    1. Deprecated the root-level game asset lookups in favor of /game_asset/asset_class
    2. Added 410 deprecation warnings for the old lookup end points.
    3. Added a 404 warning to request_broker.get_game_asset() if we get a request for an asset collection that we currently don't support lookups for.
    4. Added support for /game_asset/gear, /game_asset/resource, /game_asset/storage (i.e. storage locations) and /game_asset/abilities_and_impairments
    5. Updated the docs to reference a.) the deprecated endpoints and b.) the proper way to do asset lookups
    6. Also added short references to supported lookup endpoints
  3. Refactored Models.GameAsset.set_assets_from_root_module() to set the 'type' from the asset file name and the 'sub_type' from a.) the asset or b.) the asset's dictionary handle. -Caleb
    1. Models.AssetCollection.set_pretty_types() now sets sub_type_pretty attributes on all asset definitions (defaulting to JS null or Python None).
    2. Updated so that locations are now 'gear' type assets.
    3. Revised to initialize using a root module (i.e. to bring it into compliance with our other models).
    4. Created handling for the AssetCollection known as self.type_override, which is intended to be used with a root module when initializing an asset collection and which will override the type attribute of ALL assets in the collection after they are initialized.
    5. Setting self.type_override when initializing an AssetCollection object sets that value as the selt.type of the collection (e.g. so that you can print a descriptive __repr__, e.g. in logging)
    6. Revised assets/ so that helper dictionaries start with an underscore (to exempt them from being initialized as campaign asset modules. Split the actual campaign definitions into two dictionaries, i.e. one for core and one for expansions.
    7. now initializes its AssetCollection using a root module now as well.
    8. Removed custom AssetCollection code in and swapped it out for root module type initialization.
  4. now supports toggling 'admin' status on/off for a user.
  5. Admin Panel updates (for creepin' the users):
    1. updated the color-coding so that free users are grey and subscribers are yellow (used material design)
    2. updated the conditional formatting so that active users/subscribers are (slightly) different colors
    3. Updated the admin panel to use the new lookup routes
  6. Calling Models.log_event() from a user asset (e.g. settlement, survivor, etc.) now calls the User class method set_latest_action(), which is a (rough) port of the legacy mark_usage() method that eschews the user activity log (which is deprecated as of the dashboard redesign).


  1. Congratulations, The Watcher's interface looks awesome!

    Please distinguish departing survivors with sorting and color, it would be pain in the neck to manage a party during hunt or showdown as it is. Even with my 8-person settlement :)

    1. Yeah! Thanks!

      I'll pass this along to the front-end guys.