I've been making a Mother/Earthbound battle framework in Godot 4.3, It's gonna be Open source and a big point of it is that anyone with no coding knowledge can create new enemies and party members with simple check boxes and sliders, Game-play can be found here and here.
The only problem is that the game's architecture is confusing and hard to debug ! I'm trying really hard to keep everything that's related to one thing in one place, So party member code is in party member scene and enemies code is in enemies scene, But this has proven to be challenging, The issue I encounter a lot is that I'm not sure how I should be passing around information between the party members, Enemies, And the battle manager.
The function for the party members taking damage is in the battle manager scene for example (The scene root), I thought it would make more sense to have it at the top so it can just call functions in the party member scene but this was a bad idea because the way I handled the enemies taking damage is actually in the party member scene directly when that member damages that enemy, So they both take damage in strange and inconsistent ways.
and now random functions are all over the place and debugging stuff is time consuming and honestly became a chore, I can find the bugs but it takes time and a lot if jumping around the 3 main scenes (Party member, Enemy, Battle manager) And a lot of breakpoints.
I've been watching these really awesome videos about code structure and comparisons between the different paradigms (OOP, Procedural, Functional, Component oriented), Like this video and this video and they're honestly very insightful and made me think much more deeply about my code's structure.
For example one issue in my code is just how carelessly I'm passing variables around different scenes and making certain variables global, It makes tracking bugs very confusing.
I wanna learn how to make my Godot games code structure better ! Have the placing of the functions make sense, Have less side effects in the functions, Understand better design patterns, Understand when to call and when to signal, Understand when to make variables global, That sort of stuff !
Are there any learning resources for this sort of stuff ! It doesn't have to be Godot by the way, Just video game code in general.