Variable nesting in general would be super useful
Also, instance variables could benefit from this grouping as well.
I don't get why this isn't already implemented, it seems so easy, especially considering it's only a visual thing with no impact whatsoever on the game engine.
Here's an use case for variable grouping: a medieval RPG, where attacks can deal different types of damage:
- Piercing
- Slashing
- Blunt
- Magical
- Siege
- Elemental: Earth
- Elemental: Air
- Elemental: Water
- Elemental: Fire
Then I have different ways to mitigate damage:
- Damage treshold (flat damage reduction)
- Damage resistance (% reduction)
- Evasion (% chance to completely negate damage)
And for attack I would need:
- Base damage (used as a base for calculating)
- % increases and decreases
- Flat increases and decreases
- Effective damage (all bonuses and penalties applied)
So I have 9*4=36 variables for attack
9*3=27 variables for defense
for a total of 63 damage-type related variables. For each "player" or "enemy" type. You can see how this can quickly become unwieldy with the current system of a flat list of variables.
Under the current system, you end up with variables named attack_damagetype_blunt_basedamage littered all over your objects, and you cannot simply "hide" them or collapse their group.