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

Randomized Nodes #15

Open
Wokarol opened this issue May 29, 2019 · 16 comments
Open

Randomized Nodes #15

Wokarol opened this issue May 29, 2019 · 16 comments

Comments

@Wokarol
Copy link
Contributor

Wokarol commented May 29, 2019

It would be really handy to have nodes such as "Random Selector" or "Random Sequencer". They would be helpful for creating more non linear enemy behaviours. Especially for bosses.
(For clarity, by "Random Selector" I mean one where nodes are checked in random order and by "Random Sequencer" I mean one where nodes are sequenced in random order.)

@meniku
Copy link
Owner

meniku commented Jun 12, 2019

Interesting idea. For selectors it should be already possible to do that by putting a Random decorator at all subbranches of the Selector.

@Wokarol
Copy link
Contributor Author

Wokarol commented Jun 12, 2019

Random on childs won't give correct probability I think. And even if, you would have to tweak probability everytime you change number of childs.

@meniku
Copy link
Owner

meniku commented Jun 12, 2019

Fair enough.
I think that should be possible to implement. Right now I'm on vacation so it could take some time to do it myself... If you want to give it a try yourself, I'm happy to take pull requests ;-)

@Wokarol
Copy link
Contributor Author

Wokarol commented Jun 13, 2019

Okay, I've done some tests and looks like Selector + Random method gives uneven results.

RandomDistribution
(21 tests, each test was stopped when any bar reached 200 points)

You can see that 1st option is chossen more often. Almost twice as often as last one.

@meniku
Copy link
Owner

meniku commented Jun 24, 2019

I’ve merged your pull-request at #18
Thanks again for the contribution.

One thing that's a bit unclear to me right now is what should happen with the child priorities for the stops rules.
Right now I kept it the original order (not the randomized one), but one could argue that the children priorities should change to the randomized order...

@Luuno
Copy link

Luuno commented Jul 2, 2019

@Wokarol may i ask you how you used the selector and random method? i can't quite get a hand of it.

@Wokarol
Copy link
Contributor Author

Wokarol commented Jul 2, 2019

@Luuno // What Selector and Random methods you have in mind?

@Wokarol
Copy link
Contributor Author

Wokarol commented Jul 2, 2019

@meniku // In theory, best way would be to keep randomised order, but I don't fully understand stop rules yet. I will probably change it, but first I have to understand how it even works.

@Luuno
Copy link

Luuno commented Jul 2, 2019

@Wokarol i would like a set of actions to be picked at random. so my animal behaviour is more random and natural.

@Wokarol
Copy link
Contributor Author

Wokarol commented Jul 2, 2019

@Luuno // Just use Random Selector like Selector.

@Luuno
Copy link

Luuno commented Jul 2, 2019

@Wokarol but the library does not recognize random selector? so i am a bit confused

@Wokarol
Copy link
Contributor Author

Wokarol commented Jul 2, 2019

@Luuno // You have it downloaded from Asset Store or Git? It's feature I've added recently. It's possible that it isn't on Asset Store yet.

@Luuno
Copy link

Luuno commented Jul 2, 2019

@Wokarol asset store indeed. thank you i will get it from here and try again!

@meniku
Copy link
Owner

meniku commented Jul 5, 2019

I didn't update the asset store version for quite a while. I've planned to do it soonish

@meniku
Copy link
Owner

meniku commented Jul 5, 2019

I agree that the pre-defined random order might make the most sense, although I'm not quite sure if it really makes sense to use stops rules with those random decorators at all.

@Wokarol
Copy link
Contributor Author

Wokarol commented Jul 5, 2019

I think it makes sense, for end user randomised nodes are basically nodes that shuffle their childrens

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

No branches or pull requests

3 participants