toconnell / kdm-manager

An interactive campaign manager for the game "Monster", by Kingdom Death. Development blog and release notes at https://blog.kdm-manager.com This project has no affiliation with Kingdom Death and is a totally independent, fan-maintained project.
http://kdm-manager.com
Other
26 stars 11 forks source link

Timeline: events from expansion content fail to add/rm automatically #485

Closed toconnell closed 6 years ago

toconnell commented 6 years ago

From email:

I added Slenderman to a new campaign and none of the changes caused by the inclusion of the nemesis occurred on the timeline (i.e. the removal of the King's Man and all his events). ... You're correct in assuming that this was a brand new PotLantern campaign. I did select Slenderman, along with Perci and the White Box & Promo, and created it to find that it produced a TL that wasn't updated to remove the King's Man and include the Slenderman automatically.

My surmise here is that there's something in the old methods for adding and removing TL events that doesn't jibe with one of the changes that we made in the Timeline upgrade (probably the event dicts in the expansion asset definition are no longer "correct", that sort of thing).


toconnell commented 6 years ago

...and here's your error:

[2018-03-14 07:58:15] INFO:     settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd] event: Adding 'Slenderman' expansion content!
[2018-03-14 07:58:15] INFO:     settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd] event: slenderman@test.it added 'It's Already Here' to Lantern Year 6
[2018-03-14 07:58:15] INFO:     settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd] event: slenderman@test.it added 'Nemesis Encounter' to Lantern Year 9
[2018-03-14 07:58:15] WARNING:  Key errors encountered when comparing events {'type': 'story_event', 'name': 'Armored Strangers', 'ly': 6} and {'handle': 'core_armored_strangers'}
[2018-03-14 07:58:15] ERROR:    Event could not be removed from settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd] timeline! {'type': 'story_event', 'name': 'Armored Strangers', 'ly': 6}
[2018-03-14 07:58:15] WARNING:  Key errors encountered when comparing events {'type': 'nemesis_encounter', 'name': "Nemesis Encounter: King's Man", 'ly': 9} and {'name': "Nemesis Encounter: King's Man Lvl 1"}
[2018-03-14 07:58:15] WARNING:  Key errors encountered when comparing events {'type': 'nemesis_encounter', 'name': "Nemesis Encounter: King's Man", 'ly': 9} and {'type': 'nemesis_encounter', 'name': 'Nemesis Encounter', 'ly': 9}
[2018-03-14 07:58:15] ERROR:    Event could not be removed from settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd] timeline! {'type': 'nemesis_encounter', 'name': "Nemesis Encounter: King's Man", 'ly': 9}
[2018-03-14 07:58:15] INFO:     Added 'Slenderman' expansion to settlements object 'Bloodwalk' [5aa91c674af5ca167f38aafd]

The error is in the Settlement's _rm_timelineevent() method and it's failing on this part of the expansion's definition:

        "timeline_rm": [
            {"ly": 6, "type": "story_event", "name": "Armored Strangers"},
            {"ly": 9, "type": "nemesis_encounter", "name": "Nemesis Encounter: King's Man"},
        ],

The basic problem looks like the events we're trying to remove aren't the same as the ones in the 1.2 version of the PotLantern timeline.

(Honestly this method is a mess: I should probably just re-do the whole thing, at this point.)

toconnell commented 6 years ago

...and the type/sub_type bug rears its ugly head once again. Turns out that the _add_timelineevent() method is also screwing up, because it's adding events by their type (which is always just 'event') rather than their sub_type, which it should be doing.

Dang.

toconnell commented 6 years ago

@WayForger You really stumbled upon a doozy here: this one basically needs a tear-down/rebuild for the whole mechanism that the API uses to do automatic Timeline updates.

(I'm joking: this is a major issue that I missed in the Timeline upgrade and...honestly, the stuff I'm going to have to address here should have been handled a long time ago, e.g. when I migrated Timeline controls over from the old webapp.)

toconnell commented 6 years ago

Alright, this is all wrapped up. I'm going to let it burn in and...passively test it out in the background as I work through the rest of the stuff for this release.