Sunday, July 16, 2017

Change Log: 2.24.513

Survivor Sheet upgrade!
The Survivor Sheet Upgrade release, otherwise known as 2.24.513, is finally here!

It is also is probably the biggest release since the Anniversary Release back in January.

As far as features go, this one overhauls most of the controls on the Survivor Sheet:
  • Adding Abilities & Impairments no longer reloads/refreshes the Survivor Sheet
  • Settlement Sheet "flags" (e.g. "Cannot use Fighting Arts") are now automatically set (though you can still toggle them) based on A&Is
  • Survival Actions on the Sheet now also appear/disappear automatically as A&Is add or remove access to different SAs.
  • A number of Survivor Sheet controls have been refactored to no longer require page refresh/reload, including Cursed Item controls and Savior controls, Dragon Traits and "The Constellations", etc.

This one is also a major API milestone: as of 2.24.513, we've got API-side survivor normalization and we're starting to enhance the survivor data model so that it can support all of the UI/UX magic we've got planned for The Watcher.

Speaking of that, this one also pushes a slew of new API routes for working with survivors: there are now 20 documented routes for managing various aspects of the Survivor Sheet via the API.

As of  2.24.513 (API release 0.51.381), I would say that we're about 60% finished with migrating the old survivor update methods from the legacy webapp to the API, which is one of three major prerequisites for the alpha release of the Watcher (the other two being API-based user and settlement management).

Finally, if precedent is any guide, this release, since it is such a major overhaul of the front- and back-end components of the Manager, is almost certainly going to be associated with some usability/presentation issues. Thanks in advance for your patience!

And thanks for using the Manager!

Corrections and Fixes

  • Fixed a bug in the API's Survivor method controls_of_death() where the 'died_in' attribute was not set and the World could not load.
  • Monkey-patched an API bug that causes legacy webapp tracebacks. -JMiller
  • Addressed an arithmetic issue that caused the principle selection rates (on the World Panel) to be zero for all principles/options.
  • Corrected the "Green Savior" dream in the Survivor Sheet savior controls. -Eugene Shuvaev
  • Fixed a typo in the flavor text for Katana mastery.
  • Fixed a bug that silently removed duplicate A&Is (and should not have) during legacy webapp survivor normalization.
  • Addressed an issue where PotStars Survivor Sheets would fail to finish loading in Firefox.
  • Fixed a typo in the "Twilight Sword" A&I flavor text.
  • The API's models.Settlements.settlement.get_available_assets() method now sorts on asset names, rather than handles: a previous, incorrect usage of collections.OrderedDict was causing it to sort nearly correctly, but not exactly.
  • Addressed an issue where the "Dodge" Survival Action was greyed-out for PotSun survivors.
  • Fixed the scope of the survivalController on the Survivor Sheet HTML so that it covers all HTML elements that use its angularjs methods. 
  • Fixed an issue where the Slenderman A&I "Forgettable" was part of the A&I asset list twice (causing weird behavior).
  • Spent about three hours chasing down (and killing) a nasty bug in Models.py that allowed actual asset dicts to be modified during Survivor/Settlement operations and caused a lot of weird bugs.
  • Addressed several long-standing, low-grade issues that were cluttering the JS console log when loading the Survivor Sheet:
    • Removed an arrayContains() call from the legacy Survivor Sheet HTML that could literally never have returned accurate results since it was trying to pull from $scope items that would not have been loaded by the time it ran and spammed the console log a bunch for no reason.
    • Removed the Metrophobic.woff2 import from the main style.css, which stops the "Failed to decode downloaded font, OTS parsing error: invalid version" error from popping up in the console on cache refresh/reload.
    • Removed a call to the not-great arrayContains() function from the Survivor Sheet HTML. Replaced it with an indexOf() operation that should work with angularjs.
  • Corrected the Survivor JSON to have 'cannot_spend_survival' instead of 'can_spend_survival'; did the same for 'cannot_use_fighting_arts'.
  • Fixed the alignment of the +/- characters on the tablet-resolution incrementer/decrementer buttons. Fixed the spacing/margins of the number input as well.
  • Eliminated some log spam by switching the Survivor Sheet Survival input to use ng-value instead of value.
  • PotStars and PotSun survivors can no longer select Twilight Sword specialization/mastery.
  • Addressed a sync issue in kdmManager.js re: the settlementNotesController where the userRole() method could sometimes fail to return useful information due to unavailable $scope elements.
  • The "Messenger of Courage" begins with the "Twilight Sword" Cursed Item.
  • Addressed an issue where Partner controls would sometimes fail to appear on the Survivor Sheet.
  • Addressed an issue where "The Constellations" display for PotStars survivors failed to light up the box for "Weapon Mastery".
  • Addressed a presentation issue in Firefox where Fighting Art and Disorder "cards" on the Survivor Sheet had no margins. Also worked on a similar issue affecting settlement notes. 

Application Improvements

  • Created a saviorController method in survivorSheet.js for managing Savior controls from the Survivor Sheet.
  • Savior controls only appear if the API's 'campaign' element (in 'game_assets') includes the 'saviors' attribute (and its value is >= 1.3.1).
  • Survivor Sheet bonuses come from settlement JSON now (rather than survivor JSON).
  • Legacy app no longer returns information about survivor, settlement and departure bonuses to the legacy webapp display.
  • Partner controls now appear on the Survivor Sheet as soon as they gain the A&I 'Partner'.
  • Campaign Summary view now displays bonuses from API settlement JSON 
  • Re-implemented new survivor controls on the sidenav/burger:
    • New Survivor controls check the top of the API for 'eligible_parents', rather than fishing for it way down in 'game_assets'.
    • Both new survivor addition views show the full page loader when submitted
    • Both methods make API calls to create new survivors (see below)
    • Deprecated the bulk_add_survivors() method in the legacy app.
  • Re-implemented Survivor Sheet controls for Abilities and Impairments to use angularjs and API data:
    • deprecated the legacy models.abilitiesModel.get_maxed_out_abilities() method
    • removed A&I "max" normalization code from assets.Survivors.normalize(), i.e. the part where it normalized to max with a while statement, which was total bollocks.
    • removed normalization code from assets.Survivor.normalize() re: A&I handle misspellings
    • deprecated the assets.Survivor.get_abilities_and_impairments() method.
    • Removed legacy app support for add/rm operations against survivor A&Is
  • Epithets have custom border colors now. I also added/touched up a bunch of epithets and removed a few others.
  • Re-implemented Survivor Sheet avatar display as angularjs, rather than leaning on the legacy webapp to decide what to display; generic survivor avatar pictures refresh when the survivor's "effective_sex" attribute changes.
  • Re-implemented "The Constellations" as an angularjs application:
    • removed/deprecated the render_dragon_controls() method from the legacy app
    • moved the constellations from game_assets.py into survivorSheet.js
  • Survivor Sheet "Cannot Spend Survival", "Cannot Use Fighting Arts" are now checked/unchecked based on Survivor Sheet JSON; deprecated legacy webapp return of "flag" status for those boxes.
  • Re-implemented "secondary" attribute controls on the Survivor Sheet to a.) be fully angularjs and b.) use a proper angularjs controller with an API call, instead of firing requests and the legacy app. 
  • Deprecated and/or removed  a bunch of legacy methods and assets:
    • Deprecated/removed assets.Survivor.get_impairments()
    • Deprecated the vestigial/legacy assets.Survivor.get_sex() method: replaced all references to it in assets.py with calls to get_api_asset("effective_sex")
    • Deprecated the new() method of the legacy webapp's Survivor class. New survivors are created in the API now.
    • Deprecated the get_cursed_items() and update_cursed_items() methods from the legacy assets.py and migrated all related functionality to the API (see below).
    • Deprecated legacy webapp support for managing survivor status: deprecated update_survivor_status() method and replaced it with API method (see below).
    • Deprecated the legacy webapp normalization code that applied weapon specialization to a survivor if he didn't have it. 
    • Purged all A&I assets from game_assets.py and models.py in the legacy app. All A&I management happens API-side now (see below).
    • Deprecated the legacy/transitional new() method of the Settlement class in the old webapp. All new settlement/survivor creation happens exclusively in the API (finally).
    • Deprecated assets.Settlement.first_story() method
    • Deprecated survivor_names.py from the legacy app's 'modular' assets.
    • Deprecated attribute token details from modular_assets
    • Removed the whole modular_assets folder from the project, since it is no longer part of the design.
    • Removed the get_bonuses() method from the Survivor class and deprecated it from other methods in assets.py (e.g. the survivor picker render func, etc.)
    • Deprecated the "Custom Abilities & Impairments" controls and functionality, since a.) no one uses it and b.) it's not part of the data model for The Watcher.
    • Removed support for assets.Survivors.modify() for all of the 'angularjs_attrib_update' norefresh() HTML form POST methods. Man: what a tire fire that whole thing was, huh? Attribute token/gear info is now managed by the API.
    • Deprecated the (kind of silly/pointless) getAI() method from the cursedItemController() method in survivorSheet.js to reduce its console log spam.
    • Deprecated all calls to modifyAsset() from survivorSheet.js (woohoo!)
    • Deprecated the render_attribute_controls() method of the assets.Survivor class in the legacy webapp.
    • Purged all weapon mastery management methods from assets.py.
    • Deprecated update_constellation() and support in assets.Survivor.modify() for calling it from an HTTP form POST.
    • Deprecated both of the transitional Attribute detail management methods from survivorSheet.js, i.e. getTotal() and refresh()
  • Re-implemented Survivor Sheet ability detail controls in angularjs
  • Re-implemented Survivor Sheet permanent affinities controls in angularjs:
    • Deprecated the legacy get_affinities() method and removed all references to it.
    • Rewrote the modal controls to iterate (i.e. DRYed them the fuck up)
    • Removed the refresh/reload button from the modal controller
    • Fixed the CSS on the button so that it doesn't show a drop-shadow when active
  • kdmManager.js sets $scope.survivor equal to the whole Survivor JSON (rather than just the sheet)
  • Re-implemented the javascript for the Controls of Death to be more within the HTML than within the kdmManager.js initialization stuff, because the controls were breaking due to JSON re-inits.
  • Survivor Sheet status flags ('Cannot spend survival', 'Skip Next Hunt', 'Cannot use Fighting Arts') now use angularjs controller methods to contact the API directly rather than just blasting an HTTP request at the legacy webapp.
  • Deprecated legacy survivor epithet-management methods from assets.py:
    • Killed the assets.Survivor.get_epithets() method and its related HTML creators, which were a nightmarish misuse of angularjs's initialization method (ng-init).
    • Deprecated update_epithets()
  • Implemented pure angularjs controls for managing survivor epithets via API in html.py
  • Rewrote the survivorSheet.js controller (epithetController) for webapp epithet operations to remove private/one-off HTML stuff in favor of API-based survivor update methods, etc.
  • Created setGameAssetOptions() method in kdmManager.js in order to DRY up some of the other JS functions that refresh a game asset list for whatever reason. The new method:
    • includes the ability to filter/exclude options based on their 'type' attribute
    • excludes anything whose 'selectable' attribute is Boolean False
    • works with 'settlement_sheet' and 'survivor_sheet' $scope objects.
    • respects the asset's 'max' attribute 
  • Replaced one-off code in settlementSheet.js for setting Location options with a call to the setGameAssetOptions() method; updated HTML to use new scope attributes. Did the same for Innovation options.
  • Ported Weapon Proficiency (stat and type) controls to angularjs/API.
  • Expanded apiService factory in kdmManager.js to include a getSurvivor() method in addition to its getSettlement() method.
  • Survivor Sheet attribute details (for Movement, Luck, etc.) automatically refresh based on changes to the survivor.
  • The Survivor Sheet initializes from a direct call to the API, rather than iterating over the settlement JSON's survivors (which, admittedly, was kind of low-rent).
  • Re-implemented the Understanding and Courage attribute milestones on the Survivor Sheet to use the API's 'survivor_attribute_milestones' data.
  • The Settlement Sheet now initializes the survivor's JSON after the settlement JSON is fully initialized, i.e. to prevent issues caused by missing $scope elements, etc.
  • Re-implemented the Cursed Items controls:
    • HTML controls re-implemented as a full angularjs app with a controller and methods and the whole deal
    • Removed the refresh/reload button
  • Re-implemented the Survivor Sheet sex controls and display using angularjs to enforce values; added a tooltip that shows a special thing if the survivor's base sex differs from their effective sex.
  • The Epithet picker on the Survivor Sheet now supports sex-specific epithets (i.e. 'M' survivors can no longer be 'First mother', etc.).
  • Settlement notes now update/initialize the settlement upon add/rm.
  • Upgraded the settlement creation view to programmatically list all available "specials" (e.g. "First Story", "Seven Swordsmen", etc.) with their description text.
  • Re-implemented the "public" attribute toggle on the Survivor Sheet in angularjs and tied it to an API call (toggle_boolean() method; see below).


API Improvements

  • Updated Models.get_current_ly() and Models.log_event() to be collections-agnostic, i.e. to just work whether called by a Survivor or a Settlement object.
  • Added normalization support to the Survivor object:
    • the self.normalize() method is now called when self.normalize_on_init is True
    • normalization happens AFTER the Settlement object has been added (as self.Settlement)
    • fixed the serialize() method so that it doesn't implicitly add a bunch of stuff to the 'sheet' element outside of the normal dict-building workflow
    • Integer-type attributes are duck-typed to be int during normalization (to help with legacy survivors and survivors modified by bad form input).
  • Created a convert_abilities_and_impairments() method for Survivors that converts their A&Is from names to handles and updates their meta in the MDB.
  • Enhanced Models.list_assets() to accept a kwarg 'log_failures' that, surprising as it might sound, allows the method to log asset initialization failures.
  • Created a baseline() method:
    • survivors are now baselined to include a "meta" key in the MDB.
    • Added the 'attribute_detail' dict to the Survivor class baseline() method, which will force the dict to be part of the general survivor data model.
    • The Survivor object baseline now also includes the 'affinities' key.
    • 'cursed_items' list is now part of the baseline as well
    • 'public' is part of the data model as well: it's forced to a bool now.
  • Renamed the settlement's normalize_data() method to normalize(); renamed baseline_data_model() to baseline().
  • models.settlements.Settlement.get_bonuses() now takes "JSON" as a 'return_type' value (rather than "json").
  • Created a new() method for the Survivor class 
  • Survivor JSON no longer includes settlement bonuses; those have been moved to the Settlement JSON as 'survivor_bonuses'
  • Moved the Settlement class method get_campaign() into Models.UserAsset class so that we could call it from Survivor objects as well. Refactored it accordingly.
  • Added 'survivor_attribute_bonuses' keys to all campaign.py assets. Used a default for all campaigns except for PotStars (which got a custom one to include the 'Awake' SE).
  • Settlement JSON now includes a new top-level element called 'survivor_attribute_milestones' (for use in rendering the Survivor Sheet)
  • The settlement JSON's 'eligible_parents' element has been moved out of 'game_assets' and brought up to the top level of the JSON. -khoa
  • Added a set_pretty_types() method to Models.GameAsset class methods, which creates "pretty_type" keys on all asset dicts.
  • Ported the add_game_asset() method from the legacy app to the API's Survivor object methods:
    • method respects a weapon mastery's "add_to_innovations" attribute
    • weapon masteries are automatically added to settlement innovations
    • method respects an asset's "max" attribute and will bail if a survivor is maxed on it
    • method sets status flags, if the incoming A&I requires it (see below)
    • asset dict 'epithet' handles are automatically applied to survivors
    • related assets are auto-applied (non-recursively)
    • permanent affinities are automatically updated
  • Also created a rm_game_asset() method to undo the operations of add_game_asset() in the Survivor class.
  • Wrote up the Survivor class add_game_asset() method.
  • Refactored models.settlements.Settlement.add_innovation() to check request params OR be callable by other object methods. Removed a bunch of vestigial/early-release code. 
  • The Survivor class serialize() method now sorts A&Is, FAs and Disorders
  • Removed some vestigial/left-over asset init code from the top of the Settlement.serialize() method.
  • Enhanced Survivor JSON to include new bools and support new routes: 
    • Survivor JSON now includes a bool, 'can_use_fighting_arts', which indicates exactly what it says it does.
    • Created set_attribute_detail() method for the models.survivors.Survivor class. Works very similar to other "set" methods. Documented it.
    • Also created set_attribute() method in the Survivor class. Documented it.
    • Created toggle_status_flag() method for the Survivor class and documented it. Updated survivor assessment methods to use it.
    • Created an evaluation method for determining if the survivor is skipping the next hunt: added it to the Survivor JSON
    • Survivor JSON includes a key called 'savior' used to contain savior color (or Boolean false, if the survivor is not one).
  • The Survivor JSON's 'survival_actions' element has been enhanced:
    • Added "title_tip" attribute to Settlement JSON 'survival_actions' that explains why a given SA is available or unavailable and can be used in Sheet views.
    • Survivor Sheet available Survival Actions that come from Fight Arts are now unavailable if the survivor cannot use Fighting Arts.
  • Wrapped a bunch of the Survivor class methods in the error.log wrapper.
  • Created a method for converting survivor epithet names to handles; included it in the Survivor class normalize() method operations.
  • Added get_dicts() method to Models.py for rapidly iterating over AssetCollection asset dicts.
  • Updated models.abilities_and_impairments.Assets() to initialize the 'max' attribute on all assets (defaulting to 1, if undefined); assets whose 'max' evaluates to Boolean false get a limit of 666.
  • Created savior methods in the Survivor class:
    • ported the legacy app's is_savior() method (and cleaned it up)
    • added code to normalize() that sets the 'savior' attribute on the survivor MDB doc if the survivor is a (legacy) savior
    • created an set_savior_status() method/route and documented it
  • Updated the assets.abilities_and_impairments.py file so that assets with a 'max' of one no longer have the key (i.e. use the default); I also added 'max': False to SIs and other A&Is that are max-less.
  • Created and documented two new Survivor class methods for working with cursed items: add_cursed_item() and rm_cursed_items(). Created routes as well.
  • Created a new Survivor class method called update_affinities() that accepts an 'operation' param and can either 'add' or 'rm' an incoming affinities dictionary. Documented it.
  • Created a route/method for the Survivor class called get_survival_actions() which returns the survivor's Survial Actions list (i.e. JSON). Documented it.
  • Ported weapon proficiency Survivor Sheet assets dictionary from the legacy app to assets.survivor_sheet_options.py and created a model for it. 
  • Created and documented a new route called set_weapon_proficiency_type() for the Survivor class that allows the weapon proficiency type to be set to a handle. Does some biz logic validation.
  • Removed the Survivor class update_from_dict() method (since it was insane and dangerous).
  • Created and documented a set_sex() method/route for the Survivor class.
  • Survivor JSON 'sheet' element now contains a boolean representing whether the survivor is a 'founder', i.e. year zero addition.
  • Created a get_dragon_traits() method for the Survivor class, which accepts 'return_type' kwargs and can return a list of traits, a list of active table cells (from The Constellations table) and a list of eligible constellations.
  • Ported survivor names from the legacy app to assets.names.py and revised models.names.py to include a method for getting random survivor names.
  • Created a new() method for Survivor class. It's a much DRYer port of the original. I can probably slim it down even further, once I get rid of all the legacy/transitional stuff that's going out the window in the next big release. Also documented the method with a nice table.
  • Created a new_settlement_specials() method for the Survivor class that will handle First Story, Seven Swordsmen and similar:
    • ported the "First Story" macro/special to the new framework, including events, survivors, etc.
    • Created a "Seven Swordsmen" macro/special. Tested it out. Quite nice!
    • Pre-fab survivors can now update settlement storage upon creation.
  • Added a list_to_pretty_string() method to utils.py to turn lists of strings into pretty, user-facing strings with commas, 'and', and stuff.
  • Created and documented a new Survivor method/route called toggle_boolean() that toggles Boolean attributes of the survivor data model (different from status flags).
  • All private routes now require a JWT. We're not enforcing expiration yet, but that will be coming soon!
  • Created hooks for the admin panel and data routes that will be implemented in the next release.
  • Created a set_constellation() method/route for the Survivor class and documented it.

No comments:

Post a Comment