Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 28, 2022, 23:58   #1
Sky
Veteran
 
Join Date: Oct 2016
Location: London-ish
Age: 50
Posts: 2,086
Sky is on a distinguished road
something's wrong with The One Ring

i have noticed that The One Ring consistently generates very mild level feelings.
I have just found it in a undead pit at DL98 with a LF 6-6.

A Dragon Armour will generate a LF x-8 and a good RoP will be x-9.
PDSM is LF x-9.

Dragon Armours have a power of 500-700, The One Ring has a power of 1.4M; is this some sort of bit-wraparound problem?
__________________
"i can take this dracolich"
Sky is offline   Reply With Quote
Old June 29, 2022, 01:35   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,405
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
The object rating is a 32-bit integer, so that shouldn't be causing a wrap problem. Was it lying on the floor, or dropped by a monster?
__________________
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 June 29, 2022, 09:42   #3
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,938
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Sky View Post
The One Ring has a power of 1.4M; is this some sort of bit-wraparound problem?
I think that's normal because the One Ring has multiple sets of abilities (like all immunities or all abilities) that trigger some INHIBIT_POWER numbers which multiply themselves. There must be an integer overflow in the object feeling code instead.

Edit: I checked my variant and the One Ring has a power of 20000 which is exactly INHIBIT_POWER, so indeed it's a bug in power calculation.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

Last edited by PowerWyrm; June 29, 2022 at 09:47.
PowerWyrm is offline   Reply With Quote
Old June 29, 2022, 19:58   #4
Sky
Veteran
 
Join Date: Oct 2016
Location: London-ish
Age: 50
Posts: 2,086
Sky is on a distinguished road
Quote:
Originally Posted by Nick View Post
The object rating is a 32-bit integer, so that shouldn't be causing a wrap problem. Was it lying on the floor, or dropped by a monster?
nope, on the ground. "in a pit".
d) the Ring of Power 'The One Ring' (+15,+15) <+5>
Found lying on the floor in a pit at 4900 feet (level 98)

it wasn't just this once, i've found it 4 times since, well, my last visits, and every time i noticed it was a LF x-7, this time, it was LF 6-6 !

You had mentioned that level feelings are just the amount of money (as in, value of the items) that's on the ground so i thought, maybe they are capped at 30k as in the shops. Maybe thats why a big vault full of random egos has a higher value.
__________________
"i can take this dracolich"
Sky is offline   Reply With Quote
Old June 29, 2022, 23:54   #5
sffp
Swordsman
 
Join Date: Apr 2020
Location: DC Area
Posts: 339
sffp is on a distinguished road
I have never found this ring
sffp is offline   Reply With Quote
Old June 30, 2022, 02:00   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,405
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by Nick View Post
The object rating is a 32-bit integer, so that shouldn't be causing a wrap problem.
Well, that comment aged poorly. Luckily backwardsEric has done a fix, it will be in the dev builds soon.
__________________
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 June 30, 2022, 06:37   #7
backwardsEric
Swordsman
 
Join Date: Aug 2019
Posts: 329
backwardsEric is on a distinguished road
Quote:
Originally Posted by Nick View Post
Well, that comment aged poorly. Luckily backwardsEric has done a fix, it will be in the dev builds soon.
That change probably isn't good enough. As PowerWyrm said, it's likely an issue in the object_value_real() calculation; its return value is an int, which will be a 16-bit type when compiling for win32, and that won't be enough to hold the value of the plain gold ring.
backwardsEric is offline   Reply With Quote
Old June 30, 2022, 07:02   #8
backwardsEric
Swordsman
 
Join Date: Aug 2019
Posts: 329
backwardsEric is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
That change probably isn't good enough. As PowerWyrm said, it's likely an issue in the object_value_real() calculation; its return value is an int, which will be a 16-bit type when compiling for win32, and that won't be enough to hold the value of the plain gold ring.
I take that back, int is a 32-bit type on win32; and object_value_real() for the plain gold ring returns 1682025150 when the Windows front end is run under Wine. I'm still a bit doubtful that the other floor objects would add enough to the rating to cause an overflow (the plain gold ring's contribution is capped at 25000 * 25000 = 625000000; would need ~6 times that from the other objects to overflow a uint32_t).
backwardsEric is offline   Reply With Quote
Old June 30, 2022, 09:51   #9
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,938
PowerWyrm is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
object_value_real() for the plain gold ring returns 1682025150
In my variant which is based off V, when I put a debug breakpoint on object_value_real() for the One Ring, I get 400100000 from a base power of 20000. If like OP said the V power for the One Ring is 1400000, there will be an overflow in object_value_real() since you get value = a * power * power + b * power with a = 1 and b = 5 and power = 1400000 -> value = 1 960 007 000 000, which turns into 1 501 913 024 after fitting into an int32.

So the bug in indeed in object_power().
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old June 30, 2022, 12:30   #10
Thraalbee
Knight
 
Thraalbee's Avatar
 
Join Date: Sep 2010
Location: Stockholm
Posts: 696
Thraalbee is on a distinguished road
Maybe you are looking at this the wrong way. Are you sure you are in control? Have you considered the option that if the ring finds @ unattractive it projects low value?
Thraalbee 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
Is it wrong ... Moving Pictures Vanilla 8 April 12, 2018 04:30
What am I doing wrong? Moving Pictures Vanilla 83 April 8, 2018 14:41
Ring of Damage vs Stat gain ring icefyre Vanilla 6 May 31, 2017 06:06
Ring of Slaying vs. Ring of Damage Ingwe Ingweron Vanilla 27 October 13, 2013 17:23
Ring of Frost [12] or Ring of Strength +4 davidonabus Vanilla 3 October 10, 2010 08:55


All times are GMT +1. The time now is 15:38.


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