Uh oh!
There was an error while loading. Please reload this page.
Draft: Feature/eggwatch - #1296
Conversation
ab9rf
commented
Sep 7, 2024
there's no reason nestboxes should be a plugin, and replacing it with a more featureful script is entirely ok with me even if it does mean retiring my very first contributions to dfhack :) |
myk002
commented
Sep 7, 2024
I'd like to understand the performance profile for a script that runs as frequently as this will. Can you show a perf report? Enable eggwatch, save the game, load it, and play "normally" for 5-10 minutes. Then save the game again. You can get the perf report from the savegame directory. |
ab9rf
commented
Sep 7, 2024
the nestbox scan itself should not be that expensive but the scan to count animals is likely to be more so. it might be an idea to run that scan less frequently and cache its results for use in the more frequent nestbox scan, which has to be run frequently or there's a chance that newly laid eggs will get snagged by hauler but it's probably best to see profiling data before determining if such an optimization is needed |
Is it correct file? this one is from save after running game with eggwatch script for ~10 minutes |
Birkow
commented
Sep 8, 2024
Did some refactoring, added tags for script-enable-api, added hook dfhack.onStateChange, replaced internal use of creature_id with race. Pref report after last changes below: dfhack-perf-counters.datSummary -------Measuring unpaused time only elapsed 1757311 ms (29m 17s) DFHack detailskeybinding 0 ms ( 0.00% of dfhack, 0.00% of elapsed) Update detailsevent manager 4356 ms ( 20.16% of update, 0.25% of elapsed) Event manager per event typeEvent manager JOB_INITIATED event per pluginEvent manager JOB_STARTED event per pluginEvent manager JOB_COMPLETED event per pluginEvent manager ITEM_CREATED event per pluginEvent manager UNIT_NEW_ACTIVE event per pluginUpdate per pluginState change per pluginLua timer detailsOverlay detailsZScreen details |
577a455 to
ff47019Compare…d to count live animals, it should improve performance in one edge case
…ack.onStateChange hook
fd59eae to
0aacfa7Compare904f9a6 to
767430eCompare767430e to
91d1aa9Compare… function to read persistent site config int
…ace being ignored to status
49a1704 to
09570d4CompareBirkow
commented
Sep 18, 2024
moved to DFHack/dfhack#4947 |
lua script adding similar functionality to nestboxes with enhancements allowing to limit number of eggs forbidden per race and include live children/adult animals count in limit check.