Research:Enchantment

From Discworld MUD Wiki
Jump to: navigation, search

Background magic decay

Some readings taken to illustrate thaum decay.

time thaums
0:00:00 199
0:00:14 199
0:00:41 198
0:01:15 196
0:01:31 196
0:01:52 195
0:02:05 194
0:02:27 194
0:02:32 193
0:02:55 193
0:03:07 192
0:03:21 192
0:03:27 191
0:03:47 191
0:03:52 190
0:04:17 190
0:04:37 189
0:04:49 188
0:05:09 188
0:05:17 187
0:18:18 161
0:18:33 161
0:18:44 160
0:19:12 160
0:19:32 159
0:19:44 159
0:19:48 158
0:20:18 158
0:20:22 157
0:20:51 157
0:24:15 151
0:24:23 150
0:33:59 135
0:36:12 131
- -
time thaums
0:36:46 130
0:37:14 130
0:37:23 129
0:37:56 129
0:37:58 128
0:38:33 128
0:38:36 127
0:39:17 127
0:39:19 126
0:39:58 126
0:40:01 125
0:40:41 125
0:40:48 124
0:41:21 124
0:41:26 123
0:42:02 123
0:42:06 122
0:42:38 122
0:42:54 121
0:47:55 115
0:48:31 114
0:49:41 112
0:50:13 112
0:50:16 111
0:50:53 111
0:51:01 110
0:51:44 110
0:51:51 109
0:52:34 109
0:52:39 108
0:53:18 108
0:53:25 107
0:54:11 107
0:54:15 106
0:55:38 105
time thaums
0:55:53 104
0:58:50 101
0:59:12 101
0:59:15 100
1:09:46 89
1:14:02 85
1:19:58 79
1:20:33 79
1:20:39 78
1:21:51 77
1:23:25 76
1:25:06 75
1:25:31 74
1:26:51 73
1:27:28 73
1:27:33 72
1:28:40 72
1:28:49 71
1:31:25 69
1:33:15 68
1:33:48 67
1:34:58 67
1:35:03 66
1:36:17 66
1:36:20 65
1:37:35 65
1:37:39 64
1:38:52 64
1:39:03 63
1:44:57 59
1:48:54 57
1:49:52 56
1:50:28 56
1:50:40 55
1:52:11 55
time thaums
1:52:12 54
1:53:47 54
1:53:50 53
2:00:33 49
2:02:17 49
2:02:22 48
2:04:17 47
2:25:44 37
2:26:55 37
2:26:58 36
2:29:18 36
2:29:21 35
2:35:08 33
2:41:07 31
2:44:56 30
2:45:18 30
2:45:19 29
2:48:17 29
2:48:20 28
2:51:24 28
2:51:28 27
2:54:37 27
2:54:42 26
2:57:57 26
2:57:59 25
2:59:47 25
3:02:25 24
3:05:31 23
3:08:48 23
3:08:49 22
3:12:41 22
3:12:46 21
3:16:52 21
3:16:56 20
- -
time thaums
3:21:52 19
3:25:40 19
3:26:46 18
3:30:32 18
3:30:35 17
3:33:38 17
3:39:35 16
3:43:41 15
3:46:50 15
3:46:51 14
3:53:00 14
3:53:03 13
4:02:05 12
4:05:30 12
4:12:05 11
4:18:04 10
4:23:38 9
4:33:04 9
4:33:08 8
4:43:53 8
4:43:58 7
4:56:16 7
4:56:19 6
5:10:38 6
5:10:48 5
5:28:09 5
5:28:31 4
5:49:51 4
5:49:56 3
6:19:01 3
6:19:06 2
7:03:16 2
7:03:21 1
8:19:47 1
? 0


A sort of summary of the readings above. "seconds to lose 1 thaum (min)" is the least amount of time it could have taken to go from that number of thaums to one fewer, while "seconds to lose 1 thaum (max)" is the most time it could have taken.

thaums seconds to lose 1 thaum (min) seconds to lose 1 thaum (max)
1
2 2650 2660
3 1745 1755
4 1280 1307
5 1041 1073
6 859 872
7 738 746
8 645 654
14 369 373
21 246 256
22 232 238
26 195 202
27 189 198
28 184 191
29 178 182
36 140 146
54 85 89
55 91 100
64 73 88
65 75 82
66 74 82
72 67 81
107 46 57
108 39 51
109 43 55
110 43 58
111 23 48
122 32 52
123 36 45
124 33 45
125 40 50
126 39 44
127 41 46
128 35 40
129 33 44
130 28 71
158 30 38
159 12 36
160 28 59
188 20 40
189 32
190 25 50
191 20 31
192 14 32
193 31 40
194 22 40
195 34
197 34

The pattern isn't completely smooth, especially around low levels, but it appears that for the most part background magic has a half-life of around an hour--i.e., it takes about an hour for the amount of background magic to halve.


In the mudlib the enchant level is defined as such:

#define ENCHANT_HALF 3600
int enchant_level =  to_int( floor( 0.5 + dynamic_enchant * exp( -0.693 * ( time() - enchant_time ) / ENCHANT_HALF)) + background_enchant );

Note that background_enchant is the part that does not decay, so it is added unchanged.

--Frazyl 22:07, 6 July 2010 (UTC)

Enchantment capacity

Using stuff I had on me I made up this table in which the max thaums are calculated with the formula:

max thaum = floor( 2.3 * weight + 5 )
This works better than with 2.25 for the padded monk's robe which would otherwise not work.

The % max is thaum/sec divided by max thaums.

The magic level is based on the line when looking at it. (For example level 4 is 31 to 40 %.)

The thaum/sec was taken with a thaumometer.

Weight was taken on a balance.

(remove table because it's probably wrong)

Er... The only max thaums difference between 2.25 and 2.3 for the entire table above is for the offler headed mask, which has a max thaums of 20 at a 2.25 multiplier and 21 at a 2.3 multiplier. These result in %maxes of 40% and 38% respectively, both of which would be seen as level 4. Therefore, there currently isn't any evidence that 2.3 is better than 2.25.
The padded monks robe mentioned above does not have any max enchantment difference - at 2.25, its max enchantment is floor(15), at 2.3 its max enchantment is floor(15.2); 15 in both cases.
The reason the current 2.25 is there is because:
  • It comes directly from the formula in the dist. mudlib.
  • All of the mud's weight system relys on ninths - so the 'actual weight' of an object is 9x its weight in lb. The 2.25 comes from 'actual weight'/4, or in other words, 'weight in lb' x 9/4 (9/4 = 2.25). 2.3 is unlikely as this would require a rather unpleasant divisor (3.913043478....) on the actual weight in the formula; creators tend to prefer more rounded numbers :).
I'm reverting the formula changes to the articles for now. If you want to convince me that somthing other than 2.25 is the correct multiplier, then I'll need to see a case where the observed thaums aren't possible at the 2.25 multiplier. I suggest the easiest way to do this would be to get a heavyish item and have a wizard cast MGAGT on it until they get a thaumic backwash, at which point you should (theoretically) be able to read the actual max-enchantment straight off using a thaumometer, and compare that against the formulae.
--Chat 18:28, 5 March 2010 (UTC)
Well then it looks like I've been had by a software issue of some kind, in gnumeric =floor(2.25*C47+5) gives 14 where C47=4 4/9, while the gcalctool calculator gives 15. Seems like the floor() is the problem in the formula... Maybe it doesn't keep 4 4/9 as a whole number...
I'm sorry for the mess!
Frazyl 00:35, 6 March 2010 (UTC)
Ok rounding at the 10th decimal before flooring works better =floor(round(2.25*C47+5,10))
Anyway! In the Armour#Enchantment section it doesn't seem to floor to get the enchantment capacity.
Do the items have fractions of thaums capacity or not? If not then the table should be fixed, going to wait this time...
Frazyl 01:01, 6 March 2010 (UTC)

Room enchant line

The data currently on the page does not match the distribution mudlib info.

Need to verify. Confirmed thresholds 50, 150, 300, 500, 750, 1001. It looks extremely unlikely that the other ones would be wrong. --Frazyl 01:42, 7 July 2010 (UTC)

Thaum range Enchant line in room description Notes
0 - 49
50 - 149 There is the residual taste of magic in this place.
150 - 299 This place has seen some use of magic.
300 - 499 A considerable amount of magic has been used here.
500 - 749 A very large quantity of magic has been manipulated here.
750 - 1000 You can feel the Dungeon Dimensions trying to push in. At this point red warning messages are displayed on any attempts to cast, and it is possible to take minor damage on casting.
1001 - 1500 Little sparks flash in from the Dungeon Dimensions. At this point it is more likely that damage will be taken from spellcasting. Broken legs and lost limbs are also very possible.
1501 - 2000 Apparations of things with lots of tentacles seem to be on the edge of your vision. From this point beyond it is highly likely that legs will be broken or limbs lost from spellcasting.
2001 - 5000 So much magic has been expended here that the area is in danger of dumping itself into the Dungeon Dimensions.

Above 5000 the code returns it to 5000. --Frazyl 22:07, 6 July 2010 (UTC)

Terminology

As seen in this excerpt of basic_room.c in the distribution mudlib, the code refers to "dynamic enchantment" and "background enchantment".

   return light::stats() + property::stats() + effects::stats() + stuff + ({
      ({ "short", short( 0 ) }),
      ({ "enchantment", query_enchant() }),
      ({ "background enchantment", background_enchant }),
      ({ "dynamic enchantment", dynamic_enchant }),
      ({ "enchantment time", enchant_time }),
      ({ "theft handler", theft_handler }),
   });

These terms are used in the code to refer: for "dynamic enchantment" to what has also been called "fresh thaums", the result of casting or thaums in rooms that decay and that can be channeled into crystal shards, and for "background enchantment" more permanent thaums that do not decay that have been called "stale thaums".

To refer to the total of both of these I propose "total/visible room enchantment" (that is either total or visible, since this is what is seen in the room description).

I believe that by using these terms may make the distinction clearer to readers.

--Frazyl 02:29, 7 July 2010 (UTC)

Item enchantment decay

The following data were obtained by having an item enchanted to 100% of maximum thaums and waiting a long time (at least 8 weeks) and using a thaumometer to calculate the amount of thaums that remain.

The objective of this research is to determine at what percentage normal versus talismans (not completely deluded items behave like normal items) decay back to. Enchantment up to that limit should last forever if the enchantment decay behaves like the mudlib code.

--Frazyl 08:33, 4 December 2011 (UTC)

Item Talisman? Weight Maximum thaum capacity Thaums remaining after a long time % of thaum capacity remaining % of thaum capacity that did decay (+1 thaum above remaining thaums)
small metal shield No &&&+8000 8 8/9 &&+22500 25 12 48 % 52 %
small metal shield Yes &&&+8000 8 8/9 &&+22500 25 16 64 % 68 %
tiger fang Yes &&&+1400 1 5/9 &&&+7200 8 5 62.5 % 75 %
colossal bucket Yes >&+180000 200 680 453 66.6176 % 66.7647 %
Sarilak Yes (Natural) &&&+6000 6 6/9 &&+18000 20 10 50% 55%
Fine sabre Yes &&&+3000 3 3/9 &&+10800 12 8 66.7% 75%
Broomstick Yes (Natural) &&&+3000 3 3/9 &&+10800 12 6 50% 58.3%

Therefore normal items decay back to somewhere between 48% to 51%, while talismans decay back to somewhere between 64% and 67% --Frazyl 08:41, 4 December 2011 (UTC)

Using the colossal bucket with it's huge max thaums allows for a more accurate measurement (in the order of 1 thaum ~ 0.147% of max thaums), putting a talisman decay to end somewhere between 66.62% and 66.76%. I am thinking this may mean that talismen are stable at (or possibly at the first thaum below) two thirds of max. Will have to try again with something that has a thaum level that equals exactly 2/3 of max. Quotid (talk) 02:21, 13 September 2017 (EDT)

I (and another witch) have noticed that brooms seem to decay to levels lower than listed here. I am also testing Sarilak to see if perhaps natural talismen do not decay to the same levels. Quotid (talk) 02:21, 13 September 2017 (EDT)
Picked a fine sabre - it's the same weight as a broom so will be directly comparable.
Ok things got weird. After 10 weeks of decay time, the natural talismen (Sarilak and broom) both decayed to 50% of max thaums behaving like they were ordinary objects. A deluded talisman (the fine sabre) decayed to 2/3 of max thaums exactly. I am opening another bug report about this. Quotid (talk) 07:27, 21 November 2017 (EST)