devel/datamine: runtime data mining tool - #1635
Open
Alistair-Afton wants to merge 1 commit into
Open
Alistair-Afton wants to merge 1 commit into
Alistair-Afton wants to merge 1 commit into
Conversation
A runtime data mining tool for script development and reverse engineering: - watch: poll a lua expression each frame and print when its value changes - snap/diff: deep-record a structure's fields, then report which paths changed after doing something in-game - find: list field paths whose name or value matches a substring Walks are depth-, length-, and leaf-capped, cycle-safe, and all field access is guarded. Watches run via repeat-util on frame timeouts and are cleared on world unload.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
devel/datamine, a developer tool for observing live game state when writing scripts or reverse-engineering structures.watch [-n name] [-i frames] <expr>: polls a Lua expression each frame and printsold -> newto the DFHack console when it changes. Watches persist across invocations (script env), run viarepeat-util, and are cleared on world unload.snap <name> <expr>/diff <name>: records a deep snapshot of every field reachable from the expression's result, then reports which paths changed -- the classic "do X, see what moved" workflow.find <expr> <substring>: prints paths of fields whose name or value matches.Test plan
watchregisters, polls per-frame even while paused, prints on change,unwatch/unwatch allstop itsnapon unit.name (19 fields), unit.status (2638 fields), units.active (20011 fields, leaf-capped)diffcatches a written field (.nickname-> ZZTEST) and a stress write (.souls[0].personality.stress: 13486 -> 99999)findmatches field-name substrings and value substrings, descends into containersdevel/datamine helprenders the embedded doc