Godot Version
4.3
Question
I’m currently developing my first game and I’m really struggling with the idea of how my general architectures should look. I’ll give you an example of the structure I have in mind, and maybe someone of you can explain, how they would translate this structure into Godot!
So, imagine a turn based combat system. I have characters, one hero on the left side (which the user can control) and multiple enemies on the right side. Each character has a stack of tokens representing their health, the tokens should neatly stack on top of each other. Furthermore a character has a dice tray containing a various amount of different dice, which determine attacks or other special abilities of the character. The dice also should be placed neatly aside of each other.
Depending if it’s a hero or an enemy, the health and dice should be displayed inverted (so health stack on the left side of the hero, but on the right side of the enemy, and so on).
Later I want to have the player fight in different levels, and each level consists of multiple enemy waves.
Currently I’m working a lot in code, but that kind of defeats the purpose of scenes for me, ideally I want for example to create an enemy as a scene, but then define different attributes of that enemy, but it get’s really complicated fast, and I don’t know what the best approach would be.
Here you can see the logical structure:
- Character
- Hero/Enemy
- Unique Ability (optional)
- Graphic (Sprite)
- Health Stack (should handle positioning of tokens)
- Health Token (various different types with different graphics and effects)
- Dice Tray (should handle positioning of dice, can be open or closed)
- Dice (various different types with different sides
- Die Side (6 per dice, with different values, graphics, valid targets, etc.)
- Dice (various different types with different sides
- Hero/Enemy
Here is what it looks like:
As I said I’m doing a lot in code, which is why the enemy scene looks like this currently (not ideal, you don’t see anything, i just put in placehodler sprites, so it’s not completely empty)
Can anybody give me a rough idea on what a good translation into Godot classes and Scenes would look like?
I’ve read about the @tool decorator, thinking about the @export decorator a lot, but just can’t wrap my head around what would be an efficient solution, that allows me to use the editor to it’s full potential, but also doesn’t burden me with a lot of manual work and duplication.
Thanks for any help.