libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.18k stars 241 forks source link

Added toParsableString in Distribution #48

Closed piotr-j closed 8 years ago

piotr-j commented 8 years ago

Added toParsableString in various Distributions to facilitate generation of parseable trees from in memory BehaviourTree

davebaol commented 8 years ago

I guess you need this to generate the tree file from your editor, right?

piotr-j commented 8 years ago

Yep, I can do without it, but it would be cleaner like that.

2015-10-21 1:35 GMT+02:00 davebaol notifications@github.com:

I guess you need this to generate the tree file from your editor, right?

— Reply to this email directly or view it on GitHub https://github.com/libgdx/gdx-ai/pull/48#issuecomment-149735123.

davebaol commented 8 years ago

TBH I've mixed feelings about this. On the one hand I see why you want it and I recognize it can be cleaner, on the other hand distributions are general purpose classes that have nothing to do with behavior trees and their syntax. However, XXXDistribution classes already have a static parse method that creates instances of subclasses. :scream: I'd really like a better design. Any ideas?

piotr-j commented 8 years ago

I agree, its not the best as is. But i don't really see how to do this in much better way. Perhaps separate class for parsing/stringing. It sure would be nice if we could have generic primitives.

E: Speaking of saving trees, take a look if you have a sec BehaviorTreeSaver

piotr-j commented 8 years ago

Looks good to me!