Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old September 7, 2011, 12:40   #1
PowerWyrm
Knight
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 720
PowerWyrm is on a distinguished road
[3.3] Potential problem with low power random artifacts

From scramble_artifact() in randart.c:

Code:
/* Set depth and rarity info according to power */
...
a_ptr->alloc_max = MIN(127, (ap * 4) / 5);
a_ptr->alloc_min = MIN(100, ((ap + 100) * 100 / max_power));
The problem here is that for ap less than 20, the result is a_ptr->alloc_max less than a_ptr->alloc_min.

From make_artifact():

Code:
/* Enforce maximum depth (strictly) */
if (a_ptr->alloc_max < p_ptr->depth) continue;
This means that low power random artifacts will have a really small depth range. If the item has a base level that is much higher, the random artifact may even never be generated.

Another problem, from make_artifact():

Code:
		/* XXX XXX Enforce minimum "depth" (loosely) */
		if (a_ptr->alloc_min > p_ptr->depth)
		{
			/* Get the "out-of-depth factor" */
			int d = (a_ptr->alloc_min - p_ptr->depth) * 2;

			/* Roll for out-of-depth creation */
			if (randint0(d) != 0) continue;
		}
After enforcing that depth is lower than a_ptr->alloc_max, a rarity penalty is applied for out-of-depth randarts. With low ap randarts, since a_ptr->alloc_max is less than a_ptr->alloc_min, they are all considered out-of-depth! The out-of-depth factor will also increase as ap decreases... leading to less powerful randarts being generated... less often.

Fix: ensure that a_ptr->alloc_max is always greater than a_ptr->alloc_min
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old September 7, 2011, 12:49   #2
PowerWyrm
Knight
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 720
PowerWyrm is on a distinguished road
For a_ptr->alloc_max, something should also ensure that the artifact has some decent chance to be generated. This means checking somehow against kind->alloc_min...
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old September 7, 2011, 12:50   #3
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,988
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by PowerWyrm View Post
From scramble_artifact() in randart.c:

Code:
/* Set depth and rarity info according to power */
...
a_ptr->alloc_max = MIN(127, (ap * 4) / 5);
a_ptr->alloc_min = MIN(100, ((ap + 100) * 100 / max_power));
The problem here is that for ap less than 20, the result is a_ptr->alloc_max less than a_ptr->alloc_min.

From make_artifact():

Code:
/* Enforce maximum depth (strictly) */
if (a_ptr->alloc_max < p_ptr->depth) continue;
This means that low power random artifacts will have a really small depth range. If the item has a base level that is much higher, the random artifact may even never be generated.

Another problem, from make_artifact():

Code:
		/* XXX XXX Enforce minimum "depth" (loosely) */
		if (a_ptr->alloc_min > p_ptr->depth)
		{
			/* Get the "out-of-depth factor" */
			int d = (a_ptr->alloc_min - p_ptr->depth) * 2;

			/* Roll for out-of-depth creation */
			if (randint0(d) != 0) continue;
		}
After enforcing that depth is lower than a_ptr->alloc_max, a rarity penalty is applied for out-of-depth randarts. With low ap randarts, since a_ptr->alloc_max is less than a_ptr->alloc_min, they are all considered out-of-depth! The out-of-depth factor will also increase as ap decreases... leading to less powerful randarts being generated... less often.

Fix: ensure that a_ptr->alloc_max is always greater than a_ptr->alloc_min
This one isn't quite so terrible, but thanks for spotting and reporting. Randarts don't get power below 35 (the Phial), so the <20 issue doesn't arise. I can't imagine a standart weaker than the Phial that would get added to V, but you're right that an assert would be a useful sanity check.

Second, the special artifacts (which include the two lowest-powered, the Phial and Star) have different code governing their max depths, so they have a broader range. It does mean that very weak weapons and armour (which tend to start at power ~50) have a small range in which to be found, but ...

... I'm going to rewrite randart.c completely for 3.4, and the depth and alloc computation will be different.
__________________
"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
Magnate is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[3.3] Potential crash with multiple pval system PowerWyrm Vanilla 6 October 7, 2011 11:11
Calculating potential damage... Maybe a stupid question... saw Vanilla 5 July 24, 2010 07:10
Low Brow Question z118 Vanilla 6 February 2, 2010 16:02
Random questions - randarts and artifacts dhegler Vanilla 14 December 24, 2009 01:24
My first real potential winner... s0be Vanilla 6 February 4, 2008 08:02


All times are GMT +1. The time now is 08:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.