Feature - Implemented [PATCH] Track content familiar charges

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Hey all. Not super sure of this one so I'd like to post here. Since content familiar drop chance increases per turn used following their last drop, I'd like to track their "charge". There are some content familiars for whom the exact mechanics are not calculated yet, but this tracking can only aid that.

My big spadey question, though, is do these charges persist over rollover? I assumed no, but the code for Angry Jung Man and Grimstone Golem charges assumes they're persistant. They also don't necessarily all behave the same way.

If they do, I'll probably need to add code to set them to zero and not touch them again once the daily drops has reached its max.

Also in this patch: some familiars have charges that we track that were not reflected in their "charges" proxy record, so I've fixed that.
 

Attachments

  • charges.patch
    16.8 KB · Views: 35
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Oh huh I left a few changes I meant to exclude at the top - will remove them. The other seemingly inadvertent changes are ordering the defaults.txt alphabetically though, so I'll keep them
 

Saklad5

Member
I’m not sure I see a reason to implement this explicitly for each familiar. Couldn’t you just track the number of combats spent each day with any given familiar, using the same mechanism utilized for tracking turns spent at locations? It’d be a lot cleaner. Optionally, store the turn number of the last drop similar to the existing tracking for sausage goblin encounters.

On that note, I’m not quite sure what the use of this would be. When would you adjust your behavior according to the drop chance? It could be useful for spading, but you could use log files for that too. To be clear, that alone is not a reason to reject such a patch.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
The chance of a drop from these familiars increases per adventure spent with the familiar but without the item dropping, so that is the direct application. I couldn't think of a better way of doing that than this patch, but I'd be interested to know if you had one.

The water might be muddied somewhat by the fact that I also brought a few unrelated familiars in-line w.r.t. having both a charge pref and a charge proxy record.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Ok this is now split into two patches.

The first (charges.patch) adds new tracking for item-dropping familiars.
The second (charges_proxy_record.patch) fixes the fact a few familiars have a charge that is tracked in preferences but not returned in the "charges" proxy record.
 

Attachments

  • charges.patch
    8 KB · Views: 18
  • charge_proxy_record.patch
    2.1 KB · Views: 13

Saklad5

Member
The chance of a drop from these familiars increases per adventure spent with the familiar but without the item dropping, so that is the direct application.
I can’t conceive of a scenario where the altered drop chance would be important, though. If you are running a familiar to get a drop, wouldn’t you continue running it until you get said drop?
I couldn't think of a better way of doing that than this patch, but I'd be interested to know if you had one.
Well, this is conceptually the same thing as the turns_played proxy record field for locations, right? For the sake of simplicity and maintainability, I feel we should try to reuse that approach for this. That being said, I think there are outstanding problems with that already, most notably the lack of persistence between KoLmafia sessions. Or that might be the intended behavior, I’m not quite sure.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I can’t conceive of a scenario where the altered drop chance would be important, though. If you are running a familiar to get a drop, wouldn’t you continue running it until you get said drop?

There are plenty of reasons. Ultimately we allow scripts (and, indeed, the user) to have a fuller understanding of the game state without having to track things themselves.

Well, this is conceptually the same thing as the turns_played proxy record field for locations, right? For the sake of simplicity and maintainability, I feel we should try to reuse that approach for this. That being said, I think there are outstanding problems with that already, most notably the lack of persistence between KoLmafia sessions. Or that might be the intended behavior, I’m not quite sure.

No because the charge is not derived from the turns played with the familiar active, but the turns played with the familiar since their last drop.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Top