Closed rherban closed 2 years ago
The trade trigger logic is fairly complex and I don't remember everything from the top of my head. You might be able to make more sense of it by reading my analysis comments at https://github.com/oliversalzburg/cbc-kitten-scientists/blob/master/packages/userscript/source/TradeManager.ts and https://github.com/oliversalzburg/cbc-kitten-scientists/blob/master/packages/userscript/source/Engine.ts#L1683
Overall, trading is aggressive and the behavior you're seeing is very likely by-design even if it's confusing.
Thanks for those links.
It sounds like it's the limited
feature that's causing the aggressive behavior then?
Lines 1728 - 1730:
// If this trade is not limited, it must either not require anything, or
// the required resource must be over the trigger value.
// Additionally, gold must also be over the trigger value.
I originally took limited to mean "trade some, but not all" similar to crafting logic. If this is indeed the logic, then perhaps this should be changed to something like aggressive
?
When I ported the code to TS, I also felt like the meaning of "Limited" overall is very confusing in the userscript. I feel like the meaning isn't entirely clear and the checkbox is sometimes "abused" for certain features that don't make perfect sense.
I believe some of this is the result of the JS code base itself. People just hacked whatever feature they were going for into the script and it lost a clear structure along the way. For the TS rewrite, I expected to add a lot more fine-grained options.
Sadly, I really burned myself out with the initial code conversion and didn't find any motivation to port the most recent changes or make useful further additions :( I hope I can revive work on the project soon, so all the work won't be for nothing.
I totally understand and can relate. Without KS, I probably wouldn't even be playing kittens, so I want you to know how useful it is.
Thanks for what you've done.
Just wanted to chime in and say I'm extremely excited that people still use this script. I haven't played in years but it's always nice to see activity here. @oliversalzburg has been an amazing contributor as well, thank you for the continued support.
Kittens v 1.4.9.1 KS 1.5.0
I'm trying to understand how the trade trigger works. I have it set to .98 which would tell me wait until gold is 98% of capacity before trading.
But occasionally it will send some trades randomly (but only once). My gold was nowhere near maxed at this point (still had an hour before being at cap).![image](https://user-images.githubusercontent.com/14228280/159560022-c897fdd4-ed78-4db0-904c-74748385239c.png)
But the real problem comes where something causes it to trade as soon as I have 15 gold.
![image](https://user-images.githubusercontent.com/14228280/159570242-13fd3436-a751-43ef-bbdf-7e2e8cc859f0.png)
I have yet to really nail down what causes it to get in this state though I think it has to do with disabling and re-enabling KS.