User:Salamangkero/Sandbox

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

<small> is faster than {{small}}[edit]

<small>[edit]

KJAH SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO ERUH AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS LKJV NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI DSAP AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR AMLX KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY HTJK DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB ZMCV NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN

CPU time usage 0.003 seconds 0.007 seconds 0.005 seconds 0.003 seconds 0.003 seconds
Real time usage 0.005 seconds 0.013 seconds 0.010 seconds 0.006 seconds 0.005 seconds

{{small}}[edit]

KJAH SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO ERUH AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS LKJV NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI DSAP AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR AMLX KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY HTJK DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB ZMCV NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN

CPU time usage 0.014 seconds 0.016 seconds 0.014 seconds 0.022 seconds 0.015 seconds
Real time usage 0.021 seconds 0.022 seconds 0.021 seconds 0.029 seconds 0.021 seconds

Conclusion[edit]

The experiment above used <small> and transcluded {{small}} only 83 times.

  • Using <small>, there was no need to transclude any template. Furthermore, it also does not result in any additional HTML code being generated.
<small>SMALL TEXT</small>
  • Transcluding the {{small}} template adds a small overhead when rendering, which becomes readily apparent with repeated transclusions. Each transclusion also results in more HTML code.
<span style="font-size: x-small">SMALL TEXT</span>

The difference between both approaches to small text is negligible for web browsers, mobile browsers and the UESP app. For wiki editors, I don't think maintainability and/or readability is negatively or significantly impacted, if at all, by using <small>. Thus, I would strongly recommend (eventually) phasing out the {{small}} template and replacing it with <small>. However, I must admit I have not yet evaluated either approach from an accessibility perspective; for example, will screen readers read small text differently for both cases?

Which one is faster?[edit]

{{al}}, transcluded every time[edit]

A B C D E F G H I J K L
KJAH SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO
ERUH AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS
LKJV NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI
DSAP AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR
AMLX KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY
HTJK DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB
ZMCV NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN KJAH
SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO ERUH
AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS LKJV
NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI DSAP
AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR AMLX
KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY HTJK
DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB ZMCV
NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN
CPU time usage 0.053 seconds 0.032 seconds 0.032 seconds 0.055 seconds 0.032 seconds
Real time usage 0.062 seconds 0.040 seconds 0.039 seconds 0.063 seconds 0.039 seconds

{{al}}, assigned to a variable[edit]

A B C D E F G H I J K L
KJAH SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO
ERUH AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS
LKJV NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI
DSAP AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR
AMLX KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY
HTJK DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB
ZMCV NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN KJAH
SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO ERUH
AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS LKJV
NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI DSAP
AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR AMLX
KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY HTJK
DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB ZMCV
NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN
CPU time usage 0.017 seconds 0.011 seconds 0.012 seconds 0.028 seconds 0.011 seconds
Real time usage 0.023 seconds 0.019 seconds 0.019 seconds 0.040 seconds 0.018 seconds

{{subst:al|r}} or style=align:right[edit]

A B C D E F G H I J K L
KJAH SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO
ERUH AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS
LKJV NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI
DSAP AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR
AMLX KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY
HTJK DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB
ZMCV NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN KJAH
SDFH KLJH FAKL SDJH FAKL DSHF KJAD SHFL KJAN SDCJ NASO ERUH
AUWO IYEF HADS CHNK SNCL KNAS JROR IEWU PIWE HJKF NBDS LKJV
NKLA SDNF OHRF OIQP REWF HSAD KJVH AKSJ DNFP OQRE HFOI DSAP
AKJS DHFK AJEH NFFA JKWH EFKJ ADSH CALS EKRY LCAM IWYR AMLX
KERM HLAK SJDF AJSC NCMN ALSK DJFO QIWE URPO QYET UIRY HTJK
DVNM CXZV NSMC FNLS AKFY JTQP OIRE UTPW EOIG SDKJ FVNB ZMCV
NAMC SVNA QLKJ FOQI REUT WPOI RGKJ SDFH VNJC XZVN
CPU time usage 0.015 seconds 0.011 seconds 0.010 seconds 0.008 seconds 0.017 seconds
Real time usage 0.019 seconds 0.014 seconds 0.013 seconds 0.011 seconds 0.022 seconds

Full namespaces and shortened ones are equally fast[edit]

Full namespace[edit]

CPU time usage 0.127 seconds 0.101 seconds 0.094 seconds 0.103 seconds 0.098 seconds
Real time usage 0.206 seconds 0.175 seconds 0.175 seconds 0.186 seconds 0.169 seconds

Shortened namespace[edit]

CPU time usage 0.107 seconds 0.112 seconds 0.129 seconds 0.096 seconds 0.107 seconds
Real time usage 0.185 seconds 0.192 seconds 0.214 seconds 0.175 seconds 0.176 seconds

Conclusion[edit]

No significant difference found. I recommend using shortened namespaces but only because it results in shorter (and arguably more readable) wikitext.

Fun with Userboxes[edit]

Wiki.png This user has been on UESPWiki for 12 years, 5 months, and 4 days.
User-userbox-WikiGnome.png This user is a WikiGnome.
User-userbox-Morrowind.gif This user is knowledgeable about Morrowind.
User-userbox-Tribunal Logo.png This user is knowledgeable about Tribunal.
User-userbox-Bloodmoon.jpg This user is knowledgeable about Bloodmoon.
User-userbox-Morrowind Mod.gif This user uses cslist.uesp.net
User-userbox-PC Icon.png This user plays on a Windows PC.
LO-race-Redguard.png This user is an outlander in Vvardenfell
MW-place-Shrine of Azura.jpg This user worships Azura.
MW-creature-Vivec.jpg This user worships Vivec.
User-userbox-Pride.jpg This user is a proud member of the LGBT community.
User-userbox-M'aiq the Liar.jpg This user knows much, tells some.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

MW:Enchant Formula[edit]

Old vs. Current Enchant Formula[edit]

Saw this video, tried it on my own calculator (which is based on the current enchant formula in UESP) and got a different calculation. It's bothering me so, for starters, I'm testing the two known formulas against vanilla Morrowind.

Historically, there have been two enchant formulae:

  • The old enchant formula is based on the enchant simulator by user Kertaw48 (or vice-versa)
  • The current enchant formula was written by user Scientific Gamer, as a correction
Summon Ancestral Ghost on Self 1s 2s 3s 4s 5s 6s 7s 8s 9s 10s 11s 12s 13s 14s 15s 16s 17s 18s 19s 20s
Unmodded MW (GOTY) 1 1 1 1 1 2 2 2 3 3 4 4 4 5 5 5 6 6 6 7
Old Enchant Formula (1pt in 1ft) 0.44 0.79 1.14 1.49 1.84 2.19 2.54 2.89 3.24 3.59 3.94 4.29 4.64 4.99 5.34 5.69 6.04 6.39 6.74 7.09
Old Enchant Formula (1pt in 0ft) 0.35 0.70 1.05 1.40 1.75 2.10 2.45 2.80 3.15 3.50 3.85 4.20 4.55 4.90 5.25 5.60 5.95 6.30 6.65 7.00
Current Enchant Formula (1pt in 1ft) 0.53 0.88 1.23 1.58 1.93 2.28 2.63 2.98 3.33 3.68 4.03 4.38 4.73 5.08 5.43 5.78 6.13 6.48 6.83 7.18
Current Enchant Formula (1pt in 0ft) 0.35 0.70 1.05 1.40 1.75 2.10 2.45 2.80 3.15 3.50 3.85 4.20 4.55 4.90 5.25 5.60 5.95 6.30 6.65 7.00

Okay, so for a single enchantment, assuming the total enchant cost is truncated (ie. floored / rounded down), it seems the current enchant formula is correct... so far. In a later section, we'll see how it fares against multiple enchantments, that is, when compounded multipliers come into play.

Min-1 Rule[edit]

Enchantments, no matter how cheap, cost a minimum of 1 charge. When is this rule applied?

  • Is it applied to the total enchantment cost?
  • Or is it applied per spell effect? In which case, is it applied before or after the spell effect's cost is compounded?

For this experiment, we're working with the unmodified costs per spell effect, that is, we don't want to factor in the effects of either rounding or truncating. We're using cheap spell effects so everything rounds down and truncates to zero.

MW (GOTY) Total: 5
M Spell Effect Cost Just Compounded Min-1 then Compound Compound then Min-1
1 Detect Animal 1s 1pt on Self 0.06 0.06 1.0 1.0
2 Fortify Fatigue 1s 1pt on Self 0.04 0.08 2.0 1.0
3 Resist Paralysis 1s 1pt on Self 0.02 0.06 3.0 1.0
4 Light 1s 1pt on Self 0.02 0.08 4.0 1.0
5 Night Eye 1s 1pt on Self 0.02 0.10 5.0 1.0
Total 0.38 15.0 5.0

Well, that was fairly straightforward. The per-effect cost is compounded, then set to a minimum of 1, then summed to get the final enchantment cost.

Two Enchantments, Part One[edit]

Unmodded MW
(GOTY)
1st: Summon Ancestral Ghost on Self (x2)
1s 2s 3s 4s 5s 6s 7s 8s 9s 10s
2nd: 1pt Fire Damage on Touch (x1)
1s 2 2 2 2 3 4 5 5 6 7
2s 2 2 2 3 3 4 5 5 6 7
3s 2 2 3 3 3 5 5 5 7 7
4s 3 3 3 3 4 5 5 5 7 7
5s 3 3 3 3 4 5 6 6 7 8
6s 3 3 3 4 4 5 6 6 7 8
7s 3 3 4 4 4 6 6 6 8 8
8s 4 4 4 4 5 6 6 7 8 8
9s 4 4 4 4 5 6 7 7 8 9
10s 4 4 4 5 5 6 7 7 8 9
Current Enchant Formula
(truncate, compound, min-1, then sum)
1st: Summon Ancestral Ghost on Self (x2)
1s 2s 3s 4s 5s 6s 7s 8s 9s 10s
2nd: 1pt Fire Damage on Touch (x1)
1s 2 2 3 3 3 5 5 5 7 7
2s 2 2 3 3 3 5 5 5 7 7
3s 2 2 3 3 3 5 5 5 7 7
4s 2 2 3 3 3 5 5 5 7 7
5s 2 2 3 3 3 5 5 5 7 7
6s 2 2 3 3 3 5 5 5 7 7
7s 2 2 3 3 3 5 5 5 7 7
8s 3 3 4 4 4 6 6 6 8 8
9s 3 3 4 4 4 6 6 6 8 8
10s 3 3 4 4 4 6 6 6 8 8

Obviously, the outcomes are different. I have some hypotheses:

  • the order of compounding, min-1, summation and truncation are incorrect, and/or
  • the game might be rounding instead of truncating, and/or
  • the game might be rounding / truncating to the nearest 0.1

As already established in the previous section, min-1, happens after compounding. Thus, for the following experiments,

I'm assuming the following order of operations:

  • Calculate cost-per-spell-effect as n
  • α(n)
  • Multiply n by i
  • β(n)
  • Set the minimum of n to 1
  • Get the total of n1…i
  • γ(n)
  • The end result is Cx,y

where:

  • α, β and γ are functions that:
    • does nothing,
    • floors / truncates n, or
    • rounds n to the nearest integer.
  • i is the number of enchantments.
  • Cx,y is the total cost of the following enchantment:
    • Summon Ancestral Ghost for x seconds on Self (first effect, x2)
    • 1pt Fire Damage for y seconds on Touch (second effect, x1)

and we're only comparing twenty values:

  • C1,1 to C10,1, and
  • C1,10 to C10,10

because we don't need to generate 100 values for every experiment (yet).

α β γ C1…10,1 C1…10,10
Morrowind (GOTY) 2 2 2 2 3 4 5 5 6 7 4 4 4 5 5 6 7 7 8 9
none none / floor(0.1) / round(0.1) none / floor(0.1) / round(0.1) 2.0 2.7 3.4 4.1 4.8 5.5 6.2 6.9 7.6 8.3 3.6 4.3 5.0 5.7 6.4 7.1 7.8 8.5 9.2 9.9
none none / floor(0.1) / round(0.1) floor 2 2 3 4 4 5 6 6 7 8 3 4 5 5 6 7 7 8 9 9
none none / floor(0.1) / round(0.1) round 2 3 3 4 5 6 6 7 8 8 4 4 5 6 6 7 8 9 9 10
none floor any 2 2 3 4 4 5 6 6 7 8 3 3 4 5 5 6 7 7 8 9
none round any 2 3 3 4 5 6 6 7 8 8 4 5 5 6 7 8 8 9 10 10
floor any any 2 2 3 3 3 5 5 5 7 7 3 3 4 4 4 6 6 6 8 8
floor(0.1) none / floor(0.1) / round(0.1) none / floor(0.1) / round(0.1) 2.0 2.6 3.4 4.0 4.8 5.4 6.2 6.8 7.6 8.2 3.6 4.2 5.0 5.6 6.4 7.0 7.8 8.4 9.2 9.8
floor(0.1) none / floor(0.1) / round(0.1) floor 2 2 3 4 4 5 6 6 7 8 3 4 5 5 6 7 7 8 9 9
floor(0.1) none / floor(0.1) / round(0.1) round 2 3 3 4 5 5 6 7 8 8 4 4 5 6 6 7 8 8 9 10
floor(0.1) floor any 2 2 3 4 5 6 6 7 8 3 3 4 5 5 6 7 7 8 9
floor(0.1) round any 2 3 3 4 5 5 6 7 8 8 4 5 5 6 7 7 8 9 10 10
round any any 3 3 3 5 5 5 7 7 7 9 5 5 5 7 7 7 9 9 9 11
round(0.1) none / floor(0.1) / round(0.1) none / floor(0.1) / round(0.1) 2.0 2.8 3.4 4.2 4.8 5.6 6.2 7.0 7.6 8.4 3.6 4.4 5.0 5.8 6.4 7.2 7.8 8.6 9.2 10.0
round(0.1) none / floor(0.1) / round(0.1) floor 2 2 3 4 4 5 6 7 7 8 3 4 5 5 6 7 7 8 9 10
round(0.1) none / floor(0.1) / round(0.1) round 2 3 3 4 5 6 6 7 8 8 4 4 5 6 6 7 8 9 9 10
round(0.1) floor any 2 2 3 4 4 5 6 7 7 8 3 3 4 5 5 6 7 8 8 9
round(0.1) round any 2 3 3 4 5 6 6 7 8 8 4 5 5 6 7 8 8 9 10 10

None of them matched! That stretch of 2's in C1…4,1 and that stretch of 4's in C1…3,10 are both very challenging to replicate.

Oh well, let's keep trying!

Two Enchantments, Part Two[edit]

I'm working with two assumptions in this section:

  • The game engine uses precision of up to 0.1, so we'll disregard floor(1) and round(1) functions for α.
  • What if it's min-n after summation and not min-1 after compounding?
α β γ C1…10,1 C1…10,10
Morrowind (GOTY) 2 2 2 2 3 4 5 5 6 7 4 4 4 5 5 6 7 7 8 9
none none none 1.43 2.13 2.83 3.53 4.23 4.93 5.63 6.33 7.03 7.73 3.68 4.38 5.08 5.78 6.48 7.18 7.88 8.58 9.28 9.98
none floor(0.1) none 2.0 2.0 2.7 3.4 4.1 4.8 5.5 6.2 6.9 7.6 3.6 4.3 5.0 5.7 6.4 7.1 7.8 8.5 9.2 9.9
none floor none 2 2 2 3 3 4 5 5 6 7 3 3 4 5 5 6 7 7 8 9
none round(0.1) none 2.0 2.2 2.9 3.6 4.3 5.0 5.7 6.4 7.1 7.8 3.7 4.4 5.1 5.8 6.5 7.2 7.9 8.6 9.3 10.0
none round none 2 2 2 3 4 5 5 6 7 7 4 5 5 6 7 8 8 9 10 10
floor(0.1) none / floor(0.1) / round(0.1) none 2.0 2.0 2.7 3.3 4.1 4.7 5.5 6.1 6.9 7.5 3.6 4.2 5.0 5.6 6.4 7.0 7.8 8.4 9.2 9.8
floor(0.1) floor none 2 2 2 3 3 4 5 5 6 7 3 3 4 5 5 6 7 7 8 9
floor(0.1) round none 2 2 2 3 4 4 5 6 7 7 4 5 5 6 7 7 8 9 10 10
round(0.1) none / floor(0.1) / round(0.1) none 2.0 2.2 2.8 3.6 4.2 5.0 5.6 6.4 7.0 7.8 3.6 4.4 5.0 5.8 6.4 7.2 7.8 8.6 9.2 10
round(0.1) floor none 2 2 2 3 3 4 5 6 6 7 3 3 4 5 5 6 7 8 8 9
round(0.1) round none 2 2 2 3 4 5 5 6 7 7 4 5 5 6 7 8 8 9 10 10


Links to Custom Searches[edit]