Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old March 16, 2017, 10:04   #61
Clearshade
Rookie
 
Join Date: Dec 2011
Posts: 6
Clearshade is on a distinguished road
FYI,
@ now at DL18 and have found following trap types since DL1:
poison gas, acid, blinding gas, poison pit, pit, teleport rune, dart, and summoning rune

I am playing from a download of yesterday March 15.
Clearshade is offline   Reply With Quote
Old March 16, 2017, 16:15   #62
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,820
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Nomad View Post
I don't seem to be encountering any trap types other than trap doors and pits in the early game. (Messing about in debug mode with scrolls of Create Traps, it seems as if you only get those two types until devel 20, after which summoning traps show up, and then the other types don't seem to show until dlevel 40.)

Also, the trap.txt file has stray extra "visibility:0" lines at the end of the entries for 'summon foe' and 'hellhole'.
Yeah the probability calculation in pick_trap() is incorrect. Say you have 3 traps, first and third one of rarity 1 and second one of rarity 0. The correct probability table would be (100, 100, 200) but it's currently (100, 0, 100) since previous probability is only added for valid traps. Then there's an off-by-one error when picking the trap: if pick = randint0(200) returns 100, the code doing (pick > trap_probs[i]) returns the first trap when it should return the third trap with (pick >= trap_probs[i]) since you have two sets of equal probablility, one of (0-99) and one of (100-199).

Something like this:

Code:
for (i = 0; i < z_info->trap_max; i++)
    {
        /* Get this trap */
        struct trap_kind *kind = &trap_info[i];

        trap_probs[i] = trap_prob_max;

        /* Ensure that this is a valid player trap */
        ...

        /* Trap is okay, store the cumulative probability */
        trap_probs[i] += (100 / kind->rarity);
        trap_prob_max = trap_probs[i];
    }

    /* No valid trap */
    ...

    /* Pick at random. */
    pick = randint0(trap_prob_max);
    for (i = 0; i < z_info->trap_max; i++)
    {
        if (pick < trap_probs[i]) break;
    }
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!

Last edited by PowerWyrm; March 16, 2017 at 16:24.
PowerWyrm is offline   Reply With Quote
Old March 16, 2017, 16:40   #63
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,820
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Nick View Post
Looks like I might have messed up the trap selection process. Will check.
See above

Other remarks:
- square_note_spot() calls square_reveal_trap() without checking square_issecrettrap() -- maybe that's the reason stuff is detected out of LOS
- square_reveal_trap() does a flat "skill search < trap power", meaning that trap detection is an "on/off" switch -- is that intended?
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 16, 2017, 18:13   #64
Nomad
Knight
 
Nomad's Avatar
 
Join Date: Sep 2010
Location: England
Posts: 915
Nomad is on a distinguished road
Amulet of Searching comes up as "an Amulet of 246:Searching".
Nomad is offline   Reply With Quote
Old March 16, 2017, 20:15   #65
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 51
Posts: 6,325
Donated: $60
Nick is on a distinguished road
OK, thanks for finding all this nonsense everyone (although I'm slightly hurt that my inspired name-change for "Searching has been reported as a bug).

Didn't get to do anything on it as planned yesterday because my dev machine had issues, but will get to fixing soon.
__________________
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 March 16, 2017, 21:00   #66
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 51
Posts: 6,325
Donated: $60
Nick is on a distinguished road
OK, fixed version has been pushed - should be built and on the nightlies page within the next half hour.

Quote:
Originally Posted by PowerWyrm View Post
- square_note_spot() calls square_reveal_trap() without checking square_issecrettrap() -- maybe that's the reason stuff is detected out of LOS
- square_reveal_trap() does a flat "skill search < trap power", meaning that trap detection is an "on/off" switch -- is that intended?
I'm not sure that checking square_issecrettrap() is needed, but I did it anyway - I need to check the whole logic of that.

Yes, trap detection is meant to be on/off - if the player has sufficient skill, they will always detect the trap, and if not, they never will. There is (usually) some randomness involved in the visibility rating of the particular trap instance, but once the trap is created it's deterministic.
__________________
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 March 19, 2017, 05:07   #67
chknflyrice
Adept
 
Join Date: Jan 2017
Location: U.S.ofA.
Posts: 109
chknflyrice is on a distinguished road
I love that I read the entirety of those posts like I understand any of it.
chknflyrice is offline   Reply With Quote
Old March 21, 2017, 00:23   #68
Nomad
Knight
 
Nomad's Avatar
 
Join Date: Sep 2010
Location: England
Posts: 915
Nomad is on a distinguished road
Traps are definitely more interesting now, especially in the mid to late game. I just tried to sneak past a sleeping AMHD and stepped on a siren trap. You don't get that kind of drama with always-visible traps!
Nomad is offline   Reply With Quote
Old March 22, 2017, 13:20   #69
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,287
Ingwe Ingweron is on a distinguished road
I was surprised when a rock dropped on @'s head and he was left stunned. Setting off the undiscovered trap at DL 100 and CL 46 was surprising in itself, but since @ had pStun, why did the rock falling not just cause damage but allow @ to avoid the stunning effect?
__________________
“We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.”
― Tom Stoppard, Rosencrantz and Guildenstern are Dead
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
Traps Egavactip v4 0 June 5, 2012 21:52
More thoughts on traps Therem Harth Vanilla 13 October 1, 2011 16:52
traps gfx fyonn Vanilla 4 September 25, 2010 02:09
Setting traps barna10 Variants 1 August 16, 2010 11:16
Traps Zero Vanilla 10 January 22, 2008 15:06


All times are GMT +1. The time now is 19:34.


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