About Component Based Architecture in Godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mateusak
:warning: Old Version Published before Godot 3 was released.

First question:
A CBA is heavier performance-wise than the standard OOP? If it is, does it make any difference to the player?

Second question:
What’s the best way to implement a CBA in Godot?

Third question:
Is there any additional information I should know before implementing it?

:bust_in_silhouette: Reply From: shackra

My take on this is that, well, Godot ways of doing things is already CBA. So 1) There should not be no drop on performance. 2) By dividing things into nodes and attaching them with corresponding gdscripts as you see fit. 3) I don’t think so, other than the Godot documentation.

EDIT: answering your comment: yes. Just remember that scripts attached to nodes defines behavior for that node or sub-nodes.

You say create a node (e.g Component List) to store other nodes (e.g Component Nº1, 2, 3) that carry the gdscript which would process the code? A more detailed answer would be appreciated :slight_smile:

mateusak | 2016-07-24 06:07