Hi all. myshkin and fizzix each independently wrote some code for collecting stats in V, and we've been discussing how to harmonise it into a single set of functions that will be useful to everyone. So this thread is to gather views from variant writers and others who are interested in stats. We're talking about monte carlo stats, i.e. gathered from large numbers of simulated levels/monsters, not derived algorithmically. In summary it should work a bit like this:
1. We generate each dungeon level from 1-100
2. On each level we collect a percentage of the floor and chest loot, and a percentage of the monster drops, according to how fast we're diving. So 100% is full level-clearing, while (say) 10% is extremely fast diving. This isn't quite how it works yet - when it gets more sophisticated we can use monster power to determine which drops we might collect, and compute path distances to determine which floor loot, but for now we represent diving by just clearing every Nth level and skipping the others completely. (N.B. We don't generate any summoned monsters or their drops - yet. We don't read acquirement scrolls either.)
3. We unkill all the uniques, un-make all the artifacts, and start again. After tens of thousands of runs, you have vaguely useful stats. After a few million, they become quite reliable (subject to the limitations of the RNG).
Now, a single run of full-clearing generates about 5000 items and 10000 monsters, which is about 500k of raw data. So we need to do some aggregation of the data to avoid ending up with gigabytes of raw data from a single sim. I was thinking that a data structure could contain all the data for a specific level - so we'd need a hundred of them, which get added to each run:
That is:
kinds - the number of each base object generated on that level, indexed by origin (floor, vault floor, monster, vault monster, pit monster, unique) EDIT: I forgot that pits now have floor objects too.
egos - the number of each ego type per base item - slight overkill but it's important to be able to distinguish between daggers and blades of chaos for a given ego type
arts - the number of times each artifact is found on that level
flags - the number of times each object flag is found on each item type (as with egos, the item type matters), indexed by pval if it's a pval flag
races - number of each monster type, or number of times unique is seen on that level
EDIT: vaults - the number of times each vault is generated on that level (could easily include pit/nest types too)
I think this structure would enable us to work out most of what we would want to calculate - what's the earliest I'm likely to see resist chaos and on what sort of item, what's the most common depth for a holy avenger, is the pval on speed rings noticeably depth-dependent, etc.
Comments, thoughts?
1. We generate each dungeon level from 1-100
2. On each level we collect a percentage of the floor and chest loot, and a percentage of the monster drops, according to how fast we're diving. So 100% is full level-clearing, while (say) 10% is extremely fast diving. This isn't quite how it works yet - when it gets more sophisticated we can use monster power to determine which drops we might collect, and compute path distances to determine which floor loot, but for now we represent diving by just clearing every Nth level and skipping the others completely. (N.B. We don't generate any summoned monsters or their drops - yet. We don't read acquirement scrolls either.)
3. We unkill all the uniques, un-make all the artifacts, and start again. After tens of thousands of runs, you have vaguely useful stats. After a few million, they become quite reliable (subject to the limitations of the RNG).
Now, a single run of full-clearing generates about 5000 items and 10000 monsters, which is about 500k of raw data. So we need to do some aggregation of the data to avoid ending up with gigabytes of raw data from a single sim. I was thinking that a data structure could contain all the data for a specific level - so we'd need a hundred of them, which get added to each run:
Code:
struct level[100] { int kinds[z_info->k_max][ORIG_MAX]; int egos[z_info->k_max][z_info->e_max][ORIG_MAX]; int arts[z_info->a_max][ORIG_MAX]; int flags[z_info->k_max][OF_MAX][PVAL_MAX]; int races[z_info->r_max]; int vaults[z_info->v_max]; };
kinds - the number of each base object generated on that level, indexed by origin (floor, vault floor, monster, vault monster, pit monster, unique) EDIT: I forgot that pits now have floor objects too.
egos - the number of each ego type per base item - slight overkill but it's important to be able to distinguish between daggers and blades of chaos for a given ego type
arts - the number of times each artifact is found on that level
flags - the number of times each object flag is found on each item type (as with egos, the item type matters), indexed by pval if it's a pval flag
races - number of each monster type, or number of times unique is seen on that level
EDIT: vaults - the number of times each vault is generated on that level (could easily include pit/nest types too)
I think this structure would enable us to work out most of what we would want to calculate - what's the earliest I'm likely to see resist chaos and on what sort of item, what's the most common depth for a holy avenger, is the pval on speed rings noticeably depth-dependent, etc.
Comments, thoughts?
Comment