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

最近发现,行为树执行期间无法FireEvent,上层设计应该怎么处理,还是说应该直接避免。 #119

Open
iammko opened this issue Sep 7, 2020 · 1 comment

Comments

@iammko
Copy link

iammko commented Sep 7, 2020

目前能想到的是延迟触发,请问还有没有更好的方法

@MysteryAngle
Copy link

MysteryAngle commented Aug 18, 2021

不是很明白执行期间无法FireEvent是啥意思,你是多线程并发对同一个Agent进行操作吗?如果是单线程操作一个Agent应该不存在这个问题吧。

因为每次执行行为树都是同步操作,行为树执行完以后返回,等待下一次调用。调用行为树也不会阻塞,返回Running的话下次接着那个节点继续执行,如果你是指在Running期间FireEvent会导致问题,有很多种方法可以解决,官网文档:https://www.behaviac.com/concepts/

再进阶
又有聪明的读者要问了,持续返回“运行”状态的节点固然优化了执行,但其结果就像“阻塞”了BT的执行一样,如果发生了其他“重要”的事情需要处理怎么办?

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

2 participants