Why magic strings everywhere? #379
Replies: 2 comments 3 replies
-
|
If you have a constructive technical proposal related to strings considering Godot limitations, we can have a discussion. |
Beta Was this translation helpful? Give feedback.
-
|
The blackboard system is completely optional. Feel free to ignore it in its entirety. It's designed to be lightweight in memory and computation. It's dynamic nature is due to a simple reality that AI needs to adapt to other shifting structures. The same BT can participate in different configurations, at one point it's part of a HSM, in a different agent, it's a standalone tree in a BTPlayer. If you have good ideas how to marry complexity of different structures with reusability of behavior trees, great! Consider making a proof-of-concept PR and I can consider it for inclusion in 2.0, seeing that it's most likely a breaking change. I understand that maybe in your project using Resource for simple value containers is an acceptable tradeoff. Do that! By no means I don't push the blackboard system on users and make it a must-use. Use it, or leave it, it's your choice. You can even roll your own blackboard system, ignoring the existing one. Make a subclass for BTTask and do that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why is there no option to set the value of a BBParam or, alternatively, to reference a blackboard variable by BBParam instead of a magic string? To be honest: Right now, the maintenance of the blackboards in a State Machine that uses BTState is a horrendous effort, because the whole system relies on magic strings. Changing one variable name results in touching every bound variable there is. Not to mention changing simple int values via code. It seems, it won't get much easier than this:
The first line is highly error-prone because of the magic string and the forced type cast. So why is everyone so keen about using strings? I don't get it.
Beta Was this translation helpful? Give feedback.
All reactions