I'm making a perk calculator. Architecturally I have a sheet with perks, and another sheet where the user can select a set of perks and can see in a "results" cell their total effect.
Examples for perks: "5% armor". "10% damage", "2% armor and if you get hit you become invulnerable for a second". If all of these are selected, the result should be "7% armor, 10% damage, if you get hit you become invulnerable for a second". Naively all perks could be represented as strings, but in that case adding up similar effects (5% armor + 2% armor = 7%) would require a heavy and unmaintainable string-manipulation function.
I've barely used spreadsheets until now, and my understanding is that the natural way to represent this is to have columns for every effect that may need to be summed, so that the cells themselves can contain simple integers.
|perkName |armorBonus|damageBonus|special | |perkOne | 5 | | | |perkTwo | | 10 | | |perkThree| 2 | | invulnerability blabla|
Because the perks can actually have way more effects than just these two, this creates very sparse data, rows with dozens of columns where only one or two contain data.
Is there an alternative, better way to handle this? Or is this how it is done by people with actual experience?