-
Notifications
You must be signed in to change notification settings - Fork 16
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
Need Based Behaviors #11
Need Based Behaviors #11
Conversation
src/main/java/org/terasology/metalrenegades/ai/actions/SimpleComponentTargetAction.java
Outdated
Show resolved
Hide resolved
Vector3f characterLocation = actor.getComponent(LocationComponent.class).getWorldPosition(); | ||
EntityRef otherCitizen = null; | ||
|
||
for (EntityRef other : entityManager.getEntitiesWith(NeedsComponent.class)) { |
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.
This looks very similar to SimpleComponentTargetAction
. Can't you move this into a new method? It could maybe even be a static one in a external class that takes the component class and a max. distance.
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 made the social need use SimpleComponentTargetAction
, however some functions are still needed outside of the normal component tracking that is needed to make the social need work, these have been moved to the actions AddSocialComponentAction
and PrepareSocialAction
src/main/java/org/terasology/metalrenegades/ai/system/NeedsSystem.java
Outdated
Show resolved
Hide resolved
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.
All the behaviors appear to work. Although I did see a couple gooeys out at night, they seem to just be stuck on blocks, which I don't think is as a result of this PR. I did find one issue with a prefab, but once that's fixed I think this is good to go!
Contains
How to Test
MetalRenegades
enabled in aDynamic City
worldtype.Food Need
Thirst Need
Rest Need
Communication Need
Shelter Need
TODO