-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Feature/eggwatch #1296
Draft: Feature/eggwatch #1296
Conversation
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 :) |
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. |
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 |
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 type
Event manager JOB_INITIATED event per plugin
Event manager JOB_STARTED event per plugin
Event manager JOB_COMPLETED event per plugin
Event manager ITEM_CREATED event per plugin
Event manager UNIT_NEW_ACTIVE event per plugin
Update per plugin
State change per plugin
Lua timer details
Overlay details
ZScreen details
|
577a455
to
ff47019
Compare
…d to count live animals, it should improve performance in one edge case
…ack.onStateChange hook
fd59eae
to
0aacfa7
Compare
904f9a6
to
767430e
Compare
767430e
to
91d1aa9
Compare
… function to read persistent site config int
…ace being ignored to status
49a1704
to
09570d4
Compare
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.