Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old October 20, 2014, 00:13   #1
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,603
Ingwe Ingweron is on a distinguished road
?Acquirement location of reading revisited

I know this has been discussed before, with the conclusion that the location of reading ?Acquirement did not matter. However, I am convinced that it does, although I haven't parsed through the code. In the code for the ?Acquirement, is it checking the dl @ is actually on, or is it checking the dl of the particular location?

My understanding is that certain locations in vaults are identified with an "8", "9", or ",", signifying treasure 20, 7, or 7 levels out of depth, respectively. When the ?Acquirement is read at an "8" location, it seems to consistently deliver better results than when read elsewhere.
Ingwe Ingweron is offline   Reply With Quote
Old October 20, 2014, 00:46   #2
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,374
Derakon is on a distinguished road
You're imagining things. The only thing that matters for where you read Acquirement is the depth of the dungeon you're at.

...well, I guess if you read the scroll in a location where there was no room to drop an item, then that would matter, because you'd lose the item generated. So don't do that.

EDIT: to clarify, the acquirement effect simply calls make_object() with the "good" and "great" flags set and an appropriate item level. Only after it has been made is it "moved" to the position in the dungeon where you are standing (or an adjacent location as appropriate). make_object() has no idea where you are and does not care.

Last edited by Derakon; October 20, 2014 at 00:52.
Derakon is offline   Reply With Quote
Old October 20, 2014, 01:45   #3
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,603
Ingwe Ingweron is on a distinguished road
Ah, but what is the appropriate item level? When a vault is created, isn't the same item generation happening, with good and great flags set to the depth, but with the depth modified at certain locations within the vault? How is make_object() choosing the depth? Are you certain that the depth measurement for ?Acquirement is not taking into account the location just like the vault generation? I've tested it out empirically and I can say that there seems to be a definite difference when standing on an "8" location.

Last edited by Ingwe Ingweron; October 20, 2014 at 01:53.
Ingwe Ingweron is offline   Reply With Quote
Old October 20, 2014, 02:36   #4
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,374
Derakon is on a distinguished road
Quote:
Originally Posted by Ingwe Ingweron View Post
Ah, but what is the appropriate item level? When a vault is created, isn't the same item generation happening, with good and great flags set to the depth, but with the depth modified at certain locations within the vault? How is make_object() choosing the depth? Are you certain that the depth measurement for ?Acquirement is not taking into account the location just like the vault generation? I've tested it out empirically and I can say that there seems to be a definite difference when standing on an "8" location.
I repeat, you're imagining things. Here's the complete source code for the acquirement function:

Code:
void acquirement(int y1, int x1, int level, int num, bool great)
{
  object_type *i_ptr;
  object_type object_type_body;
  /* Acquirement */
  while (num--)
  {
    /* Get local object */
    i_ptr = &object_type_body;
    /* Wipe the object */
    object_wipe(i_ptr);
    /* Make a good (or great) object (if possible) */
    if (!make_object(cave, i_ptr, level, TRUE, great, TRUE, NULL, 0)) continue;
    i_ptr->origin = ORIGIN_ACQUIRE;
    i_ptr->origin_depth = p_ptr->depth;
    /* Drop the object */
    drop_near(cave, i_ptr, 0, y1, x1, TRUE);
  }
}
And here's the definition for the effects of the Acquirement and *Acquirement* scrolls:

Code:
case EF_ACQUIRE:
{
  acquirement(py, px, p_ptr->depth, 1, TRUE);
  *ident = TRUE;
  return TRUE;
}
case EF_ACQUIRE2:
{
  acquirement(py, px, p_ptr->depth, randint1(2) + 1, TRUE);
  *ident = TRUE;
  return TRUE;
}
Note the use of p_ptr->depth, i.e. the player's current dungeon level, as the only level determinant.
Derakon is offline   Reply With Quote
Old October 20, 2014, 13:35   #5
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,110
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Ingwe Ingweron View Post
When a vault is created, isn't the same item generation happening, with good and great flags set to the depth, but with the depth modified at certain locations within the vault? How is make_object() choosing the depth?
What happens is that when the vault code encounters an '8', it calls make_object with the depth set to the current dungeon depth + 20; but this is only for that call, it's not generally set. Moreover, the fact that that was an '8' square is not remembered anywhere after the '8'-ness of it has been used to determine the level of monster and object generated there. The only remaining difference between that square and any other on the level after generation is that vault squares can't be teleported onto.

After the restructure who knows, anything might happen
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old October 20, 2014, 13:56   #6
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,603
Ingwe Ingweron is on a distinguished road
Thanks Derakon and Nick. Ugh, I just need to get my head examined.
Ingwe Ingweron 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
Reading scrolls from inventory menu Ingwe Ingweron Vanilla 1 October 22, 2013 12:42
Nightlies: Bug reading Rune scroll off ground Max Stats Development 2 April 17, 2011 16:13
crash after reading scroll of trap creation in town Maupin Development 1 August 3, 2009 08:21
Debugging/cheating revisited... delicreep Vanilla 1 April 15, 2008 22:52
strange C code in Angband (am I reading this right?) will_asher Idle chatter 3 February 4, 2008 09:07


All times are GMT +1. The time now is 01:24.


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