Comments (7)
Another approach is let the user define it. For example:
# btree.gd
export(int, '_physics_process', '_process') var run_on = 0
func _physics_process(delta):
if run_on == 0:
tree_process(delta)
func _process(delta):
if run_on == 1:
tree_process(delta)
from addons-btree.
Most of the time we use btree as decisions maker. the actual physics stuff is must decouple from ai stuff. Running ai at the same rate as physics is not necessary. If it a must to query from physics the query must perform in physics tick and saved as cached. Also Godot fixed step is not fixed at all. If you have heavy physics simulation the step maybe drop from actual step.
from addons-btree.
I was wondering of it because I found a bug in the https://github.com/fian46/demo-btree.
If you walk fast at same direction that you fire, the bullet will collide with the own player.
In this case, your tasks seems to be dependent of physics calculations.
When I tested with btree running on _physics_process () the bug doesn't happen.
But perhaps there is another way to solve this problem.
from addons-btree.
What do you think about the idea of letting the user choose? We could make the option run_on = '_process' by default
from addons-btree.
It is not a bug the implementations is not complete. But sure if you think it is necessary to give user options for choose the best setup.
from addons-btree.
Submitted a PR #9
from addons-btree.
Merged
from addons-btree.
Related Issues (20)
- Redo does not work HOT 2
- GOAP integration HOT 11
- Add option for Search Node Next and Search Node Previous HOT 7
- custom color for each node HOT 5
- Using variables as parameters of a task. HOT 1
- add an "init" callback for a task node. HOT 5
- Script Error HOT 3
- smaller width of decorator nodes to review deep tree easily
- support "Succeeder" Node HOT 2
- is_init() hasn't been re-called if disable and enable a tree at runtime HOT 3
- Thanks for the addon :D HOT 2
- Feature request, label for decorators. HOT 5
- Missing documentation HOT 3
- rename task.failed to task.fail HOT 1
- Swapping tabs in editor clears nodes that were added on a different tab
- Hard to connect nodes HOT 1
- Priority Condition param turns from Number to Text HOT 9
- Invalid call. Nonexistent function 'write' in base 'Control (client_debugger.gd)'. HOT 3
- Invalid range checking causes unreachable code in runtime.gd HOT 1
- Update for Godot 4.x HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addons-btree.