pylivemaker icon indicating copy to clipboard operation
pylivemaker copied to clipboard

generate execution trees for lsbs

Open pmrowla opened this issue 5 years ago • 3 comments

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)

pmrowla avatar May 08 '20 17:05 pmrowla

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...

Stefan311 avatar May 09 '20 12:05 Stefan311

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

pmrowla avatar May 09 '20 13:05 pmrowla

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

  • lmgraph game works the same as old lmgraph. you pass it ゲームメイン.lsb and it generates a DOT call graph for all the user-generated LSBs in a game.
  • lmgraph lsb generates a DOT execution graph for the commands within an LSB file.

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

pmrowla avatar May 17 '20 09:05 pmrowla