View Single Post
Old June 28, 2012, 16:36   #1
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,403
PowerWyrm is on a distinguished road
[3.4RC] There may not be much interesting here...

Level was generated with a D pit and a GCV, I was expecting "superb treasures"...

In fact, this is easily explained. Excerpt from the code:

if (rating > 250000) rating = 250000;

        c->obj_rating += (rating / 10) * (rating / 10);
obj_rating is coded on an unsigned integer, which maxes at roughly 4e+9. Any WoG, Kelek or high DSM will easily get a max rating of 250k when generated out of depth in a GCV, which boosts the object rating by 625mil. And a GCV easily has more than 7-8 of those, boosting object rating over the MAXINT limit.

Using a percent of the rating would probably fix the problem:

c->obj_rating += (rating / 100) * (rating / 100);
This means losing a bit of accuracy with low ratings, but I don't think it matters much what type of "cobwebs" you get on a junk level
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm is offline   Reply With Quote