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

Make behavior conditions a list of objects #40984

Merged

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

I noticed as of #40555 that behavior nodes were becoming way too verbose as multiple conditions were used per action, but I didn't want to shoehorn this change into that PR.

Describe the solution

Change the behavior::node::predicate entry into a behavior::node::conditions list that allows multiple predicates (and arguments) to be added to a single behavior node.

Describe alternatives you've considered

None really, this is a pretty basic functionality of behavior trees that I missed in my initial implementation.

Testing

Unit tests should still pass. (duh)
Shoggoth and locust special attacks should still trigger.

@kevingranade kevingranade force-pushed the behavior-condition-array branch 3 times, most recently from f5ae43e to 43e05c8 Compare May 31, 2020 08:35
@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON labels May 31, 2020
src/behavior.cpp Outdated Show resolved Hide resolved
src/behavior.h Outdated Show resolved Hide resolved
@kevingranade kevingranade force-pushed the behavior-condition-array branch from dd8a01f to 2e30077 Compare June 1, 2020 00:35
@anothersimulacrum anothersimulacrum added the Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style label Jun 1, 2020
@kevingranade kevingranade marked this pull request as draft June 1, 2020 04:09
This allows for fewer behavior nodes when multiple conditions must be checked.
@kevingranade kevingranade force-pushed the behavior-condition-array branch from 2e30077 to 88a3115 Compare June 1, 2020 05:19
@kevingranade kevingranade marked this pull request as ready for review June 2, 2020 08:06
@ZhilkinSerg ZhilkinSerg merged commit ebfa2e5 into CleverRaven:master Jun 4, 2020
@kevingranade kevingranade deleted the behavior-condition-array branch June 28, 2020 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style [JSON] Changes (can be) made in JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants