Varsuuk
July 27th, 2020, 18:01
(EDIT: gah, typo: "pick one over the other")
When one needs to add a HD type entry, with what we have learned so far, is it better to do (memory, performance, usability, etc) enter as something like:
<hd>
<die type="string">d6</die>
<num type="number">1</number>
<mod type="number">1<mod>
</hd>
or
<hd type="string">1d6+1</hd>
The former using more xml lines. Requiring 3 DB lookups.
The latter using one XML line, one DB lookup but requiring a regular expression application to pull out the components then convert them to numbers.
My gut says use #1 because data is separate and in proper format (have to look at type="dice" don't recall how that is used in case is better for this)
#2 has advantage of extensibility, in that we can change the format to add a second die type for example, "1d6+2 + 1d8-1" and could just change the RE. But like, in this case, not seeing a need past #d#+/-# type thing.
No clue which performs better in Fantasy Grounds. Not looking to prematurely optimize, both seem viable and don't want to pick something that is "bad" for performance.
When one needs to add a HD type entry, with what we have learned so far, is it better to do (memory, performance, usability, etc) enter as something like:
<hd>
<die type="string">d6</die>
<num type="number">1</number>
<mod type="number">1<mod>
</hd>
or
<hd type="string">1d6+1</hd>
The former using more xml lines. Requiring 3 DB lookups.
The latter using one XML line, one DB lookup but requiring a regular expression application to pull out the components then convert them to numbers.
My gut says use #1 because data is separate and in proper format (have to look at type="dice" don't recall how that is used in case is better for this)
#2 has advantage of extensibility, in that we can change the format to add a second die type for example, "1d6+2 + 1d8-1" and could just change the RE. But like, in this case, not seeing a need past #d#+/-# type thing.
No clue which performs better in Fantasy Grounds. Not looking to prematurely optimize, both seem viable and don't want to pick something that is "bad" for performance.