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

Update CharacterController3D for modularity #19

Open
Blade67 opened this issue May 27, 2023 · 1 comment
Open

Update CharacterController3D for modularity #19

Blade67 opened this issue May 27, 2023 · 1 comment

Comments

@Blade67
Copy link

Blade67 commented May 27, 2023

The current CharacterController3D requires constant updating when adding new features. This proposal proposes to update the behavior in favor of a more dynamic approach.


Signals

Instead of individually creating new signals for each ability inside of the CharacterController3D class, either create them dynamically using the native add_user_signal function, or declare them inside the ability and make the CharacterController3D connect to them dynamically.

Properties

Properties should be ability-bound, thus visible from the editor under the abilities_path array, when selecting the ability. This would however require the abilities to be resources, potentially making this a major undertaking.

Emitters

Emitting signals should be done from within abilities and not on the CharacterController3D.

TL;DR

Each ability should only take care of themselves, independently (or co-dependent of another's ability by connecting to it directly) of others. This allows more complex behavior and abilities being more than just movement related. (ie. interaction handling, etc.)

@scriptsengineer
Copy link
Member

This can really be a design problem, at the beginning of the project I strictly followed the rule that child nodes should not know about their parents when developing the character controller.
Reviewing some concepts like the one presented by GDQuest about StateMachine, maybe it could be easily applied here and without the need to put skills as a resource.

However, there is still a way to use new abilities on your character, which is to extend the character script and implement the new abilities, rewriting functions if possible.

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