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

Choose measurement strategy on time nodes #319

Open
Remi123 opened this issue Feb 28, 2024 · 1 comment
Open

Choose measurement strategy on time nodes #319

Remi123 opened this issue Feb 28, 2024 · 1 comment
Labels
🍯 feature A new addition to this addon. 🐝 v3 Relates to work for Beehave V3

Comments

@Remi123
Copy link

Remi123 commented Feb 28, 2024

Godot version: 4.2

Describe the bug
Both delayer and cooldown update their internal timer using get_physics_process_delta_time() on each tick. However, if you update your tree every 20 frame just like I do, this mean that it take 20 time the desired amount.

There is a few ways to make it tick-independent. I would store the time at before_run, then each tick compare if the difference betwen now and then is higher than the desired amount. But you could also create_timer.

To Reproduce
Add a Cooldown or delay node, set a wait_time to 1.
set the behavior tree tick rate to 20.
Wait 20 second to see the desired behavior.

Expected behavior
waiting 1 second

@Remi123 Remi123 added the 🐛 bug Something isn't working label Feb 28, 2024
@bitbrain
Copy link
Owner

The only feasible way I see here is to add a new enum to time dependent nodes that define how the is measured, e.g. "tick based" or "clock based"

Each has their use-cases. I will implement this for V3

@bitbrain bitbrain added 🍯 feature A new addition to this addon. 🐝 v3 Relates to work for Beehave V3 and removed 🐛 bug Something isn't working labels Feb 28, 2024
@bitbrain bitbrain changed the title Delay and Cooldown timer are tick dependant. Choose measurement strategy on time nodes Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍯 feature A new addition to this addon. 🐝 v3 Relates to work for Beehave V3
Projects
None yet
Development

No branches or pull requests

2 participants