Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 13, 2009, 03:10   #1
jv123
Scout
 
Join Date: May 2009
Posts: 37
jv123 is on a distinguished road
Bug: new-style monster list does not correctly report line-of-sight

The new-style monster list doesn't always report line-of-sight correctly. Take a look at this save file. The character has telepathy and so is aware of the pack of hounds in the nearby room, but although he can target 3 of them directly, the monster list reports that he can't see any of them.

Note that /without/ telepathy he likely wouldn't be able to see any, since the room isn't lit --- I guess that's how it's calculating things at the moment. But I think a different algorithm is needed to cope with things like this: for each monster you're aware of, you need to check directly to see if it's in line-of-sight.

Cheers,
JV.
Attached Files
File Type: zip Jamie_I.zip (8.3 KB, 205 views)
jv123 is offline   Reply With Quote
Old June 13, 2009, 03:29   #2
jv123
Scout
 
Join Date: May 2009
Posts: 37
jv123 is on a distinguished road
It also reports that you can see a monster, when you can't! Again, an example is attached.
Attached Files
File Type: zip Jamie_I.zip (8.6 KB, 199 views)
jv123 is offline   Reply With Quote
Old June 13, 2009, 09:59   #3
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by jv123 View Post
The new-style monster list doesn't always report line-of-sight correctly. Take a look at this save file. The character has telepathy and so is aware of the pack of hounds in the nearby room, but although he can target 3 of them directly, the monster list reports that he can't see any of them.

Note that /without/ telepathy he likely wouldn't be able to see any, since the room isn't lit --- I guess that's how it's calculating things at the moment. But I think a different algorithm is needed to cope with things like this: for each monster you're aware of, you need to check directly to see if it's in line-of-sight.
It already does that, using player_has_los_bold() - which clearly isn't working. I thought the 'bold' bit meant that it didn't check to see whether the square was lit, so it should have picked up this case.

Thanks for the report - I've opened a ticket for this.
Magnate is offline   Reply With Quote
Old June 13, 2009, 12:12   #4
ajps
Apprentice
 
Join Date: May 2007
Location: Manchester, UK
Posts: 50
ajps is on a distinguished road
Quote:
Originally Posted by Magnate View Post
It already does that, using player_has_los_bold() - which clearly isn't working. I thought the 'bold' bit meant that it didn't check to see whether the square was lit, so it should have picked up this case.

Thanks for the report - I've opened a ticket for this.
I think player_has_los() is for actual genuine line-of-sight, not awareness or projectability and all that jazz. If you want everything targetable, use target_able() instead. If you want everything the player is aware of that might be able to get him with a breath, erm... you might have to do that yourself.
ajps is offline   Reply With Quote
Old June 13, 2009, 14:25   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by ajps View Post
I think player_has_los() is for actual genuine line-of-sight, not awareness or projectability and all that jazz. If you want everything targetable, use target_able() instead. If you want everything the player is aware of that might be able to get him with a breath, erm... you might have to do that yourself.
Hmm. I'll try player_has_los() and see if it picks up this case of monsters sensed by ESP who are not visible to the naked eye. Thanks.
Magnate is offline   Reply With Quote
Old June 13, 2009, 14:34   #6
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Magnate View Post
In conclusion, I don't think there's anything wrong with the monlist code. I think the bug has revealed an underlying problem with the ESP code, in that monsters sensed by ESP do not update cave_info[] as viewable. Will look into this further. I'm working on an assumption that this bug only occurs with ESP - if anyone observes otherwise, let me know.
Fixed in r1439.

Last edited by Magnate; June 13, 2009 at 15:19.
Magnate is offline   Reply With Quote
Old June 13, 2009, 15:00   #7
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Ok, I have committed r1438 which uses player_can_see_bold rather than player_has_los_bold. I'm not sure if this will work (as it may rely on the grid being lit), but please test with ESP.
Magnate is offline   Reply With Quote
Old June 13, 2009, 15:20   #8
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Magnate View Post
Ok, I have committed r1438 which uses player_can_see_bold rather than player_has_los_bold. I'm not sure if this will work (as it may rely on the grid being lit), but please test with ESP.
That wasn't the answer. The answer is to use (m_ptr->mflag & MFLAG_VIEW), which is designed to record visibility. It wasn't being set properly when monsters in LOS were detected by ESP - fixed in r1439.
Magnate is offline   Reply With Quote
Old June 13, 2009, 16:37   #9
jv123
Scout
 
Join Date: May 2009
Posts: 37
jv123 is on a distinguished road
Thanks Magnate, a speedy fix as usual!
jv123 is offline   Reply With Quote
Old June 13, 2009, 18:06   #10
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by jv123 View Post
Thanks Magnate, a speedy fix as usual!
Well, I gave up and used projectable() in r1441, as I think the LOS concept is broken with respect to ESP.
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
bug: monster list r1418 bebo Vanilla 4 June 13, 2009 15:38
Line of sight Donald Jonker Vanilla 1 June 7, 2009 02:15
monster list info DaviddesJ Vanilla 1 March 31, 2008 04:10
The Visible monster list, modifications. Irashtar Vanilla 4 October 27, 2007 02:40
Terrain changes visible outside characters sight -- Feature or Bug?? Elsairon Vanilla 3 June 12, 2007 14:04


All times are GMT +1. The time now is 18:31.


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