Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 3, 2016, 00:41   #1
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,453
Donated: $60
Nick is on a distinguished road
Schrödinger's bug

So (fingers crossed) I am now back to some sort of regular development work, and my first task is to try and finish tracking down this bug:

Quote:
Originally Posted by Ingwe Ingweron View Post
Bug: Items previously found and ignored being redisplayed as unknown objects after another treasure detection within their range. Note the two red asterisks to @'s left. These were previously ignored objects, but now show again after use of treasure detection.
I have identified that the problem is player knowledge of objects being wiped on closing and reopening the game. So I thought I would track down where the loss of information was happening by running in gdb and watching the appropriate known object. Result? The object I was watching remained known, but all others still disappeared.

While I'm slightly flattered by how important the game obviously considers me, it doesn't help fix the bug. Any suggestions? I think optimisation is already set to 0 (unless something is overriding what's in src/Makefile).
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old October 3, 2016, 02:22   #2
debo
Veteran
 
debo's Avatar
 
Join Date: Oct 2011
Location: Toronto, Canada
Posts: 2,291
debo is on a distinguished road
Quote:
Originally Posted by Nick View Post
Any suggestions?
Remove the ID game and monster knowledge and have everything known to the player from when they start the game?
__________________
Glaurung, Father of the Dragons says, 'You cannot avoid the ballyhack.'
debo is offline   Reply With Quote
Old October 3, 2016, 02:31   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,453
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by debo View Post
Remove the ID game and monster knowledge and have everything known to the player from when they start the game?
Wouldn't help - this is whether the player remembers that individual found items on the current level even exist.

Your attempt to help is noted.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old October 3, 2016, 03:04   #4
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,808
Derakon is on a distinguished road
Does it consistently work like that, that the item you keep an eye on remains known while others vanish?

Since you're closing and re-opening the game, I kind of assume you don't have a "reading memory that has been freed" type of situation here. What are the repro steps?
Derakon is offline   Reply With Quote
Old October 3, 2016, 03:13   #5
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,015
Donated: $40
Pete Mack is on a distinguished road
There's another problem. After detecting once, detecting a second time does not remove items picked up by monsters
Pete Mack is offline   Reply With Quote
Old October 3, 2016, 03:18   #6
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
Quote:
Originally Posted by Nick View Post
I have identified that the problem is player knowledge of objects being wiped on closing and reopening the game. So I thought I would track down where the loss of information was happening by running in gdb and watching the appropriate known object. Result? The object I was watching remained known, but all others still disappeared.

While I'm slightly flattered by how important the game obviously considers me, it doesn't help fix the bug. Any suggestions? I think optimisation is already set to 0 (unless something is overriding what's in src/Makefile).
Well, here's one bug: use item with effect_handler_SENSE_OBJECT (e.g., scroll of treasure detection), detect some objects and close the game. Load it again and the red '*' are no longer there. As far as I can tell, that's because object_sense() in obj-knowledge.c creates new object without tval and sval (that is, with tval and sval 0, since it's mem_zalloc'ed). What is needed is tval 0 ("none") and sval 2 ("unknown item") (map_info() looks for that, specifically for obj->kind == unknown_item_kind). Objects with tval and sval 0 cannot be loaded (load.c, rd_item()):
Code:
	obj->kind = lookup_kind(obj->tval, obj->sval);

	/* Check we have a kind */
	if ((!obj->tval && !obj->sval) || !obj->kind) {
		object_delete(&obj);
		return NULL;
	}
t4nk is offline   Reply With Quote
Old October 3, 2016, 03:42   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,453
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Well, here's one bug: use item with effect_handler_SENSE_OBJECT (e.g., scroll of treasure detection), detect some objects and close the game. Load it again and the red '*' are no longer there. As far as I can tell, that's because object_sense() in obj-knowledge.c creates new object without tval and sval (that is, with tval and sval 0, since it's mem_zalloc'ed). What is needed is tval 0 ("none") and sval 2 ("unknown item") (map_info() looks for that, specifically for obj->kind == unknown_item_kind).
Awesome, problem solved
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick 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.5 dev bug: refresh bug at edge of labyrinth maps Nomad Vanilla 5 July 29, 2013 13:37
Bug or no bug: Mushrooms identified immediately Zababa Vanilla 2 June 16, 2010 01:32


All times are GMT +1. The time now is 13:55.


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