I am currently trying to refactor my game's script file layouts and classes, here is what I'm trying to do:
1.Add a " master" node to initialize all other singleton nodes in scene's root node, the master node stores player units in multidimensional arrays.
2.Add a few singleton class to handle most fundamental functions like input/ resource data loading/camera management etc
3.used a simple ecs plugin to integrate different scripts as "system" component child in tscn scene object.
Though I found some problems and drawbacks with this script layout:
1.The master script become enormously heavy and relatively hard to maintain, due to large number of variable or class initialization functions and object arrays.
2.Some function involving camera and IO need to be attached to objects, rendering them impossible to work independently, thus cannot be loaded via master script node directly.
3.The lacking of a namespace feature makes it hard to avoid enumeration name conflicts or variable shadowing when I am intergrating too many script as component child inside a tscn.
So what is a the proper way of organizing scripts classes in GDS?
It seems to me the object oriented programming design patterns don't fit GDS's python–like language nature well.
Thanks in advance.