Technical Working #1


The Goal:

Shortly after starting on this game, I decided a large part of it would be flexible and modular to make it easier for me to work on it AND for future modding.

I have somewhat achieved getting their, but currently how everything is organized it is getting harder to maintain it.

The "Battle System":


Currently, the Battle System is a jumbled mess of connections between subsystems. 

It holds a reference to both the player/current battling enemy, and another reference to all the UI buttons that are clickable.

Godot's SceneTree organization is wonderful

In a single ready function, I connect the signals between the objects and the battle system. The system handles determining when a turn is started, ended, and when either the player or enemy dies. It also does some extra setup between turns (i.e. setting AP points). So far, there's nothing exactly wrong with this except for the fact I directly edit players and enemy's variables, which could have been reduced to a single function call on the objects themselves.

tldr; Here's a visual for the above relationships

Confusing, right?

As you can see here, it's good for the parent to have direct access to the child but not vice versa. UI buttons has direct access to both the player and enemy but should absolutely not because this can cause other problems, like if I changed values for either in the buttons.


10:28pm edit:
God I'm so tired right now. I've been working on this since 4pm on and off.
I'll end this devlog now; the next is going to explain how I fixed this AND made it better.



Leave a comment

Log in with itch.io to leave a comment.