Godot Version
4.4.1
Question
This is a bit more of an esoteric question than I normally ask here. I’m largely self-taught as a programmer and game designer, so I don’t have a formal education and my knowledge base has many holes, I’m sure.
Lately I’ve been working on a web-hosted application in godot that exists in order to facilitate character creation and play for a TTRPG I designed. It’s actually going pretty well, but while creating it I’ve started to wonder if there’s a better way to do a lot of the things I’ve been doing.
For example, each character has 8 attributes. In addition, each attribute basically has 8 modifiers that add together to give you your total.
So the way I thought to implement this, since my attributes are static and never change, was just an array of 8 integers (one for each attribute) and to keep that order the exact same for 9 total arrays representing the modifiers and one for the total, then using a for loop to basically just go through each index and combine all key values of the same index for the last one.
The problem though obviously is I now have 9 arrays, and it’s not exactly super clean looking.
Later when doing skills, which are far worse (28 skills with 9 modifiers), I had the idea of putting arrays in arrays and this sort of worked but also introduced various complications.
Is there some method for managing large groups of numbers like I have that is more simple or obvious? How would you manage it? I’m not asking for a 100% concrete solution but rather I want to hear ideas and learn from you.