The Ultimate Wizard Aging and Twilight Simulation

I'd love to see the code, though I'm afraid only as a tourist, being it's written in R and that I don't have any experience with R. The code your posted seems to indicate I could understand the logic though, even if I couldn't help with the coding.

1 Like

There are more of us than you might think! I write models in R as part of my day job, but also for ArsM: my last article in SubRosa was the results of a population dynamics model of the Order coded in R. I've also written an algorithm to determine which of our grogs in the (large) turb are capable of forming a trained group, a simulation of breakthroughs to work out how long one can expect to take (that was posted on this site), as well as a handful of other programs. Years back I did an 'InstaGrog' program, which was eventually rolled out as the Training Packages in Grogs.

So by all means post your code if you are willing to share -- I'm sure you'll get people interested!

Mark

1 Like

I fondly remember that article! It was incredibly interesting, and I had a real blast reading through it! :smiley:

1 Like

Heh... I still have a copies of instagrog on a couple of my machines. I keep meaning to update it for ArM5 and port it to Perl so that I can integrate it with the rest of my gaming database(s), but that never seems to happen.

When I got Grogs and saw the training packages system, I noted the similarity to instagrog, but it didn't occur to me that it might have been a direct ancestor.

Well then, I stand corrected. I have some some finals stuff to slog through before class this morning, but afterwards I'll see about cleaning up some bits and then getting it online. And start talking about my assumptions, although I might do that in several posts, as there are a lot of them, and honestly it'd probably be helpful for me anyhow as it'll make more apparent exactly where the model needs refining.

...and y'all can point out where I've been doing awful awful things.

And that model sounds amazing. I wish I had a copy, as population dynamics sounds exactly up my alley.

1 Like

I have cranked up the code and produced a set of output that you may find helpful to compare to your results frost rose.

The main intention of my simulation was to provide snapshots in time as to order membership / library contents etc, and so it doesn not record the precise year and cause of death of each Magus. What it does is effectively run the simulation in memory, and then every ten years write a snapshot to the database. (Plus keep log files of all magi actions, which does include precise details of death, but not in any easily analysable format.

I have put two csv files at:
drive.google.com/a/janigo.co.uk ... sp=sharing

AllMagi_AM3.csv has one record for all 2075 Magi who passed their Gauntlet in the simulation prior to 1210. This has a record of the Magus at the last decadal snapshot (the 'currentYear' field). So if this is '1210', then they are alive in 1210. If it is any other date, then they must have died in the previous ten years.
1210Snapshot.csv is in exactly the same format, but is the final snapshot of the order in 1210 (811 Magi in total in this run - the eldest being 224, with an apparent age of a mere 148 and with a Decrepitude of 4, so clearly about to go). One thing to be careful about if loading either file into R is that some of the string fields have commas in them.

If I take the first 1100 Magi in AllMagi_AM3.csv (to ensure I'm just looking at a cohort of Magi all of whom are are definitely dead), then I get:

[table][tr][td]Stat[/td] [td]age[/td] [td]Warping[/td] [td]LongevityRitual[/td] [td]yearsInTwilight[/td] [td]Cr[/td] [td]Co[/td] [td]MagicTheory[/td][/tr]
[tr][td]Min.[/td][td]31.0[/td][td]0.000[/td][td]0.000[/td][td]0.0000[/td][td]0.00[/td][td]0.00[/td][td]1.000[/td][/tr]
[tr][td]1st Qu.[/td][td]124.0[/td][td]5.000[/td][td]8.000[/td][td]0.0000[/td][td]15.00[/td][td]14.00[/td][td]5.000[/td][/tr]
[tr][td]Median[/td][td]144.0[/td][td]6.000[/td][td]9.000[/td][td]0.0000[/td][td]18.00[/td][td]16.00[/td][td]6.000[/td][/tr]
[tr][td]Mean[/td][td]140.3[/td][td]5.508[/td][td]8.698[/td][td]0.1691[/td][td]17.41[/td][td]16.41[/td][td]6.109[/td][/tr]
[tr][td]3rd Qu.[/td][td]162.0[/td][td]6.000[/td][td]10.000[/td][td]0.0000[/td][td]20.00[/td][td]19.00[/td][td]7.000[/td][/tr]
[tr][td]Max.[/td][td]253.0[/td][td]10.000[/td][td]21.000[/td][td]35.0000[/td][td]44.00[/td][td]65.00[/td][td]12.000[/td][/tr][/table]

So, assuming deaths are uniformly distributed within the decade, we have a median Magus age at death of about 150, with some reaching up to 250. This seems broadly consistent with the previous results posted.

I certainly would note that the Magi in the simulation are not min/maxers by any stretch of the imagination. In particular their Magic Theory scores and Longevity Rituals are rather underpowered compared to most AM campaigns I've been a part of; so I suspect these numbers understate by at least a decade or two the actual median longevity likely to be achieved.

1 Like

Have you accounted for the fact that not everyone makes their own longevity ritual?

To some extent. In the simulation Magi can offer a Longevity Ritual service (if the price is right) to the highest bidder. They then create a Longevity ritual for the recipient, using the recipient as a Lab Assistant (plus apprentices on both sides as Leadership score allows). However this is in practise only used by a minority of Magi (although I don't track this in a way that allows for any firm numbers to be quoted), and the prevalence of this trading is sensitive to the parameters of the simulation. So in these figures, the median Magus is generally just creating their own Ritual.

Firstly, I never got round to implementing invested items of any sort - just Summae, Tractatus and Spell Lab Texts.
The easiest data to pull out is all the books in all Covenant libraries in the year 1210 under the same run. If you're curious I have now put a third file, AllBooks1210.csv, in the same location as the previous two. This has one record for each book in a Covenant Library at the end of 1210 - a total of 10496 Summae, 7939 Tractatus and 6379 Lab Texts. (Hmm - and scanning through the data, I can see that a couple of Magi have written books on 'Warping'; I'll need to correct that inclination.) This is for the same simulation run as the Magi data previously provided, so all the ids should match up.

Taking the first couple of books in the file (which are initially ordered by Subject, and then by Quality) as an example, we have an Animal Summa of Level 19, Quality 12 as by far the most notable Animal Summa in the Order. This was actually written twice by the same author - in 1034 and 1035 (the magus probably sold the first copy, and then decided to re-write the whole thing from scratch. Not necessarily the optimal strategy I admit). By 1210 there are copies in the libraries of 8 Covenants - 5 in Thebes, and then 1 each in Rome, Transylvania and Novgorod. This is a common pattern because the simulation has trading occurring every 7 years at Tribunal, and covenants/magi will therefore trade preferentially within a Tribunal, and also occasionally visit neighbouring Tribunals to see what's on offer.
This is shown by the second best Summa (Level 16, Quality 9) on Animal, which was written in 803 by a filia of Guernicus, and has had time by 1210 to circulate to the libraries of 19 covenants, with a very wide geographical spread.

A few points to note if you look at the data in detail:

  • I start with the 13 classic founders in the eighth century; and just keep each one with their own 'House'. This means the data refer to Houses Diedne and Trianoma, with no sign of Ex Miscellanea. Feel free to re-name as appropriate. Some more historical events were/are somewhere to the back of the to-do list.
  • This just covers Books owned by Covenants. Not all Magi decide to join a Covenant (although I've tweaked the parameters to ensure that most do), and they also frequently have personal libraries which I've not included in the data dump. In the simulation I've coded Magi to be a little more self-centred than most PCs, and they keep a firm distinction between their possessions and those of a Covenant.
  • Covenant names are picked randomly from names of villages mentioned in the Domesday Book...which does mean they are rather out-of-keeping with general AM flavour, and why you find, for example, the Covenant of Steeple Bumpstead in Novgorod. Ahem - another thing on the to-do list.
  • As with all simulation results, these are very dependent on the behavioural settings for the Magi. This is something I put together for amusement, and take all results with a pinch of salt. It makes little effort to be consistent with AM canon.
  • I've not implemented any Virtues or Flaws, and Stats are determined randomly with just a slight positive bias. This means that the simulated Magi are in general underpowered compared to any PC built using the standard system. (Although I do give the Founders a Stat or two each at the +5 level, which is one reason books by a chap called Bonisagus tend to be quite popular.]
  • To avoid limitless immortal books taking over my RAM, I implemented a deterioration mechanic. Each book has a natural lifetime of 300 years - and each season of reading also takes a year off their remaining time. The 'deterioration' attribute should be interpreted as a percentage - when it reaches about 100, then the book disintegrates. This also explains why some covenants have multiple copies - a Magi doing covenant service may decide to make a copy before a popular book vanishes.
  • The 'popularity' attribute refers to the number of times (seasons) that individual book has been read.
  • There is also a practical limit on a Covenant library, which depends on how wealthy they are. A normal Covenant in the simulation can happily have about 300 books before worrying (up to 1000 for the richest) - but any beyond that deteriorate at a faster rate (and the least popular ones are selected preferentially for this faster deterioration so that there is some selection over the centuries). (Like deterioration, I implemented this to cut down libraries of thousands upon thousands of books that otherwise tended to form in the older covenants especially.)
  • I have not implemented any Grand Tribunal trading, which would probably speed up the diffusion of books around the order.

I find 9 books on Warping written during the whole history of the Order to be both reasonble and an interesting idea that could use some further developing. Given how magi deal with Warping on a daily basis, I think it's quite reasonable that some of them might have been interested in the subject, and studied how it affects people

Consider that access to books is something that Durenmar "sells" and I can see that an active book trade would be frowned upon at Grand Tribunal. I'm sure it does happen, but it's all underground and not in the open. Kind of a grey market activity. So there is a reasonable basis for this particular bullet point.

1 Like

Everyone has been awfully patient for me to get this up, so here you go, in all its suboptimally commented and early draft glory. Seriously, there are some really kludgy bits in there, and the model needs seriously refining. I'll talk about how and all the assumptions in a bit, as at the moment I have some other things to finish, but that's a working model that gives answers that aren't too bad all things considered.

And while a lot is a mess, I will however draw your attention to

skill = cumsum(seq(1:15)) * 5
mt = max(which(skill <= mt.xp))

which is downright elegant, and is how I find in this case a maga's magic theory score, although it works similarly for other arts and skills. For those of you who aren't R programmers, what I'm doing there is generating a sequence 5, 15, 30, ... with the cumulative sum command that has each nth element correspond to the experienced required to gain the nth level of a skill. Then I'm using which to give me the indices of all the members of that sequence which are equal or less to a maga's current magic theory experience total, and then plucking off the largest index, which will be her current score. How cute is that? It's probably the slickest bit of code in the entire program.

1 Like

Thank you.

And congratulations on the slick bit, it is indeed very nice :slight_smile:

Two thoughts if I may:

  1. A magi with an active longevity ritual should not be able to die of Crisis, since the ritual makes sure he survives it. (I might have misunderstood the code but it seemed to me like the Crisis canceled the ritual but still resolved the Crisis as normal. The Crisis should automatically succeed if there is a ritual present)

  2. The mage should aquire an extra simple die of warping from a twilight event. (I could not see anywhere where it was added)

Looks good :slight_smile:

You certainly may, as you are correct in both cases. In the first, I totally forgot that was a thing. Although as it turns out it doesn't matter — I have never seen a single magus die of a crisis in the thousands I've generated while stress testing this thing — but it shouldn't be possible at all. The second is just an oversight on my part, since the Twilight stuff was implemented over the course of a week in several sittings and I lost track of what I had done. It should be there, and just managed to get lost in the process. I'll see about fixing them when I have the time to make sure I don't break anything as I do so.

Edit: Which apparently meant in like ten minutes. All fixed, although now I have to give a loooot more thought to the warping and twilight system, both in terms of the assumptions about botch chances per year and auras and the like, and implementing cautious sorcerer, lab safety rating, and the golden cord. Currently that's sharing the top of my list with working out a better thought out algorithm for determining longevity ritual.

(I caught another bug while I was starting at it, too, but admittedly a subtle one that would rarely come up, I suspect, having to do with a placing of a break that could in theory allow someone to have two or more Final Twilights in the same year.)

So in theory, a magus who always played it safe to avoid twilight could live forever?

Assuming he could get a strong enough Longevity Ritual, yeah. But exploding dice do present a significant setback on the ideal of true immortality. May the odds be ever in your favor if you try, but I'd prefer to try to gain real immortality during the precious little time I have where Final Twilight isn't something that stops me in my tracks from ever doing anything remotely dangerous.

In addition, it not only becomes progressively harder to gain a sufficient ritual, as experience required is a cumulative sum to keep it up whereas your aging roll goes up linearly, but after you hit warping 10 every single time you have a magical botch you need to save or die with progressively more difficult rolls to avoid Final Twilight. But yes, in theory given arbitrarily good luck on your twilight comprehension rolls and with arbitrarily high skill values for CrCo you can live forever.

In practise you probably would cap out somewhere around 400 in my guesstimate.

My point is that if you take no risks where you could botch with magic you don't have to worry about twilight at all, jut an increasing warping score.

If you did no magic whatsoever, or at least did no magic with botch rolls, and then managed to avoid gaining two warping from other sources (such as other magi with CrVi spells and so on), and somehow still managed to get an ever more rapidly increasing longevity ritual, then yes, you could be effectively immortal. Although that second condition can't obtain for too long, so there are practical limits that make things like the greater elixir easier options.