Does the number of non-processing nodes affect perfomance?

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

I have a game character with lots of statistics, and I’ve put each stat in its own node. So I was wondering does the engine loop through each node in the character’s tree each update, to see if it should process each node? Or is it smart enough to ignore nodes that shouldn’t be processed?

I wonder WHY you put stats as nodes… But about your question. What is type of this nodes? Node, Node2D? I THINK engine may somewhere iterate by this nodes, so for me - that isn’t good idea.

Kamil Lewan | 2017-07-16 16:13

This uses the basic Node class. Each stat consists of two variables with some functions to manipulate them. It was something I did when I first started learning the engine, and have regretted it ever since.

whooshfrosted | 2017-07-17 00:02

:bust_in_silhouette: Reply From: 807

Bad approach, don’t use a lot of nodes to only store data. Every node have their own overhead, with or without process activated. Best aproach is to store al data in one or few scripts.