-
Notifications
You must be signed in to change notification settings - Fork 722
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
core: utility method for visualizing worlds as PlantUML #1935
Conversation
2nd image is of Adventure. |
It might be a good idea to have something in the docs to explain what each thing does |
I added a bit to the world docs that explains that this feature exists. Since the default arguments are sane enough so that the average developer wouldn't need to change them, I don't explain that there. Advanced users will look at the function docstring, which explains what each of the arguments does. |
I would like this very much. I am actually stuck at a point when generating where something like this would be very useful - I'm having problems locating exactly where my generation is getting extra locations from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've ran this a couple times to test my world. It took me a bit to figure out how to open the .puml file but after doing so it was very helpful to see how all my regions connect together.
An additional thing that I would find helpful is being able to pass in a subset of regions or region names to highlight in a certain color or put in a bounding box or something. That way you could pass in state = CollectionState(self.multiworld)
state.collect(important_items[0])
state.collect(important_items[1])
...
visualize_regions(self.multiworld.get_region("Menu", self.player), "reachable_regions.puml",
highlight_regions=state.reachable_regions[self.player]) |
Not planning to add any more features at this time. |
Fair enough. It's still very useful as-is. |
…W#1935) * core: typing for MultiWorld.get_regions * core: utility method for visualizing worlds as PlantUML * core: utility method for visualizing worlds as PlantUML: update docs
…W#1935) * core: typing for MultiWorld.get_regions * core: utility method for visualizing worlds as PlantUML * core: utility method for visualizing worlds as PlantUML: update docs
What is this fixing or adding?
This adds a utility method that allows world developers to debug their world visually by generating a PlantUML diagram representing the Regions and their connections via Entrances. This can be used, e.g., to quickly identify unconncted Entrances or orphaned Regions.
Locations and the filled Items can be show in the diagram as well, so one can also use this to illustrate the fill state.
How was this tested?
See screenshots.
If this makes graphical changes, please attach screenshots.
ALttP, with locations hidden:
I don't know what world this isAdventure, aftercreate_regions
:ALttP again, but after
pre_fill
:KH2, fill completed (right before
generate_output
):No comment:
No comment either: