|
|
#51 | |
|
Swordsman
Join Date: Jun 2007
Posts: 340
![]() |
Quote:
However, it's pretty hard to see if this would have any limitations of your current code structure -- I think you should probably post code on github if you want to get more constructive feedback.
|
|
|
|
|
|
|
#52 | ||||
|
Angband Devteam member
|
Quote:
Quote:
Quote:
How would you deal with the fact that not every item is a legal pick for every call to the table? This is the main reason for dynamic tables, when drops are limited. (The normal limitation is depth, but this isn't situational - you can make 100 allocation tables at the start of the game to cover all levels.) What if I want snagas to be able to drop food, weapons and armour but not potions, scrolls or devices? With a static table you'd ignore or re-try illegal picks? Separately, how do you decide on affix generation / item promotion? With v4 we still have the old distinction between 'normal' and 'good' objects for this, but presumably you'd have nothing so clumsy. Will it be an inherent property of the table, i.e. if a dagger as 200,000 entries, the last 50,000 have increasing numbers of affixes? 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 Last edited by Magnate; June 5, 2012 at 09:35. |
||||
|
|
|
|
|
#53 | ||||
|
Prophet
Join Date: Dec 2009
Posts: 4,771
![]() |
Quote:
Quote:
Quote:
Quote:
In the meantime, you don't really need magical gear, right? ![]() Oh, incidentally -- quoting your posts is kind of a pain because you don't put any newlines into 'em. I've noticed that the BB software here automatically puts in a minimum amount of vertical space between quoted text and non-quoted text (i.e. it adds newlines if you left them out of your post), so you may as well put them in.
|
||||
|
|
|
|
|
#54 | |||
|
Angband Devteam member
|
Quote:
- cannot drop anything heavier than 10lbs - can drop food with increased probability for beverages (3x for orcish firewater) - can drop only items with gemstone flavours - can drop anything except diggers Admittedly this is more control than we have now - we can currently specify only tval, sval and amount for not-totally-random drops. But my guess is that this is all leading us towards dynamic table creation ... Quote:
1. We arrive at a point where we're creating a wearable item (including ammo; doesn't currently apply to jewelry, but it will soon) - so we call apply_magic. It takes an int and two bools: the item creation level (dlev with possible increases e.g. for vault items), whether it's 'good', and whether it's 'great'. (These two could easily be replaced with a more sophisticated reckoning of an item's quality or potential.) (I'm leaving artifacts aside - for unspecified drops we have already checked before we get here so we know it's not an artifact.) 2. We establish the *type* of affixes available to it: by default any item can have any affixes deemed Bad, Average or Good (levels 1-3). Note that this does not require the 'good' bool - poor use of terminology on my part. Depending on the passed-in creation level, the bools and some randomness, the min and max affix levels can increase: better and deeper items have access to higher affix categories (Great and Uber, and one day maybe Artifact affixes), and they also are more likely not to have Bad or Average affixes. 3. We calculate the *number* of affixes it will have. This is basically a function of the passed-in creation level, randint0(2 + lev / 20). So 0-1 at shallow depths, up to 0-5 at dl80. Plus 1d2 if good and 1d2 if great, +1 if it has access to Great affixes, for a range of 3-10 for the best endgame items, but capped at 8. This algorithm phases out junk pretty well as you go through the game - it currently leads to overpowered weapons though, because we don't have enough weapon affixes available (most of them tend to increase damage output). 4. We then call obj_add_affix until we've added them all OR acquired a theme. This contains a small chance of boosting the affix category - so an item might get a single Great affix even though it was only supposed to get access to Good ones. There's no real driver for this other than the pre-existing GREAT_EGO check (which used to allow OOD generation of ego types). This check also boosts the creation level, so a shallow item with a single affix might still get an endgame affix on it, once in a blue moon. Anyway, we build an allocation table (obj_find_affix) of legal affixes every time we add one. It would be more efficient to build it once, because at the moment it depends only on the item's tval, sval, creation level and allowed affix categories. But building it on the fly will come into its own when we implement affix compatibility - i.e. X is not legal if we already have Y, etc. After we've built and picked from the table, we actually apply it (ego_apply_magic). Then we check for breakage using object_power, rolling back if necessary. Then we check for a theme - again, we build an allocation table of available themes and roll for one. This does need to be dynamic, because it depends on the affixes on the item. HTH. Happy to expand. 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 |
|||
|
|
|
|
|
#55 |
|
Prophet
Join Date: Dec 2009
Posts: 4,771
![]() |
Well, of course it's easier to quote when your post itself contains multiple paragraphs.
But yes, that does seem better. Not that I'm actually quoting in response.Anyway, regarding item selection for drops, it sounds like you basically want a selection of filters which would specify either a (set of) flag(s) that must be present on the item (e.g. ORCISH, GEMSTONE) or a feature of the item that must match some conditional (e.g. "weight < 10", "type is potion"). Affix-based drops are something that I think we leave for much later, since there's some question of how exactly you do that -- do you automatically apply a gemstone affix to every affixable item the creature drops? I'd rather leave the item generator "pure" (i.e. context-agnostic) as long as possible. But everything else should be comparatively straightforward. Thanks for the rundown on how affix generation is handled in v4. Here's how I'd re-implement it in Pyrel, I think (and again, this is just off the cuff, so I may well be missing subtleties). 1) drop_good and drop_great are replaced by boosts to the item's level. Thus a creature with the current equivalent of DROP_GOOD | ONLY_ITEM would be able to drop any non-money item at an effective level of, say, +15. Further limitations could be applied; presumably we'd also want most creatures with DROP_GOOD to also have a limitation to only drop wearable items, ammunition, dungeon spellbooks, and certain high-end consumables. But we could also add e.g. a filter to let uniques prior to level 20 potentially drop stat-gain potions. 2) We use the item's level to decide a target power level. In practice this defines a region of power levels (N +- X). 3) We pick an affix at complete random (no categorization of affixes), add it to the item, and calculate its power level. If it's in the target region, then we're done; if it's over the maximum, then we reject that affix and try again; otherwise, we try again. We have a max repeat on attempts to add affixes, of course, so we don't get stuck. Of course a "bad" affix would always succeed at this point since it doesn't increase the item's power, but see below. 4) Every time we add an affix, we check for theming; if the item matches a theme then we apply it and bump the item's power to suit (and again, rolling back the theme if it pushes the power too high). Assuming we have a good item power calculation, this seems like it would avoid the issue currently in v4 where items end up getting overpowered later on. However, it doesn't break down the affixes by quality, so you could still be seeing e.g. "broken" items in the late game. I anticipate affixes having allocation rules much like items do where they have native depths and frequencies within those depths, though, so such affixes shouldn't show up as often as you go deeper, just like you don't often see e.g. Scrolls of Blessing in the late game. |
|
|
|
|
|
#56 | |||
|
Angband Devteam member
|
Quote:
Quote:
Quote:
I see the categories as a helpful way to manage relative rarity at a high level, and to help conceptualise generation (sub-great items can't get X & Y, etc.). You could indeed do away with them and manage simply with allocation info (min/max depth, frequency - not all affixes are equally likely, item-specificity - an affix can be commonplace on shields but very rare on weapons etc.). It ends up being a different way to present the same data. You're right that a target power level will avoid overpowered late-game items. I've never had the confidence in object_power to take that approach: I'd be happy to work with you on reimplementing object_power, having got about as far as I can with the existing version. (I realised that to get any further I'd need to create a dummy player struct with generic endgame stats and kit, and that seemed like a lot of work for minimal gain.)
__________________
"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 |
|||
|
|
|
|
|
#57 | ||
|
Prophet
Join Date: Dec 2009
Posts: 4,771
![]() |
Quote:
Quote:
|
||
|
|
|
|
|
#58 | ||
|
Angband Devteam member
|
Quote:
Quote:
So this means that what we actually want to rethink/improve is the monster power calc. It's not bad - nullfame made some significant improvements - but it still relies on some fairly dodgy constants (damage equivalents for non-damage spells).
__________________
"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 |
||
|
|
|
|
|
#59 | |
|
Knight
|
Quote:
![]() One Ring = 1 Artifact = 1e3 Amulet of sustenance = 1e5 Food ration = 1e6
__________________
You read the scroll labeled NOBIMUS UPSCOTI... You are surrounded by a stasis field! The tengu tries to teleport, but fails! |
|
|
|
|
|
|
#60 | ||
|
Prophet
Join Date: Dec 2009
Posts: 4,771
![]() |
Quote:
Quote:
More generally, there's nothing that says that the minimum rarity must be 1. Pyrel supports floating-point, so we could have values ranging from e.g. .001 to 1000 and still have that "common thing is a million times more common than rare thing" range. If ints are needed code-side then the code can simply apply a constant scaling factor based on the smallest value used in the data file. |
||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Angband 3.5-dev | Magnate | Vanilla | 70 | July 2, 2012 16:47 |
| JBand progress log. | PaulBlay | Development | 38 | June 27, 2009 09:19 |
| Hackers triumph over pricing.log beast-file ... | Magnate | Vanilla | 3 | April 22, 2009 23:00 |
| Angband/65 development log | PaulBlay | Development | 0 | April 16, 2009 18:55 |
| Export entire message log to text file | PaulBlay | Vanilla | 2 | February 28, 2009 19:24 |