-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Remove actor parameter in behavour's in favor of something else #61
Comments
Well, generally you know what type of Node your actor will be, as you set it by yourself. When using it in scripts, casting it to a type by using something like actor = actor as ClassOfActorNode as discussed in #54 could help. When you want to hot-swap the actor around while running, you should use conditionals like if actor is SpecificActorClass:
# Handle class specific logic and methods
pass to check for types.
Regarding your suggestions: I am not really sure what you are proposing here. Would you mind giving me a quick example of how these would work? As I see it, most of this would over-complicate a system that is easy to use and quite intuitive to implement. What problem are you trying to solve? |
The idea behind a monolithic node is it would basically be scene or node that covered all use cases Ec and Ecs would use components and a single entity type The event system would for example be something like... |
Oh you are basically taking about a dedicated
You are supposed to handle these things by yourself. This plugin only provides a framework to do so. There are endless signals to implement and it would become cluttered really fast. But yeah, having an |
A giant actor class is pretty impossible since we would lose the gui features. In the case of events... |
Well, I am a bit confused on why you need scenes?
But you can already do that by using signals in extended Scripts for your FSM or BT? Technically, you don't need to use |
Hello @Shadowblitz16 :) I'm this add-on contributor and user, I will also try to help.
It's not ideal to pas generic Node, but it has its uses, and it's an optional property so you don't have to use it. I think it should be better documented, maybe? Was it clear that it was optional, or you were not aware? Any ideas how we can make it more clear? I personally use it rarely, when working with AI, skill system or some dynamic custom logic in my game. Although, I think, it's mostly because of my game type.
Creating generic Actor ourselves would be wasted time because each game will have its own architecture and needs, it will actually scare of users that want only Behavior tools that they want to integrate into their own architecture.
This would be an enormous undertaking that would have the similar effect of scaring users away that don't need that or already have their own preferred architecture for that. This kind of tool should be a separate add-on project.
This is something that we moved towards a bit. Especially with Signal Leaf node and Call Leaf node. I planned to propose to expose more generic events that we use inside the code as a signal, in similar fashion to States Charts add-on for Godot. In my game I use both approaches depending on the context of a task. I often also want to mix both approaches.
Can you elaborate how you would see this? We already have Signal Leaf and Call Leaf, you can also feed our own event into BTree, also, I personally consider exposing calls like tick(), _on_state_enter(), _on_state_update(), _on_transition() as signals. Would that be sufficient for you, or you need something more? Let's talk :)
Yes you can't, but! There are solutions :) I personally make, my own ActorConfig, LevelConfig, MobConfig nodes that act as a component node for holding metadata for specific types of final Scenes made with composition. They hold members with pointers for each important component, and you can select them as your point of connection with BT system to feed important components for use in the BT :) |
I can't elaberate since I am not very good with behavour trees. I am still learning. I definitely think signals are the way to go since they can be hooked into setters and getters
|
Well you are not wrong, but it IS highly encouraged to define an actor or even a custom Actor class, so nodes can access and manipulate some kind of generic object. This isn't unique to our implementation, but rather a general practice. Most of the time, these patterns are attached to an "actor" node, |
But the actor class is a node which is also the type of the behavior. The only thing that the actor class is useful for is adding and removing it as children and that can be done though signals.
Also I agree with this statement but most engines that use this pattern use ecs or ec and generic entities. |
There is no dedicated actor class. It is something you make yourself. The toolkit only brings you means to generate behaviour patterns. An actor can be anything. Custom class, CharacterBody2D or even Sprite2D. It does not matter.
The "actor" should be the node in your scene, that has the "main script" attached. For example the
I don't think this pattern is specific to ECS. In fact it has nothing to do with it. BehaviourTrees and FSMs heavily rely on inheritance. There are several reasons why Godot isn't an ECS-based game engine and most of the plugins are created with this in mind. |
I am going to need to get more experience before discussing this more. |
Passing a actor is bad because the actor is of unknown type and in cases of built in scripts or scenes can't be typed.
Also if we rely on actors behaviors could rely on a variable or function that is not on that type of node.
This means that a behavior would either crash or fail in the case a node type is used that is incompatable
Consider one of the following...
Godot's design philosophy doesn't help.
The text was updated successfully, but these errors were encountered: