Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old November 14, 2009, 09:25   #1
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 432
bron is on a distinguished road
no-artifact creation bug in 3.1.1.1626

So I'm playing a game with birth-no-artifacts as is my wont, and just now I killed Eol, and he dropped ... nothing. Zip. Nada. Since he is hardwired to drop at least a couple of good objects, I wondered how this was possible. Looking at the code, I see at least one problem: in obj-make.c, routine make_object we see:

...
/* Try to make a special artifact */
if (one_in_(good ? 10 : 1000))
return make_artifact_special(j_ptr, lev);
...

and of course the first executable line of make_artifact_special is:

...
if (OPT(adult_no_artifacts)) return (FALSE);
...

All of which means that if the RNG smiles upon me and would have tried to create a special artifact in a normal game, in a no-artifacts game I get squat.

The simple remedy is to test before calling make_artifact_special (well, actually I guess the simple remedy is to do nothing, but aside from that):
...
if (one_in_(good ? 10 : 1000) && (!(OPT(adult_no_artifacts)))) {
return make_artifact_special(j_ptr, lev);
}
...

Personally, I think that if no-artifacts is set, then as a consolation prize one should have a chance at a great object, maybe something like:

...
if (one_in_(good ? 10 : 1000)) {
if (OPT(adult_no_artifacts)) {
if (one_in_(10)) good = great = TRUE;
}
else {
return make_artifact_special(j_ptr, lev);
}
}
...


But then again, it seems that this whole thing is a bit unfair even in a normal artifacts game, since even there if make_artifact_special fails, you get nothing. So I guess what I really think this should be is:

...
if (one_in_(good ? 10 : 1000)) {
if (make_artifact_special(j_ptr, lev)) return TRUE;
/* else possible consolation prize */
if (one_in_(10)) good = great = TRUE;
}
...

i.e. only return early if in fact you make a special artifact, otherwise go ahead and make the (normal/good/great) object that you tried to turn into a special artifact.
bron is offline   Reply With Quote
Old November 14, 2009, 09:53   #2
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Thank you - I always wondered why I very occasionally get no drop from uniques who are guaranteed to drop GOOD or better. It must be trying to create a special artifact and failing. I'll try and implement your consolation prize idea.
Magnate is offline   Reply With Quote
Old November 14, 2009, 10:35   #3
Psi
Knight
 
Join Date: Apr 2007
Location: Surrey, UK
Age: 42
Posts: 870
Psi is on a distinguished road
Does that explain why wormy sometimes drops nothing in a normal game?
Psi is offline   Reply With Quote
Old November 14, 2009, 11:06   #4
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Psi View Post
Does that explain why wormy sometimes drops nothing in a normal game?
Yes. The Phial now has rarity 3, so two-thirds of the time he would drop it, he drops nothing. In the old 2.9.x days it had rarity one, so this never happened.
Magnate is offline   Reply With Quote
Old November 15, 2009, 15:08   #5
ChodTheWacko
Adept
 
Join Date: Jul 2007
Posts: 155
ChodTheWacko is on a distinguished road
Yea, if make_artifact_special returns FALSE, you get nothing at all right now.
You should still continue, and try to make an object.

I don't know if you necessarily want to add the:
'if (one_in_(10)) good = great = TRUE;'
part, since that is already done in apply_magic()

As far as wormtongue goes, he has DROP_GOOD/DROP_GREAT flags, so the good/great flags are already true to begin with.

- Frank
ChodTheWacko is offline   Reply With Quote
Old November 17, 2009, 07:41   #6
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 432
bron is on a distinguished road
Quote:
Originally Posted by ChodTheWacko View Post
that is already done in apply_magic()
My thought was that if you passed the "attempt to make a special artifact" test, that you should get some residual goodness out of that in case you didn't get the special artifact. But my main beef is with items not being generated at all: it looks like 1 out of 10 good items go down this path and disappear, except for the very few that are actually turned into special artifacts. Which is zero in a no-artifacts game. So only changing:
...
return make_artifact_special(j_ptr, lev);
...
to instead be:
...
if (make_artifact_special(j_ptr, lev)) return TRUE;
...

without the other stuff, would be ok.
bron is offline   Reply With Quote
Old November 17, 2009, 08:52   #7
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by bron View Post
My thought was that if you passed the "attempt to make a special artifact" test, that you should get some residual goodness out of that in case you didn't get the special artifact. But my main beef is with items not being generated at all: it looks like 1 out of 10 good items go down this path and disappear, except for the very few that are actually turned into special artifacts. Which is zero in a no-artifacts game. So only changing:
...
return make_artifact_special(j_ptr, lev);
...
to instead be:
...
if (make_artifact_special(j_ptr, lev)) return TRUE;
...

without the other stuff, would be ok.
This was fixed in r1721, so is fixed in the nightly builds.
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
Build 1626 - Small error Bad Tempered Geezer Vanilla 0 August 23, 2009 00:20
Is there a bug in changing Maximize during Character Creation? Miles Vanilla 3 June 29, 2009 03:54
r1443: artifact bug bebo Vanilla 1 June 18, 2009 20:38
Bug! trap creation in town freeze Dubtrain Vanilla 1 March 7, 2009 01:45
V 3.1.0 beta - artifact weapon bug Phoenix21692 Vanilla 1 January 13, 2009 16:37


All times are GMT +1. The time now is 14:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.