pmrowla / pylivemaker

Python package for manipulating LiveMaker game resources
https://pylivemaker.readthedocs.io/en/latest/
GNU General Public License v3.0
61 stars 16 forks source link

generate execution trees for lsbs #47

Open pmrowla opened 4 years ago

pmrowla commented 4 years ago

lmgraph supports generating call trees on a broad per LSB file level, but it would be good to actually have trees for LSB command execution.

LMScript.walk() should actually walk a tree (like os.walk), and yield blocks of commands at a time until any conditional or unconditional branch is reached, rather than the current naive search implementation. then the caller can choose which of the branches to actually follow (or none at all).

basically now that we have the text and menu apis, we should be able to generate actual call trees for lsb's, showing the order scripts are actually run, and how branch points work (including both variable/flag based and menu based branching)

Stefan311 commented 4 years ago

This sounds very interesting. The game I have is very complex. They made a kind of open world adventure game in this visual novel engine...

pmrowla commented 4 years ago

@Stefan311 have you tried using lmgraph? you can at least see how the lsb scripts call each other already

pmrowla commented 4 years ago

lmgraph now has two separate sub-commands for generating graphviz DOT syntax graphs

LMScript.walk() has not been updated to use the new graph functionality yet

the output DOT files can be converted to viewable formats via graphviz, or in online graphviz viewers

ex lmgraph lsb output (after converting an output DOT file to png w/graphviz):

ex-graph1 ... ex-graph2