![]() |
#1 |
Angband Devteam member
|
Artifact generation - what exactly do you care about?
With many thanks to Derakon for his unfailing patience, I've done a lot of work on item generation in Pyrel. I've written a fairly detailed description of how it works on the Pyrel wiki.
We have a choice to make about artifact generation. The way I've written it is the way it's done in v4, where every time an item is generated we do a single random check against what we now call artifactChance. If that chance is passed, you're guaranteed to get an artifact (if any are legal for your depth and not yet generated). If it's not, you get a normal item (which could then be magical or ego etc.). In v4, this chance is 1/400 for 'normal' drops, 1/50 for 'good' drops and 1/15 for 'great' drops. In Pyrel you can set it to whatever you want using the new loot system. If you so desire, you can set it differently for each monster. Derakon had envisaged a completely different way of doing this, which is to put artifacts and base items together in a single allocation table. Obviously the artifacts would have much lower commonness than normal items. If you get a normal item it is still checked for affixes and themes (magic, ego etc.) in the normal way. Both will work, and there would be no difference at all to the player. Sometimes you get an artifact, most times you don't. The difference is in how devs and source-divers and other numerate players understand the probabilities. The second method allows you to say, unequivocally, that The One Ring is X times rarer than a dagger (though that dagger could be plain +0,+0 or an awesome Holy Avenger with extra dice). X is simply the ratio of the One Ring's commonness against the dagger's commonness. The same comparison can be made between any artifact and any base item. The first method doesn't allow us to do that easily. We can still do it using monte carlo simulations, but that isn't the same degree of certainty at all. But what the first method does allow us to do is know exactly what the likelihood is of generating *an* artifact. The second method obfuscates this - you can calculate it (sum of artifact commonnesses / sum of all commonnesses) but it's not readily available, and will differ for each allocation table. Does anyone else have a view on whether either of these is important? Are there any other reasons for choosing one method over the other? Is this all a monstrously abstruse waste of everybody's time? (N.B. Both methods allow fine-tuning of *relative* artifact rarities, so I haven't mentioned this. You can tweak how often Nimthanc appears relative to Soulkeeper in both cases. The difference is about how we manage artifact rarity relative to non-artifacts.)
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
![]() |
![]() |
![]() |
#2 |
Scout
Join Date: Nov 2012
Posts: 35
![]() |
I don't see why you couldn't have the best of both worlds...
I believe the 3.4.1 codebase uses some sort of 'commonness' value, where if the commonness of a dagger is 30 and of a blade of chaos is 1, then a dagger is 30 times more common than a blade of chaos. If I am wrong, ignore the rest of my message. ;-) Let the sum of the commonesses of objects be O and let the sum of commonnesses of artifacts be A. If we want there to be exactly a 1/400 chance of generating an artifact, we could scale all of the object commonnesses by (399*A)/O and then do a object generation as Derakon suggests. This would lead to artifacts being generated 1/400 of the time, and in addition we can easily calculate the relative rarity of any two objects or artifacts. How do you intend to handle this on a level by level basis? Would you basically have 101 allocation tables with commonnesses of every object/artifact on a level by level basis? Dave |
![]() |
![]() |
![]() |
#3 | ||
Angband Devteam member
|
Quote:
Quote:
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
||
![]() |
![]() |
![]() |
#4 |
Prophet
Join Date: Dec 2009
Posts: 8,940
![]() |
If you do want to have artifacts be "special" somehow (in terms of allocation), my suggestion for how to do this would be to have a proc attached to the LootTemplate that scales objects' commonness values. So you'd have a SetArtifactChance proc in the LootTemplate that would be handed an ItemAllocator and would then modify the table in the allocator so that the chance of generating an artifact would be the desired value.
This would, yes, break the ability to say "this artifact is always X times less common than this non-artifact". And I don't think it's necessary. But if we wanted to do it, that's how I'd suggest it be done. |
![]() |
![]() |
![]() |
#5 |
Scout
Join Date: Nov 2012
Posts: 35
![]() |
OK -- since we are constructing a set of allocation tables, there is no reason that the scaled values stored in these tables can't be precomputed.
Define A and O as before. Scale all objects by 399A, and all artifacts by O (for a normal drop). These scaled values are what is stored in the allocation tables. As before, the chance of an artifact is exactly 1/400, and these scaled values are directly proportional to the probability of those objects being generated and hence can be directly compared. These tables could be generated every time the lib/edit files were modified and stored as a human readable data file. As an aside, how do people access the data in Derakon's allocation table now? Is it stored in a source file or in a generated data file? The answer to that may change my answer as to how to do this combining both approaches. |
![]() |
![]() |
![]() |
#6 |
Prophet
Join Date: Dec 2009
Posts: 8,940
![]() |
Currently the table is not directly accessible; it is always recomputed at runtime (indeed, every time a new ItemAllocator is needed). Seeing as we may need many subtly different allocators (e.g. if you want an orc-themed allocator then there's no point in including spellbooks in the table), I see little point in precompiling the tables and storing them somewhere. At most a cache might come in handy so we can avoid generating identical Allocators over and over.
|
![]() |
![]() |
![]() |
#7 |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,002
![]() |
I prefer the first method, and it's probably likely due to conversations we've had in the past. I'll provide my reasoning.
The second method is based off of the idea that the artifact is a more powerful version of a specific weapon type. Therefore, it makes intuitive sense to tie the artifact generation chance to the generation chance of that object type. The first method separates artifacts altogether. The implication is that an artifact is more than just a more powerful version of a weapon. The reason I think this is the way to go is because artifacts have a much broader range of skills than normal ego items. They can also have varying physical traits like weights or base values. So when it comes to comparing them to the base items, the artifacts often have no gameplay relation to the base item besides the name. Lastly, from a tweaking perspective, I think it's easier if we always make the check for the most powerful/rarest occurrence first and then work our way down to the more common and weaker options. |
![]() |
![]() |
![]() |
#8 |
Scout
Join Date: Nov 2012
Posts: 35
![]() |
In that case, I don't see what's wrong with my suggestion (admittedly this could be temporary blindness on my part...)
For a given ItemAllocator (i.e. level 50, normal drop) we can calculate O and A at runtime and then scale all objects by 399A and all artifacts by O. These scaled values are used to generate the object. Artifacts have exactly a 1/400 chance of being generated, and the scaled values can be compared directly if one wants to compare relative rarities. It works just as well as it works now, with the additional benefit that we can directly control artifact frequency. After thinking about this a little more, I believe that the distribution of drops produced by an allocation table generated in this way is equal to the distribution of drops generated by Magnate's algorithm. It really does encompass both techniques. Last edited by hyperdex; December 21, 2012 at 01:31. |
![]() |
![]() |
![]() |
#9 | |
Prophet
Join Date: Dec 2009
Posts: 8,940
![]() |
Quote:
Code:
Method 1: explicit artifact check. if 1 in (artifact chance): generate artifact table try to select item from artifact table if selection succeeds: return artifact otherwise continue as normal generate table of all non-artifact items select item from table Code:
Method 2: artifacts in with everything else generate table of all items (including not-yet-generated artifacts) select item from table Code:
Entries item 0-40 Dagger 40-80 Potion of Cure Light Wounds ... 1000-1010 Blade of Chaos 1010-1020 Potion of Strength ... 10000-10000.1 Narthanc ... 50000-50000.0001 The One Ring |
|
![]() |
![]() |
![]() |
#10 | |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,002
![]() |
Quote:
Also, my brain is at something like 30% now, so it's possible that I'm blabbing with little actual reasonableness. |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Artifact Generation Rate | Old Coach | v4 | 2 | January 29, 2012 04:45 |
3.3 artifact generation | bulian | Vanilla | 13 | October 12, 2011 18:34 |
Artifact generation: some interesting stats | PowerWyrm | Vanilla | 26 | June 20, 2011 19:34 |
Object generation in 3.1.2 | PowerWyrm | Vanilla | 4 | May 7, 2010 23:08 |
item generation | bron | Vanilla | 21 | November 25, 2009 07:55 |