Skip to content
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

Graph of Sheep animations... #6

rluiten opened this issue Feb 4, 2017 · 3 comments

Graph of Sheep animations... #6

rluiten opened this issue Feb 4, 2017 · 3 comments


Copy link

rluiten commented Feb 4, 2017

I created a quick hack that reads the XML definition and outputs a graphviz dot file for the animation next logic and probability.
Once i have the dot file I run it through graphviz to get attached image.

It labels all animations with name and id.

It labels all Next animations for each of Sequence, Gravity, Border with S, G, B on the arrow along with probability percentage and the actual probability int if probability percentage is not 100%.

desktoppet esheep animation sequence graph

Copy link
Contributor Author

rluiten commented Feb 5, 2017

To create the dot file I wrote a small console command, I copied the types out of your XML.cs into XmlModel.cs file in my own project. This was done because XML contains a bunch of dependencies on windows forms stuff and I can't just add a project to your single folder solution project easily.

Have attached both files XmlToDot.cs and XmlModel.cs

Id suggest you refactor your app to split XML.cs into XmlProcessing.cs and XmlModel.cs and move XmlModel out to a separate project so that the project can be shared between your DesktopPet and the XmlToDot projects.

I did not send you my project as I believe you want to add it to your solution I expect as a new project.
Just as a guide a more common structure for projects in .Net by example with your project.

DesktopPet/ solution for all projects lives here.
DesktopPet/DesktopPet/ project here
DesktopPet/XmlModel/ model project to share with XmlToDot
DesktopPet/XmlToDot/ project here

I have also adjusted the dot output a bit, it now colours Gravity edges Green, Border edges Blue and shades Sequence edges from light gray to black relative to their probability.

The files are here

NOTE: You don't need XmlModel.cs as you can create it trivially, but included it just in case.

Copy link

Adrianotiger commented Feb 6, 2017

Thank you Robin. It is really nice! Was also easy to implement :) Thanks! It is useful for the ones who want create their own animation, so I added it to the debug window - will release it with the next release.
It would also be a good idea for a "offline editor", but the developers of the animations doesn't like if everyone can see what is possible to do before it happens ;)

Refactoring would be a great idea! Giving those windows forms a decent name and give a better structure to the entire project! It is horrible now, I know! I will try to give a better structure to this project in future, I promise.

Copy link
Contributor Author

rluiten commented Feb 6, 2017

I'm sure some people may not like it, but most creators would like it as a tool for them selves I have a lot of years of development and keeping anything except a trivial state machine in my head and understanding is nearly impossible.

I am pretty sure a number of creators might like the sheep map as a guide to their own efforts.

Just because it has a word associated with each animation doesn't mean you know what it looks like :).
Take any of your pets and replace them all with the same single image frame of animation and suddenly the pet isn't so interesting :).
All good though.
Cheers. Robin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants